This endpoint performs an atomic exchange of one asset for another through a specified liquidity pool. The swap is executed immediately and settlement is handled by the TEE system.
Two methods to protect against price movement:
Each swap incurs fees that are split between:
Requires a valid JWT bearer token. The token’s public key must match the user_public_key in the request.
user_public_key
- Public key of the swapperpool_id
- LP public key of the poolasset_in_address
- Asset being providedasset_out_address
- Asset being receivedamount_in
- Amount to swapmin_amount_out
- Minimum acceptable outputmax_slippage_bps
- Optional slippage toleranceasset_in_spark_transfer_id
- Transfer proofnonce
- Unique value for replay protectionsignature
- Request signature200 OK
with swap details if successful400 Bad Request
if validation fails or insufficient liquidity401 Unauthorized
if authentication fails500 Internal Server Error
if swap execution failsBearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Swap execution details including assets, amounts, and authentication
Request body for executing a swap on an AMM pool.
Swaps allow users to exchange one asset for another through a liquidity pool. The swap is executed atomically and the result is returned immediately.
Swap executed successfully
Clean response for a successfully executed swap operation