GMX Exclusive API
This API is exclusively to leverage GMX V1 and V2 pools on Arbitrum. To ensure users get the best trading rates, v1 and v2 pools are compared and the API swaps with the most favorable option.
Price Quote
method: get
params:
parameter | type | example | description |
inTokenAddress | string | 0xaf88d065e77c8cC2239327C5EDb3A432268e5831 | token address |
outTokenAddress | string | 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9 | out token address |
amount | string | 100 | token amount(without decimals) |
gasPrice | string | 0.1 | without decimals |
multi_dex | boolean? | false (default false) | Optional params: If added, it's the comparison between the price from dexs integrated to the price from GMX V2. |
Swap Quote
method: get
params:
parameter | type | example | description |
inTokenAddress | string | 0xaf88d065e77c8cC2239327C5EDb3A432268e5831 | token address |
outTokenAddress | string | 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9 | out token address |
amount | string | 100 | token amount(without decimals) |
gasPrice | string | 0.1 | without decimals |
slippage | number | 1 | 1 equals 1%, 1%-100% |
account | string | user's address | |
referrer | string? | 0x0000000000000000000000000000000000000000 | Please contact us for a unique referrer parameter |
multi_dex | boolean? | false (default false) | Optional params: If added, it's the comparison between the price from dexs integrated to the price from GMX V2. |
If the "gmxFee" from above response is gmxFee>0 (meaning the swaps go through GMX V2 pools), it needs to use the following Get Transaction method to fetch the swap hash. otherwise, you could refer the docs here to get hashes.
Get Transaction
method: get
params:
parameter | type | example | description |
hash | string | transaction hash |
Last updated