swap

Execute a token swap on SundaeSwap. (admin access required, mainnet only)

Swap ADA for CNTs (Cardano Native Tokens) or CNTs for ADA using SundaeSwap DEX. This endpoint is mainnet-only.

post/swap

Request

  • Base URL: ./../api/v1/ (relative, and the document was published on a file host, not at the API’s origin)
  • URL: ./../api/v1/swap
  • Auth: API key in header token

Request body

walletVkeystring required

Wallet verification key (vKey) to identify the wallet

amountnumber required

Amount to swap (in ADA or token units). Capped to prevent overflow/DoS.

poolIdstring required

SundaeSwap pool identifier

slippagenumber

Slippage tolerance (0-1, default: 0.03 for 3%)

Example request

{
  "walletVkey": "wallet_verification_key_here",
  "amount": 1,
  "FromToken": {
    "policyId": "c48cbb3d5e57ed56e276bc45f99ab39abe94e6cd7ac39fb402da47ad",
    "assetName": "5553444d",
    "name": "USDM"
  },
  "ToToken": {
    "policyId": "c48cbb3d5e57ed56e276bc45f99ab39abe94e6cd7ac39fb402da47ad",
    "assetName": "5553444d",
    "name": "USDM"
  },
  "poolId": "64f35d26b237ad58e099041bc14c687ea7fdc58969d7d5b66e2540ef",
  "slippage": 0.03
}

Response

Swap executed successfully

txHashstring required

Transaction hash of the swap

walletAddressstring required

Wallet address used for the swap

Example response

{
  "txHash": "abc123def456...",
  "walletAddress": "addr1..."
}

Changes

No recorded changes to this operation across all 50 revisions of this API.