POST
/
v1
/
liquidity
/
remove
/
simulate
Simulate Remove Liquidity
curl --request POST \
  --url https://api.amm.flashnet.xyz/v1/liquidity/remove/simulate \
  --header 'Content-Type: application/json' \
  --data '{
  "lpTokensToRemove": "100000",
  "poolId": "03aabbccddeeff00112233445566778899aabbccddeeff00112233445566778899",
  "providerPublicKey": "03abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
}'
{
"assetAAmount": "50000000",
"assetBAmount": "25000",
"currentLpBalance": "200000",
"poolShareRemovedPercentage": "50.0",
"warningMessage": null
}

Body

application/json

Liquidity removal simulation parameters

Request body for simulating liquidity removal without executing it.

Simulation allows users to preview how much of each asset they would receive when burning their LP tokens.

poolId
string
required

LP public key of the pool to simulate removing liquidity from. The pool must exist and have liquidity.

Example:

"03aabbccddeeff00112233445566778899aabbccddeeff00112233445566778899"

providerPublicKey
string
required

Public key of the liquidity provider. Used to check current LP token balance.

Example:

"03abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"

lpTokensToRemove
integer
required

Amount of LP tokens to simulate burning, in their smallest unit. Must be positive and not exceed the provider's balance.

Required range: x >= 0
Example:

100000

Response

Simulation completed successfully

Response from liquidity removal simulation with expected outcomes.

assetAAmount
integer
required

Amount of Asset A that would be returned. Proportional to your share of the pool.

Required range: x >= 0
Example:

"50000000"

assetBAmount
integer
required

Amount of Asset B that would be returned. Proportional to your share of the pool.

Required range: x >= 0
Example:

"25000"

currentLpBalance
string
required

Current LP token balance of the provider. Shows how many tokens they have available to remove.

Example:

"200000"

poolShareRemovedPercentage
string
required

Percentage of the pool being removed.

Example:

"50.0"

warningMessage
string | null

Warning message if the simulation detects potential issues. Common warnings include removing all liquidity or insufficient balance.

Example:

"Removing more than 10% of pool liquidity may impact price"