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
url: https://open-api.openocean.finance/v3/arbitrum/gmx_quote
method: get
params:
parameter
type
example
description
inTokenAddress
string
0xaf88d065e77c8cC2239327C5EDb3A432268e5831
token address
outTokenAddress
string
0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9
out token address
amount
string
100
Please set token amount without decimals.
e.g.
1.00 ETH set as 1
1.23 USDC set as 1.23
gasPrice
string
0.1
Please set the gas price in GWEI without decimals
e.g. 14 GWEI set as 14
multi_dex
boolean (Optional)
false (default false)
If added, it's the comparison between the price from dexs integrated to the price from GMX V2.
Example:
request
response:
Swap Quote
url: https://open-api.openocean.finance/v3/arbitrum/gmx_swap_quote
method: get
params:
parameter
type
example
description
inTokenAddress
string
0xaf88d065e77c8cC2239327C5EDb3A432268e5831
token address
outTokenAddress
string
0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9
out token address
amount
string
100
Please set token amount without decimals.
e.g.
1.00 ETH set as 1
1.23 USDC set as 1.23
gasPrice
string
0.1
Please set the gas price in GWEI without decimals
e.g. 14 GWEI set as 14
slippage
number
1
Define the acceptable slippage level by inputting a percentage value within the range of 0.05 to 50. e.g. 1% slippage set as 1
default value 1
account
string
user's address
referrer
string (Optional)
0x0000000000000000000000000000000000000000
Please contact us for a unique referrer parameter
multi_dex
boolean. (Optional)
false (default false)
If added, it's the comparison between the price from dexs integrated to the price from GMX V2.
Example:
Request:
response:
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
url: https://open-api.openocean.finance/v3/arbitrum/gmx_transaction
method: get
params:
parameter
type
example
description
hash
string
transaction hash
Example:
request:
response:
Last updated