Arken Swap Engine API
Last updated
Was this helpful?
Last updated
Was this helpful?
API Endpoint: https://public-api.arken.finance
Please refer to Arken API for getting API tokens
Using Arken Finance Swap Engine API, you can find the best route to exchange assets and make the swap. Here are the step-by-step instructions on how to use Arken Swap Engine API:
Find the addresses of the tokens you want to swap. For example, swapping WETH -> USDT
WETH: 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
USDT: 0xdac17f958d2ee523a2206206994597c13d831ec7
Check for allowance of Arken Approve contract to spend source asset using /approve/allowance
If necessary, give approval for Arken Approve contract to spend the source token using /approve/transaction
Monitor the best exchange route using /swap/quote
When you are ready to swap, use /swap/swap
to generate the call data to perform the swap
/swap-engine/v1/{chainID}/approve/transaction
Token address you want to exchange
The number of tokens that the Arken Approve is allowed to spend.If not specified, it will be allowed to spend an infinite amount of tokens.
100000000000
/swap-engine/v1/{chainID}/approve/allowance
Token address you want to exchange
Wallet address for which you want to check
/swap-engine/v1/{chainID}/swap/quote
0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
0xdac17f958d2ee523a2206206994597c13d831ec7
10000000000000000
default: fast from network
/swap-engine/v1/{chainID}/swap/swap
0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
0xdac17f958d2ee523a2206206994597c13d831ec7
10000000000000000
The address that calls the Arken Dex contract
min: 0; max: 50;
1
Receiver of destination currency. default: fromAddress
default: fast from network