API
1. Get a quote
Path: /v4/gasless/{chain}/quote
Method: GET
Request param:
chain
true
string
42161
chain id
inTokenAddress
true
string
0xddc0...
in token address
outTokenAddress
true
string
0xddc0...
out token address
amountDecimals
true
string
1000000
Token amount with decimals. For example, if 1 USDT is input, use 1000000 (1 USDT * 10^6).
gasPriceDecimals
true
string
1000000000
GasPrice with decimals
slippage
false
number
1
slippage 1%
referrer
false
string
0xddc0...
referrer address
disabledDexIds
false
string
3,5
disabled dex id, use "," to separate
Request example:
https://open-api.openocean.finance/v4/gasless/42161/quote?inTokenSymbol=RDPX&inTokenAddress=0x32eb7902d4134bf98a28b963d26de779af92a212&outTokenSymbol=USDC&outTokenAddress=0xaf88d065e77c8cC2239327C5EDb3A432268e5831&amountDecimals=1000000000000000000&gasPriceDecimals=1000000000&slippage=0.02
Response example:
{
"code": 200,
"data": {
"inToken": {
"address": "0x32eb7902d4134bf98a28b963d26de779af92a212",
"decimals": 18,
"symbol": "RDPX",
"name": "Dopex Rebate Token",
"usd": "1.61",
"volume": "0.03220000"
},
"outToken": {
"address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"decimals": 6,
"symbol": "USDC",
"name": "USD Coin",
"usd": "0.999902",
"volume": "0.69644574"
},
"native": {
"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"decimals": 18,
"symbol": "ETH",
"name": "ETH",
"usd": "2466.73",
"volume": "0.01652104"
},
"fees": [
{
"address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"decimals": 6,
"symbol": "USDC",
"name": "USD Coin",
"usd": "0.999902",
"in_fee_amount": 0.017914,
"volume": "0.01791224"
},
{
"address": "0x32eb7902d4134bf98a28b963d26de779af92a212",
"decimals": 18,
"symbol": "RDPX",
"name": "Dopex Rebate Token",
"usd": "1.61",
"volume": "0.016521",
"in_fee_amount": 0.0102615
}
],
"flags": 2,
"inAmount": "20000000000000000",
"outAmount": "696514",
"estimatedGas": 500622,
"path": {
"from": "0x32Eb7902D4134bf98A28b963D26de779AF92A212",
"to": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"parts": 10,
"routes": [
{
"parts": 10,
"percentage": 100,
"subRoutes": [
{
"from": "0x32Eb7902D4134bf98A28b963D26de779AF92A212",
"to": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
"parts": 25,
"dexes": [
{
"dex": "UniswapV3",
"id": "0xbA1F4C88d563DF1f66F726839B0e7E81183CE929",
"parts": 25,
"percentage": 100,
"fee": 0.003
}
]
},
{
"from": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
"to": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"parts": 25,
"dexes": [
{
"dex": "SolidlyV3",
"id": "0x6C9aB1C1dC392b53f9FB2EA6D9dAcE5f99efdC48",
"parts": 25,
"percentage": 100,
"fee": 0.001687
}
]
}
]
}
]
},
"aggregator": "OpenOcean",
"from": "0xB1DD8E9ebbF5F150B75642D1653dF0dacd0bfF47",
"to": "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64",
"minOutAmount": 671634,
"value": "0",
"data": "0x90411a32000000000000000000000000f851d3d46237ec552a4c6e383a973115e781b1a5000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000032eb7902d4134bf98a28b963d26de779af92a212000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831000000000000000000000000f851d3d46237ec552a4c6e383a973115e781b1a5000000000000000000000000b1dd8e9ebbf5f150b75642d1653df0dacd0bff4700000000000000000000000000000000000000000000000000470de4df82000000000000000000000000000000000000000000000000000000000000000a858c00000000000000000000000000000000000000000000000000000000000aa0c200000000000000000000000000000000000000000000000000000000000000020000000000000000000000003fe9c9165d3cb5086ce49c9b4a67c01d4e869bfd0000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000104e5b07cdb000000000000000000000000ba1f4c88d563df1f66f726839b0e7e81183ce929000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000470de4df820000000000000000000000000000f851d3d46237ec552a4c6e383a973115e781b1a500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000002e32eb7902d4134bf98a28b963d26de779af92a212000bb882af49447d8a07e3bd95bd0d56f35241523fbab100000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000003a451a7431600000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064eb5625d900000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab10000000000000000000000006c9ab1c1dc392b53f9fb2ea6d9dace5f99efdc480000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000006c9ab1c1dc392b53f9fb2ea6d9dace5f99efdc480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000084c31b8d7a000000000000000000000000b1dd8e9ebbf5f150b75642d1653df0dacd0bff470000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000276a40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000",
"useTime": 0.659
}
}
2. Submit gasless swap
Path: /v4/gasless/{chain}/swap
Method: POST
Request param:
chain
true
string
42161
chain id
Request body:
from
true
string
0x72f1...
user wallet address
to
true
string
0x6352...
quote response
data
true
string
0x9041....
quote response
amountDecimals
true
number
200000000000000
Token amount with decimals. For example, if 1 USDT is input, use 1000000 (1 USDT * 10^6).
feeAmount1
true
number
23660
quote response
feeAmount2
true
number
139163400000
quote response
flag
true
number
2
quote response
gasPriceDecimals
true
number
100000000
gasPrice
deadline
true
number
1747127367
permit deadline
inToken
true
string
0x32eb...
in token address
outToken
true
string
0xaf88...
out token address
nonce
true
number
0
permit nonce
permit
true
string
0x30f28...
permit data
usdValuation
true
number
0.032
trade volume($)
Request example:
https://open-api.openocean.finance/v4/gasless/42161/swap?inTokenSymbol=RDPX&inTokenAddress=0x32eb7902d4134bf98a28b963d26de779af92a212&outTokenSymbol=USDC&outTokenAddress=0xaf88d065e77c8cC2239327C5EDb3A432268e5831&amountDecimals=1000000000000000000&gasPriceDecimals=1000000000&slippage=0.02
Request body example:
{
"from": "0x72f16Cae8F50Ad615AB5A8e231A496b2ace52532",
"to": "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64",
"data": "0x90411a32000000000000000000000000f851d3d46237ec552a4c6e383a973115e781b1a5000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000032eb7902d4134bf98a28b963d26de779af92a212000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831000000000000000000000000f851d3d46237ec552a4c6e383a973115e781b1a5000000000000000000000000b1dd8e9ebbf5f150b75642d1653df0dacd0bff4700000000000000000000000000000000000000000000000000470de4df82000000000000000000000000000000000000000000000000000000000000000a885300000000000000000000000000000000000000000000000000000000000aa39000000000000000000000000000000000000000000000000000000000000000020000000000000000000000003fe9c9165d3cb5086ce49c9b4a67c01d4e869bfd0000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000104e5b07cdb000000000000000000000000ba1f4c88d563df1f66f726839b0e7e81183ce929000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000470de4df820000000000000000000000000000f851d3d46237ec552a4c6e383a973115e781b1a500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000002e32eb7902d4134bf98a28b963d26de779af92a212000bb882af49447d8a07e3bd95bd0d56f35241523fbab100000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002449f86542200000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000104e5b07cdb0000000000000000000000006f38e884725a116c9c7fbf208e79fe8828a2595f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000b1dd8e9ebbf5f150b75642d1653df0dacd0bff4700000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000002e82af49447d8a07e3bd95bd0d56f35241523fbab1000064af88d065e77c8cc2239327c5edb3a432268e58310000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"amountDecimals": "20000000000000000",
"feeAmount1": "23660",
"feeAmount2": "13916340000000000",
"flag": 2,
"gasPriceDecimals": "10000000",
"deadline": 1747127367,
"inToken": "0x32eb7902d4134bf98a28b963d26de779af92a212",
"outToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"nonce": "0",
"permit": "0x30f28b7a00000000000000000000000032eb7902d4134bf98a28b963d26de779af92a21200000000000000000000000000000000000000000000000000470de4df82000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068230c47000000000000000000000000b1dd8e9ebbf5f150b75642d1653df0dacd0bff4700000000000000000000000000000000000000000000000000470de4df82000000000000000000000000000072f16cae8f50ad615ab5a8e231a496b2ace5253200000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000041480ece65964a49824a41690c6052bf0f26e5ea75554dd72be9b83a8b5a42f1e2075aaac15193296c973ff6e6957beeb395f8dc9f97ee5f9ec585e2fe3bbab0971c00000000000000000000000000000000000000000000000000000000000000",
"usdvaluation": 0.032
}
Response example:
{
"code": 0,
"msg": "ok",
"orderHash": "0xcd287de3af73d2502755df502e422a5c44e5e4231de54e5243607a29ac2455e4"
}
3. Get order status
Path: /v4/gasless/{chain}/order
Method: GET
Request param:
chain
true
string
42161
chain id
orderHash
true
string
0xddc0...
swap response
Request example:
https://open-api.openocean.finance/v4/gasless/42161/order?orderHash=0xcd287de3af73d2502755df502e422a5c44e5e4231de54e5243607a29ac2455e4
Response example:
{
"code": 0,
"msg": "ok",
"data": {
"hash": "0x1c60a8fa4fe725031005128aaf5e688e9790053b2c47880a488ab526ce177c89",
"err": ""
}
}
Last updated