Skip to main content

PumpAmmTask

Execute a swap task in the Pump AMM based on the given parameters.

Input: Pool address, input token amount, max allowed slippage, and swap direction.

Returns: Executes the swap operation in the Pump AMM with the given parameters.

Example: Swap 10 tokens from X to Y with a maximum slippage of 0.5%

{
"pumpAmmTask": {
"pool_address": "Gf7sXMoP8iRw4iiXmJ1nq4vxcRycbGXy5RL8a8LnTd3v",
"in_amount": "10",
"max_slippage": 0.5,
"is_x_for_y": true
}
}


Fields

NameTypeDescription
 inAmount

double

Optional. The input token amount for the swap. / - This value should in full units of the input token. / - Default value: 1 (Swap 1 full token).

 isXForY

bool

Optional. Indicates the swap direction: / - true: Swapping token X for token Y. / - false: Swapping token Y for token X. / - Default value: true.

 maxSlippage

double

Optional. The maximum allowed slippage for the swap, expressed as a percentage. / - Example: 0.5 represents 0.5% slippage tolerance. / - Default value: 3 (3% slippage tolerance).

 poolAddress

string

Required. The address of the liquidity pool in the Pump AMM.