GET /calldata
Similar to /firm-quote, but the response is raw calldata that can be directly submitted on-chain.
Header and Params are exactly the same as /firm-quote
.
Headers
Name | Description |
---|---|
| API Key retrieved from the Native app |
Params
Name | Description |
---|---|
| Blockchain name - Refer to the |
| Token address for the token to be sold |
| Token address for the token to be bought |
| Amount of token to be sold, in ether unit |
| amount of token to be sold, in wei unit |
| Address of the user that sells the |
| Address of the end user that initiated the swap request |
| Address of the user that receives the |
| Expiry time in seconds This variable will be passed on to the market makers to consider when they give the quote. Market makers would be able to give better quote for a shorter expiry time. It will affect the deadlineTimestamp in the response if the quote from that market maker is chosen. If not provided, we will just use the default expiry time by the liquidity source. |
| Number in percentage value For example, passing the value 5 means 5%, 0.1 means 0.1% slippage tolerance. By default it's 0. |
Example
In this example, the wallet 0x42d4e9ee3f725c84b7934e4fda64f2be0f803130
requests transaction data for swapping 1 ETH to USDT on the Ethereum network.
Response
Name | Description |
---|---|
| The address that will send the calldata to the NativeRouter |
| The address of the NativeRouter |
| The raw input data that will be executed by the NativeRouter |
| The msg.value for the transaction. Will be 0 if the seller token is a non-native token. |
| Amount of token to be sold, in wei unit |
| The offset position (in bytes) of the param |
| The offset position (in bytes) of the param |
Example
from
,to
,calldata
: Thecalldata
can be sent from thefrom
address to theto
address to execute the swap. Ensure that thefrom
address has sufficient allowance set for the NativeRouter (which is theto
address).amountInOffset
: This indicates the offset position (in bytes) of theamountIn
parameter. For example, in the sample response above, theamountIn
(uint256) occupies bytes 100-131. This is useful if you want to adjust theamountIn
within the calldata.amountOutMinimumOffset
: This indicates the offset position (in bytes) of theamountOutMinimum
parameter. For example, in the sample response above, theamountOutMinimum
(uint256) occupies bytes 132-163. This is useful if you want to adjust theamountOutMinimum
(for slippage protection) within the calldata.
If you prefer to use only Native pools (PMM-only pricing), please contact the Native team to have this option configured for you.
Explore this endpoint and see how it works here.
Last updated