Skip to content

Swap Tokens

POST
/liquidity/swap

Swap tokens in a pool.

Authorizations

Request Body required

object
poolId
required

UUID of the pool to swap tokens in

string format: uuid
walletId
required

UUID of the wallet performing the swap

string format: uuid
amountIn
required

Amount of input tokens to swap

string
isToken0ToToken1
required

Direction of the swap (true = token0 to token1, false = token1 to token0)

boolean
amountOutMin

Minimum amount of output tokens to receive (slippage protection)

string
slippageBps

Maximum allowed slippage in basis points (e.g., 50 = 0.5%)

integer
>= 1 <= 10000

Responses

200

Swap executed successfully

object
transactionId

UUID of the swap transaction

string format: uuid
poolId

UUID of the pool where the swap occurred

string format: uuid
walletId

UUID of the wallet that performed the swap

string format: uuid
inputToken

Input token (token0 or token1)

string
Allowed values: token0 token1
outputToken

Output token (token0 or token1)

string
Allowed values: token0 token1
inputTokenSymbol

Symbol of the input token

string
outputTokenSymbol

Symbol of the output token

string
inputAmount

Amount of input token swapped

string
outputAmount

Amount of output token received

string
minimumOutputAmount

Minimum amount of output token expected

string
priceImpact

Price impact of the swap as a percentage

string
status

Status of the swap transaction

string
Allowed values: pending completed failed
timestamp

Timestamp of the swap transaction

string format: date-time

400

Bad Request

object
code
integer
400
message
string
Bad Request
details
string
Invalid input parameters