Native Tokens Support
Native Relay RFQ API and Router support swapping with native tokens for any trading pair involving a wrapped-native token address (WETH9). For example, if you see WETH->USDT in /orderbook , you may quote and swap ETH->USDT directly.
Quote
For /indicative-quote and /firm-quote , use either:
0 address
0x0000000000000000000000000000000000000000E address
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
to represent the native tokens.
Pricing will follow the wrapped-native token trading pair.
By default, native token trading pairs will NOT appear in /orderbook return. If you wish to include them, refer to the following section.
Orderbook
If you wish to receive native token trading pairs in orderbook endpoint, please add one of the following parameters in the request:
showNative=0xEfor0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeEshowNative=0x0for0x0000000000000000000000000000000000000000
Native token trading pairs will be appended to orderbook represented by the address you prefer. Only 0x0 and 0xE are accepted values.
Wrap / Unwrap
If you quote native to its wrapped token (for example ETH->WETH) or the reverse, /firm-quote returns toWrap: true or toUnwrap: true with empty orders, no txRequest, and amountIn == amountOut. Call WETH9 deposit / withdraw directly. /indicative-quote returns price: 1 for these.
Solana
On Solana, native SOL may be used as token_in, but not as token_out (error 171079); use wrapped SOL instead.
Onchain Execution
Please remember to submit payable value according to the /firm-quote return. The payable value is indicated under txRequest.value.
Example:
Tx: https://www.tdly.co/shared/simulation/b25777d2-001f-4f88-a88f-ca5d0978fa9f
Last updated