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

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.

  • Example:

    {
    "code": 200,
    "data": {
        "inToken": {
            "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
            "decimals": 6,
            "symbol": "USDC",
            "name": "USD Coin",
            "usd": "1.001",
            "volume": 100.1
        },
        "outToken": {
            "address": "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
            "decimals": 6,
            "symbol": "USDT",
            "name": "Tether USD",
            "usd": "1.001",
            "volume": 100.07039042
        },
        "inAmount": "100000000",
        "outAmount": "99970420",
        "estimatedGas": "859474",
        "dexes": [
            {
                "dexIndex": 54,
                "dexCode": "GMXV2",
                "swapAmount": "99970420"
            }
        ],
        "path": {
            "from": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
            "to": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
            "parts": 10,
            "routes": [
                {}
            ]
        },
        "save": 0,
        "price_impact": "-0.03%"
    }
    }

Swap Quote

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

parameter

type

example

description

hash

string

transaction hash

Last updated