How to define the amount of tokens while using the API?#

For all interfaces involving token amounts in the DEX API, precision is required. For example, 1 ETH is represented as 1 × 10^18 .

What are the native token addresses for each chain?#

We have uniformly defined it as 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.

How to call the authorization contract and the transaction contract?#

Authorization contracts and transaction contracts are separate contracts, so your steps should be:

  1. Call the /approve-transaction interface to perform the authorization.
  2. After authorization is complete, call the /swap interface again to execute the swap.

About Solana computeUnitPrice and computeUnitPrice:#

  1. Using computeUnitPrice and computeUnitLimit can speed up transactions on the Solana network. computeUnitLimit is the limit that determines the maximum computing resource (referred to as CU, compute unit) available for each transaction. It’s analogous to gasLimit on Ethereum, which ensures that transactions won’t take too much computing resource and keeps the network stable.
  2. In addition, computeUnitPrice determines the priority cost of each CU, similar to gasPrice on Ethereum. Micro Lamport is the smallest unit of computeUnitPrice, which is one millionth of a Lamport. This price determines the priority level of the transaction. The higher the price, the more likely that the transaction can be processed faster.
  3. If you’re unfamiliar with certain blockchain terms, you can imagine computeUnitLimit as the maximum computing energy that can be used on a transaction, and computeUnitPrice the fee one is willing to pay to speed up a transaction process. Setting these two parameters correctly can help users execute transactions faster and ensure that those transactions are fully processed on the network.