⚡

Arken Swap Engine API

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:
  1. 1.
    Find the addresses of the tokens you want to swap. For example, swapping WETH -> USDT
    1. 1.
      WETH: 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
    2. 2.
      USDT: 0xdac17f958d2ee523a2206206994597c13d831ec7
  2. 2.
    Check for allowance of Arken Approve contract to spend source asset using /approve/allowance
  3. 3.
    If necessary, give approval for Arken Approve contract to spend the source token using /approve/transaction
  4. 4.
    Monitor the best exchange route using /swap/quote
  5. 5.
    When you are ready to swap, use /swap/swap to generate the call data to perform the swap

Chains

get
/swap-engine/v1/chains
Return supported chains list

Health Check

get
/swap-engine/v1/{chain}/healthcheck
API health check

Approve

get
/swap-engine/v1/{chain}/approve/spender
Address of the Arken Approve that must be trusted to spend funds for the exchange
Parameters
No parameters
Responses
200: OK
Address of the Arken Approve that must be trusted to spend funds for the exchange
400: Bad Request
bad request, invalid request parameters
500: Internal Server Error
internal server error
get
/swap-engine/v1/{chain}/approve/transaction
Generate data for calling the contract in order to allow the Arken Approve to spend funds
Parameters
Query
tokenAddress*
string
Token address you want to exchange
amount
string
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.
Responses
200: OK
Transaction body to allow the exchange with the Arken Approve
400: Bad Request
bad request, invalid request parameters
500: Internal Server Error
internal server error
get
/swap-engine/v1/{chain}/approve/allowance
Get the number of tokens that the Arken Approve is allowed to spend
Parameters
Query
tokenAddress*
string
Token address you want to exchange
walletAddress*
string
Wallet address for which you want to check
Responses
200: OK
400: Bad Request
bad request, invalid request parameters
500: Internal Server Error
internal server error

Info

get
/swap-engine/v1/{chain}/liquidity-sources
List of liquidity sources that are available for routing in the Arken Finance
Parameters
No parameters
Responses
200: OK
All supported protocols public
400: Bad Request
bad request, invalid request parameters
500: Internal Server Error
internal server error

Swap

get
/swap-engine/v1/{chain}/swap/quote
Find the best quote to exchange via Arken Finance
Parameters
Query
fromTokenAddress*
string
toTokenAddress*
string
amount*
string
gasPrice
string
default: fast from network
Responses
200: OK
Quote
400: Bad Request
bad request, invalid request parameters
500: Internal Server Error
internal server error
get
/swap-engine/v1/{chain}/swap/quote
Find the best quote to exchange via Arken Finance
Parameters
Query
fromTokenAddress*
string
toTokenAddress*
string
amount*
string
gasPrice
string
default: fast from network
Responses
200: OK
Quote
400: Bad Request
bad request, invalid request parameters
500: Internal Server Error
internal server error
​
​