API

1. Get Route

  • Path:/zap/{chain}/in/route

  • Method: POST

  • Path Parameters:

Parameter
isRequired
Type
Example
Description

chain

true

string

8453

chainId

  • Request body:

Parameter
isRequired
Type
Example
Description

dex

true

string

UNISWAP_V2

pool type, supports UNISWAP_V2,UNISWAP_V3

pool

true

string

0xc18f50...

address of the pool to zap into

positionTickUpper

false

number

-276350

max tick of the position, required if zap into a uniswapV3 pool.

positionTickLower

false

number

-276450

min tick of the position, required if zap into a uniswapV3 pool.

tokens

true

array

the tokens to use as zap source

tokens[n].token

true

string

0x833589...

token address

tokens[n].amount

true

string

1000000

token amount

slippage

true

string

100

maximum slippage tolerance in basis points (0.01%), used for aggregator (exceeding which the transaction will revert) and pool swap during zap (for additional zapping and for refund). From 0 to 5,000 inclusively. Example: 1 for 0.01%.

referrer

false

string

0x.....

referrer address

referrerFee

false

number

100

Specify the percentage of in-token you wish to receive from the transaction, within the range of 0% to 50%, with 1% represented as 100, in the range of 0.01 to 50. e.g. 1.2% fee set as 120 . Ignored if referrer is empty. By default, OpenOcean shares 30% of the fee. Please contact us if you wish to modify this rate.

  • example:

{
    "dex": "UNISWAP_V3",
    "pool": "0xc18f50d6a832f12f6dcaaeee8d0c87a65b96787e",
    "positionTickUpper": -276305,
    "positionTickLower": -276405,
    "tokens": [
        {
            "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
            "amount": 100000000
        }
    ],
    "slippage": 100,
    "referrer": "0xD01ef7C0A5d8c432fc2d1a85c66cF2327362E5C6"
}
  • Response:

2. Build Route

  • Path:/zap/{chain}/in/route/build

  • Method: POST

  • Path Parameters:

Parameter
isRequired
Type
Example
Description

chain

true

string

8453

chainId

  • Request body:

Parameter
isRequired
Type
Example
Description

route

true

string

MzYwNjAz.....

get from /in/route

deadline

false

number

1749718309

Expiration time in seconds

account

true

string

0x5fb7a....

the wallet that receiving the new position.

permits

false

array

the tokens to use permit2

permits[n].token

true

string

0x833589...

token address

permits[n].permit

true

string

0x30f28...

permit2 data

  • example:

  • Response:

Last updated