Developers

API

Public JSON over HTTPS. No authentication, no keys, no rate-limit headers to negotiate — just be reasonable (per-IP limits apply). Base URL https://swap.lumpfun.com.

Every amount is a string in its smallest unit (lovelace for ADA, whole tokens otherwise). They exceed what a JSON number can hold exactly, so parse them with BigInt rather than Number.

GET/api/tokens

Every token LumpSwap can trade, plus the ones it cannot and why. Tradable means the token has graduated off the LumpFun bonding curve into its permanent AMM pool, and that pool authenticated against its 1-of-1 pool NFT.

{
  "tradable": [
    {
      "ticker": "LV356128",
      "name": "…",
      "policyId": "7db6944b…",
      "assetName": "4c56333536313238",   // hex
      "unit": "7db6944b…4c56333536313238",
      "image": "https://…",             // may be null
      "mode": "Amm",
      "adaReserve": "13365943",         // lovelace
      "tokenReserve": "9771237",
      "priceAda": 0.000001368,          // ADA per token
      "fees": {
        "creatorFeeBps": 100,           // 1%, to the token's creator
        "platformFeeBps": 0,
        "platformFeeFlatLovelace": "2000000"   // flat 2 ADA per trade
      }
    }
  ],
  "onCurve":    [ { "ticker": "…", "policyId": "…", "reason": "…" } ],
  "unverified": [ { "ticker": "…", "policyId": "…", "reason": "…" } ],
  "incomplete": false
}

Read incomplete before you trust a count. When it is true, at least one pool read failed and the list is a partial view. A total failure is a 503with a reason — never an empty array, because "no tokens exist" is a claim a failed read cannot support.

POST/api/swap/build

Builds an unsigned swap transaction against the authenticated pool for policyId. The server holds no key for your address and is structurally unable to sign — you get back CBOR you must sign yourself with CIP-30.

Request

{
  "policyId":      "7db6944b…",     // which token
  "changeAddress": "01991d88…",     // your address, hex CBOR or bech32
  "side":          "buy",           // "buy" | "sell"
  "amountIn":      "5000000",       // buy: lovelace INTO the pool
                                    // sell: token quantity
  "minOut":        "1767748"        // slippage floor, enforced ON CHAIN
}

amountIn on a buy is the reserve-side amount, not an all-in budget: the 1% creator fee and the flat 2 ADA platform fee are paid on top of it. minOut travels into the redeemer, so if the price moves between quote and block the validator rejects the trade rather than filling it worse.

Response (200)

{ "cborHex": "84a800838258…" }

Note what this endpoint does not accept: pool addresses, script CBOR, reserves or fee parameters. Those come from verified contract source server-side. A caller chooses which token and how much, and nothing else.

POST/api/swap/submit

Assembles your witness onto the transaction from /build and submits it to the network.

Request

{
  "cborHex":       "84a800838258…",   // exactly what /build returned
  "witness":       "a1008182582…",    // CIP-30 signTx(cbor, true)
  "signerAddress": "01991d88…"        // the signing address
}

Response (200)

{ "txHash": "0ffbc5af294d3a3c…" }

Sign with partialSign = true. The wallet then returns only a witness set rather than a re-serialised transaction, so the bytes you approved are the bytes that get submitted.

GET/api/health

Liveness of the dependencies actually on the trade path. Returns 200 when all three answer, 503 otherwise. It publishes no configuration.

{ "ok": true, "kupo": true, "ogmios": true, "registry": true }

Errors

Failures are JSON with an error field, and the status separates causes that need different responses from you:

StatusMeans
400Malformed request — a missing field or an unparseable amount.
404The registry read fine and that token is not listed here.
409Real token, not tradable now: still on the curve, or the amount is impossible against the current reserves.
429Rate limited. Back off and retry.
503An upstream we depend on is unavailable. The answer is unknown, not empty — retry.

404 and 503 are deliberately distinct: one is a statement about your request, the other an admission that we could not read the chain. Treating them alike is how a dashboard ends up showing a healthy zero.

LumpSwap trades LumpFun tokens that have graduated into their permanent AMM pool. For the launchpad itself — the token registry, bonding-curve state, quotes, holders and trade history — see the LumpFun API.