Calculations

Calculate token pair amounts for create pool and open position

post

Calculate token pair amounts for create pool and open position

Computes the required token amounts for creating a pool and opening an initial position.

Body
config_indexinteger · int32Required

Configuration index

Example: 16
input_amountinteger · int64Required

Input token amount

Example: 1
is_base_0booleanRequired

Whether token 0 is the base token

mint0stringRequiredExample: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
mint1stringRequiredExample: Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
open_timeinteger · int64Required

Opening time (Unix timestamp)

Example: 1710326400
pricenumber · doubleRequired

Price value

Example: 1
slippage_bpsinteger · int64Required

Slippage in basis points

Example: 50
tick_lower_pricenumber · doubleRequired

Lower price boundary

Example: 0.9
tick_upper_pricenumber · doubleRequired

Upper price boundary

Example: 1.1
user_walletstringRequiredExample: EQdJjaPwUL6X3GjUp3ZQ1T3QA4XL9g9v3Z6rSUMGALMt
with_metadatabooleanRequired

Whether to include metadata

Responses
200

Compute pair amount

application/json
post
/api/compute_pair_amount/

Calculate token pair amounts for decreasing liquidity

post

Calculate token pair amounts for decreasing liquidity

Computes the token amounts that will be withdrawn when removing liquidity from a position.

Body
amm_config_indexinteger · int32Required

AMM configuration index

Example: 6
input_amountinteger · int64Required

Input token amount

Example: 1
is_base_0booleanRequired

Whether token 0 is the base token

mint0stringRequired

First pool token address

Example: ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx
mint1stringRequired

Second pool token address

Example: Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
tick_lower_indexinteger · int32Required

Lower tick index

Example: -112059
tick_upper_indexinteger · int32Required

Upper tick index

Example: -109986
user_walletstringRequired

User wallet address

Example: EQdJjaPwUL6X3GjUp3ZQ1T3QA4XL9g9v3Z6rSUMGALMt
Responses
200

Compute pair amount decrease liquidity

application/json
post
/api/compute_pair_amount_decrease_liquidity/

Calculate token pair amounts for increasing liquidity

post

Calculate token pair amounts for increasing liquidity

Computes the required token amounts for adding liquidity to an existing position.

Body
amm_config_indexinteger · int32Required

AMM configuration index

Example: 6
input_amountinteger · int64Required

Input token amount

Example: 100
is_base_0booleanRequired

Whether token 0 is the base token

mint0stringRequired

First pool token address

Example: ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx
mint1stringRequired

Second pool token address

Example: Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
slippage_bpsinteger · int64Required

Slippage in basis points

Example: 50
tick_lower_indexinteger · int32Required

Lower tick index

Example: -112059
tick_upper_indexinteger · int32Required

Upper tick index

Example: -109986
user_walletstringRequired

User wallet address

Example: EQdJjaPwUL6X3GjUp3ZQ1T3QA4XL9g9v3Z6rSUMGALMt
Responses
200

Compute pair amount increase liquidity

application/json
post
/api/compute_pair_amount_increase_liquidity/

Calculate token pair amounts for opening position

post

Calculate token pair amounts for opening position

Computes the required token amounts for opening a liquidity position in an existing pool.

Body
amm_config_indexinteger · int32Required

AMM configuration index

Example: 3
input_amountinteger · int64Required

Input token amount

Example: 1
is_base_0booleanRequired

Whether token 0 is the base token

mint0stringRequired

First pool token address

Example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
mint1stringRequired

Second pool token address

Example: Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
tick_lower_pricenumber · doubleRequired

Lower price boundary

Example: 2
tick_upper_pricenumber · doubleRequired

Upper price boundary

Example: 3
Responses
200

Compute pair amount only position

application/json
post
/api/compute_pair_amount_only_position/

Calculate output amount for swap

post

Calculate output amount for swap

Computes the expected output token amount for a given input amount in a swap.

Body
amm_config_indexinteger · int32Required

AMM configuration index

Example: 16
amountinteger · int64Required

Token amount

Example: 1000000
input_mintstringRequired

Input token mint address

Example: ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx
output_mintstringRequired

Output token mint address

Example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
slippage_bpsinteger · int64Required

Slippage in basis points

Example: 50
swap_modestring · enumRequiredPossible values:
user_walletstringRequired

User wallet address

Example: EQdJjaPwUL6X3GjUp3ZQ1T3QA4XL9g9v3Z6rSUMGALMt
Responses
200

Compute pair amount for swap

application/json
post
/api/compute_pair_amount_swap/

Last updated