← docs

LumpFun Midnight API

Public HTTP endpoints of the LumpFun launchpad on Midnight mainnet. JSON, no authentication, no API keys. Base URL: https://midnight.lumpfun.com. These routes send no CORS headers, so call them from a server rather than a browser on another origin. The Cardano launchpad has its own reference at /docs/api.

Amounts are integers in atomic units, sent as decimal strings. Parse them with BigInt, never Number. Launch tokens have 6 decimals. A pool is quoted in USDM (6 decimals) or in bridged SOL (9 decimals); each launch record names its quote asset.

A pool is identified by its contract address: 64 hex characters. A token type is called a colour and is also 64 hex characters. In paths and query strings a pool address may be upper case or carry a 0x prefix.

POST bodies are JSON unless a section says otherwise. A POST that carries an Origin header naming another site is refused with 403 {"error":"forbidden"}. A server-side client that sends no Origin header is accepted.

Status, checked 2026-11-18

Midnight mainnet moved to ledger 9 on 2026-11-06. Since then the launchpad's trading backend has been offline. This is what the live API answered on 2026-11-18:

  • Registry reads answer. GET /api/launches, GET /api/board and GET /api/coin/{address} return 200 with the launch records. Their live on-chain data is missing: state is null and the market fields are absent.
  • Chain reads fail. GET /api/history/{address} and GET /api/pool return 502.
  • The readiness routes answer and report the backend down. GET /api/launcher returns {"ready":false,"starting":false,"offline":true,"sponsor":{"ready":false}}. GET /api/sponsor returns {"ready":false,"offline":true}.
  • Everything else needs the trading backend. Orders, fills, payouts, fast-lane jobs, launch jobs, sponsor tickets and zswap state return 502, today with an empty body. The Solana and Cardano routes checked (quote and px) return 502 with {"error":"SOL service offline."} or {"error":"ADA service offline."}.
  • The POST endpoints were not called for this check. Trades, launches, claims, deposits and cash-outs all go through the backend and services above.

Sections for endpoints that do not answer today are written from the source code, not from live responses.

GET

/api/launches

The launch registry: every launch in the cohorts the site lists, with status pending or live. Takes no parameters. The list is cached for 5 seconds. It stays readable while the trading backend is offline.

Response (200) — array of:

{
  "address":       "b3f7e89f...f094c1",        // pool contract address, 64 hex
  "tokenColor":    "a4f3531a...4f85c7",        // colour of the launch token
  "name":          "Jub Jub Bird",             // up to 32 characters
  "ticker":        "JUBJUB",                   // up to 10 characters, upper case
  "description":   "Beware the Jubjub bird.",  // up to 500 characters
  "image":         { "url": "https://.../img/<sha256>.webp", "sha256": "812e19d0..." },  // or null
  "socials":       { "x": "https://...", "telegram": "https://...", "website": "https://..." },  // each optional
  "creator":       "mn_addr1...",              // creator's unshielded address, receives creator fees
  "creatorHex":    "11e89ed4...",              // the same address as 32-byte hex
  "creatorCoinPk": "1d5de036...",              // creator's shielded coin public key (optional)
  "metadataUrl":   "https://.../meta/<hash>.json",
  "metadataHash":  "5988401d...",
  "createdAt":     "2026-10-10T18:16:23.042Z",
  "deployTx":      "003c1837...",
  "initTx":        "0003311f...",              // absent until the pool is initialized
  "status":        "live",                     // "pending" | "live"
  "devBuyUsdm":    null,                       // creator's opening buy in quote units, or null
  "cohort":        "usdm-v4",                  // "usdm-v4" = USDM pool, "sol-v4" = SOL pool
  "quote":         { "name": "USDM", "color": "8c2c22bc...", "decimals": 6 },
  "params": {
    "supply":         "1000000000000000",      // token atoms
    "virtualQuote":   "2400000000",            // quote atoms
    "bondTarget":     "6800000000",            // quote atoms
    "creatorFeeBps":  100,
    "platformFeeBps": 50,
    "poolFeeBps":     50
  },
  "milestone": { "mcapUsd": 50000, "reachedAt": "<ISO time>", "mcapAtReach": <number> }
                                               // optional, set once the coin reached the milestone market cap
}

quote can also carry a bridged boolean. The name devBuyUsdm is historical: on a SOL pool the value is in SOL.

Returns 502 with {"error":"registry unavailable"} when no copy of the registry can be read.

curl

curl https://midnight.lumpfun.com/api/launches

ts

const launches = await fetch('https://midnight.lumpfun.com/api/launches').then(r => r.json());
for (const l of launches) {
  console.log(l.ticker, l.address, l.status, l.quote.name);
}
GET

/api/board

Live launches with their on-chain state and 24-hour market figures. Takes no parameters. Only records with status live are listed. A pool that fails verification is left out. A pool whose state could not be read keeps its row with state: null.

Response (200):

{
  "items": [
    {
      "record": { ...launch record, as in /api/launches },
      "state": {                          // null when the state could not be read
        "verified":       true,
        "verification":   { "keys": "lumpfun_orders_v4", "renounced": true, "quoteOk": true,
                            "platformOk": true, "feesOk": true, "ok": true },
        "price":          0.0000024,      // quote units per token, display units
        "mcap":           2400,           // market cap in USD
        "mcapQuote":      2400,           // market cap in quote units
        "quote":          { "name": "USDM", "color": "8c2c22bc...", "decimals": 6, "usd": 1 },
        "quoteReserve":   "0",            // real quote held by the pool, atoms
        "bondProgress":   0,              // 0..1, quoteReserve / bondTarget
        "bonded":         false,
        "milestone":      { "mcapUsd": 50000, "mcap": 2400, "progress": 0.048, "reached": false },
        "tokenColor":     "a4f3531a...",
        "creatorAccrued": "0"             // unclaimed creator fees, quote atoms
      },
      "priceUsd":    0.0000024,           // price of one token in USD
      "change24h":   0,                   // percent against 24 h ago
      "vol24h":      0,                   // 24 h volume in USD
      "trades24h":   0,
      "lastTradeAt": 1795040545537,       // ms since the epoch
      "holders":     0                    // approximate holder count
    }
  ]
}

The numbers above are those of a USDM pool with no trades. The six market fields are optional: each appears only when its source answered. For a coin younger than 24 hours change24h compares with the launch price. quote.usd is the USD value of one quote unit: 1 for USDM, the SOL price for a SOL pool, or null while no price is available. In that case mcap is 0.

State is cached for up to 10 seconds per pool. See /api/coin for the meaning of verified and verification.

Returns 502 with {"items":[],"error":"board unavailable"} when the board cannot be built.

curl

curl https://midnight.lumpfun.com/api/board

ts

const { items } = await fetch('https://midnight.lumpfun.com/api/board').then(r => r.json());
for (const it of items) {
  // state is null when the chain could not be read: unknown, not zero
  console.log(it.record.ticker, it.state ? it.state.price : 'state unavailable');
}
GET

/api/coin/{address}

One launch: its registry record, its full live state, its market figures and the server clock.

Parameters:

namedescription
addresspath. Pool contract address, 64 hex.required
freshquery. "1" skips the 4-second state cache. Honoured 20 times a minute per visitor; beyond that the cached state is returned.optional

Response (200):

{
  "record": { ...launch record, as in /api/launches },
  "state": {                              // null when the state could not be read
    "address":           "b3f7e89f...",
    "verified":          true,
    "verification":      { "keys": "lumpfun_orders_v4", "renounced": true, "quoteOk": true,
                           "platformOk": true, "feesOk": true, "ok": true },
    "platformRecipient": "<64 hex>",
    "initialized":       true,
    "bonded":            false,
    "totalSupply":       "1000000000000000",   // token atoms
    "virtualQuote":      "2400000000",         // quote atoms
    "quoteReserve":      "0",                  // quote atoms really in the pool
    "tokenReserve":      "1000000000000000",   // token atoms still in the pool
    "bondTarget":        "6800000000",
    "creatorAccrued":    "0",                  // unclaimed creator fees, quote atoms
    "platformAccrued":   "0",
    "creatorFeeBps":     100,
    "platformFeeBps":    50,
    "poolFeeBps":        50,
    "quoteColor":        "8c2c22bc...",
    "tokenColor":        "a4f3531a...",
    "creatorRecipient":  "11e89ed4...",        // address the creator fees are paid to, hex
    "creatorCoinPk":     "1d5de036...",
    "price":             0.0000024,            // quote units per token, display units
    "mcap":              2400,                 // USD
    "mcapQuote":         2400,                 // quote units
    "quote":             { "name": "USDM", "color": "8c2c22bc...", "decimals": 6, "usd": 1 },
    "bondProgress":      0,
    "milestone":         { "mcapUsd": 50000, "mcap": 2400, "progress": 0.048, "reached": false },
    "readAt":            <block height>,       // 0 when unknown
    "orderBook":         true                  // present on order-book pools
  },
  "market": { "priceUsd": 0.0000024, "change24h": 0, "vol24h": 0, "trades24h": 0,
              "lastTradeAt": 1795040545537, "holders": 0 },   // every field optional
  "serverTime": 1795040545537             // server clock, ms since the epoch
}

Verification:

  • verification.keys — name of the compiled contract whose circuits the pool runs byte for byte, or null.
  • verification.renounced — the contract's maintenance authority is renounced, so its circuits can never be replaced.
  • verification.quoteOk — the quote asset is USDM or the launchpad's bridged SOL.
  • verification.platformOk and feesOk — the platform fee recipient and the fee split are the launchpad's.
  • verification.ok — all of the above.
  • verified — ok is true and keys is the contract of the record's cohort. false means the pool failed a check: the site keeps its trade panel closed.

Quoting from the state:

There is no quote endpoint. The contract uses constant-product math on x = virtualQuote + quoteReserve and y = tokenReserve. Each of the three fees is floor(amount * bps / 10000).

// buy with quoteIn quote atoms (fees included)
fees      = creatorFee + platformFee + poolFee     // each taken on quoteIn
net       = quoteIn - fees
tokensOut = floor(y * net / (x + net))

// sell tokensIn token atoms
quoteOut  = floor(x * tokensIn / (y + tokensIn))   // gross
received  = quoteOut - fees                        // each fee taken on quoteOut

A sell whose quoteOut is larger than quoteReserveis rejected. Orders are filled in batches. On a v4 pool one batch clears at one price: the batch total is the single-trade output for the summed input, shared pro rata. An order's minOut is its floor.

Use serverTime, not your own clock, to compute an order's expiresAt.

Limit: 240 requests a minute per visitor. Errors: 400 {"error":"bad address"}, 404 {"error":"not found"} for an address that is not a registered launch, 429, 502 {"error":"unavailable"}.

curl

curl https://midnight.lumpfun.com/api/coin/b3f7e89f61e1c5466da65522168697deaf5d0328c096af4d6c55a35625f094c1

ts

const coin = await fetch('https://midnight.lumpfun.com/api/coin/b3f7e89f61e1c5466da65522168697deaf5d0328c096af4d6c55a35625f094c1').then(r => r.json());
if (coin.state && coin.state.verified !== false) {
  const x = BigInt(coin.state.virtualQuote) + BigInt(coin.state.quoteReserve);
  const y = BigInt(coin.state.tokenReserve);
  console.log('reserves', x, y, 'server time', coin.serverTime);
}
GET

/api/history/{address}

Price points and trades of one launch, rebuilt by replaying the on-chain actions of its contract. Registered launches only. Cached for 20 seconds per pool.

Parameters:

namedescription
addresspath. Pool contract address, 64 hex.required

Response (200):

{
  "ok": true,
  "points": [                        // oldest first, one per pool state change
    { "t": 1791051383042, "price": 0.0000024 }
  ],
  "trades": [                        // newest first, at most 200
    {
      "t":       1791051383042,      // ms since the epoch
      "txHash":  "<tx hash>",
      "side":    "buy",              // "buy" | "sell"
      "tokens":  "2000000000000",    // tokens received (buy) or sold (sell), atoms
      "usdm":    "5000000",          // quote paid, fees included (buy), or received after fees (sell), atoms
      "address": "mn_addr1..."       // trader's unshielded address, when it could be attributed
    }
  ],
  "holders": 1,                      // addresses with a positive net balance from the attributed trades
  "vol24h":  "5000000",              // quote atoms traded in the last 24 h
  "quote":   { "name": "USDM", "color": "8c2c22bc...", "decimals": 6 }   // absent = USDM
}

price is quote atoms per token atom: (virtualQuote + quoteReserve) / tokenReserve. For a USDM pool that equals USDM per token. The field name usdm is historical: on a SOL pool it holds SOL atoms. A 200 with ok: false and empty lists means no state of the contract could be decoded.

Limit: 30 requests a minute per visitor. Errors: 400 {"error":"bad address"}, 404 {"error":"not found"}, 429, and 502 with the body {"ok":false,"points":[],"trades":[],"holders":0,"vol24h":"0"} when the chain could not be read. That body means unknown, not empty.

curl

curl https://midnight.lumpfun.com/api/history/b3f7e89f61e1c5466da65522168697deaf5d0328c096af4d6c55a35625f094c1
GET

/api/pool

State of a LumpDex pool: a two-sided pool of USDM (asset A) and pNIGHT (asset B). Both assets are unshielded.

Query params:

namedescription
addressPool contract address. Default: the first configured pool.optional
fresh"1" skips the 4-second cache. Honoured 20 times a minute per visitor.optional

Response (200):

{
  "pool": {                          // null when the contract has no state
    "address":      "<64 hex>",
    "verified":     true,            // all four checks below passed
    "verification": { "keys": true, "renounced": true, "colorsOk": true, "feesOk": true },
    "paused":       false,
    "reserveA":     "<atoms>",       // USDM
    "reserveB":     "<atoms>",       // pNIGHT
    "feeBps":       150,
    "flatFeeA":     "500000",        // minimum fee when A is the input
    "flatFeeB":     "11000000",      // minimum fee when B is the input
    "minInA":       "2000000",       // smallest input of A
    "minInB":       "50000000",      // smallest input of B
    "swaps":        "<count>",
    "feesA":        "<atoms>",       // fees collected, per asset
    "feesB":        "<atoms>",
    "colorA":       "<64 hex>",
    "colorB":       "<64 hex>",
    "ownerRecipient": "<64 hex>",
    "priceBinA":    <number>,        // A atoms per B atom: USDM per pNIGHT
    "readAt":       <block height>
  },
  "pools":      [ "<64 hex>" ],      // every configured pool address
  "serverTime": 1795040545537
}

The fee and minimum values shown are the configured ones; read the live values from the response. A swap charges fee = max(flatFee, floor(input * feeBps / 10000)) on the input asset, then pays out = floor(reserveOut * (input - fee) / (reserveIn + input - fee)). The whole input, fee included, stays in the pool. Swaps are submitted through POST /api/sponsor with kind swap.

Limit: 240 requests a minute per visitor. Errors: 404 {"error":"not a LumpDex pool"}, 429, 502 {"error":"unavailable"}.

curl

curl https://midnight.lumpfun.com/api/pool
GET

/api/launcher

Readiness of the trading backend: the service that deploys launches, sequences orders and pays fees. Takes no parameters. Always answers 200.

Response (200):

{
  "ready":    true,                  // the backend is up and holds DUST to pay fees
  "starting": false,                 // the backend answered but is not ready yet
  "sponsor":  { "ready": true }      // the fee sponsor is ready
}

// when the backend cannot be reached:
{ "ready": false, "starting": false, "offline": true, "sponsor": { "ready": false } }

Check this before starting a launch or a trade.

curl

curl https://midnight.lumpfun.com/api/launcher

ts

const s = await fetch('https://midnight.lumpfun.com/api/launcher').then(r => r.json());
if (!s.ready) throw new Error(s.offline ? 'trading backend offline' : 'trading backend not ready');
GET

/api/orders/{pool}

Open orders of a pool as the sequencer sees them. Pools are order books: a trader places an order that holds the quote (buy) or a token coin (sell) in the contract, and the sequencer fills open orders in batches. Needs the trading backend.

Parameters:

namedescription
poolpath. Pool contract address, 64 hex.required

Response (200):

{
  "pool":   "b3f7e89f...",
  "height": <block height>,          // block the pool state was read at
  "busy":   false,                   // a batch is in flight on this pool
  "error":  null,                    // last read error, if any
  "orders": [
    {
      "id":        "<64 hex>",
      "side":      "buy",            // "buy" | "sell"
      "amount":    "5000000",        // buy: quote atoms. sell: token atoms.
      "minOut":    "2000000000000",  // the order's floor
      "to":        "<64 hex>",       // where the fill is paid
      "expiresAt": 1795041200,       // unix seconds
      "seenAt":    "<ISO time>",
      "status":    "open",
      "strikes":   0                 // failed fill attempts
    }
  ]
}

// when the sequencer holds no state for the pool yet:
{ "pool": "b3f7e89f...", "watched": true, "error": null, "orders": [] }

Order status:

  • open — waiting for the next batch.
  • batching — a batch is in flight on the pool.
  • below-floor — a fill at the current price would miss minOut. The order stays open until it expires.
  • settling — a sell whose held coin is not in the zswap tree yet.
  • expiring — too close to expiresAt to be filled.
  • stuck — its fill failed three times.
  • no-enc-key — a buy for which the sequencer has no encryption key.
  • filled — already filled.

Past expiresAtan unfilled order can be cancelled by anyone. The refund only goes to the order's owner.

Errors: 400 {"error":"bad pool"}, 429 {"error":"rate limited"}, 502 {"error":"sequencer offline"} or a 502 with an empty body.

curl

curl https://midnight.lumpfun.com/api/orders/b3f7e89f61e1c5466da65522168697deaf5d0328c096af4d6c55a35625f094c1
GET

/api/fills/{pool}

Fills the sequencer has published for a pool. Use it to learn whether a placed order was filled. Needs the trading backend.

Parameters:

namedescription
poolpath. Pool contract address, 64 hex.required
idquery. Order id, 64 lower-case hex. Returns only the fill of that order. Any other value is ignored.optional

Response (200):

{
  "pool": "b3f7e89f...",
  "fills": [                         // without id: the last 100 fills of the pool
    {
      "at":          "<ISO time>",
      "pool":        "b3f7e89f...",
      "side":        "buy",          // "buy" | "sell"
      "id":          "<64 hex>",     // order id
      "amount":      "5000000",      // buy: quote atoms paid. sell: token atoms sold.
      "out":         "2000000000000", // buy: token atoms received. sell: quote atoms received.
      "to":          "<64 hex>",
      "txId":        "<tx id>",
      "blockHeight": "<height>",     // string, or null
      "lateLanding": false,
      "circuit":     "<name>",       // contract call that filled it; "fast" for a fast-lane trade
      "batch":       1,              // orders filled in the same batch
      "seenAt":      "<ISO time>",
      "placedBlockTime": "<ISO time>",   // or null
      "fillMs":      15000,          // timings in ms
      "waitMs":      0,
      "proveMs":     <number>,
      "payMs":       <number>
    }
  ]
}

An order that is not filled yet gives "fills": []. Errors are those of /api/orders.

curl (one order)

curl "https://midnight.lumpfun.com/api/fills/b3f7e89f61e1c5466da65522168697deaf5d0328c096af4d6c55a35625f094c1?id=ORDER_ID"
POST

/api/fast

Fast-lane buy on a v4 pool. Your wallet signs one bare unshielded intent that offers exactly the order amount of the quote asset. It proves nothing and pays no DUST. The sequencer merges the intent with a transaction of its own that places the order and fills it in the same block. The amount the intent offers is the order size: nothing else can be taken from the wallet. Needs the trading backend.

Body:

namedescription
intenthex string. The transaction your wallet returned for the intent. See the rules below.required
poolstring. Pool contract address, 64 hex. Must be a live v4 pool.required
amountbigint string. Quote atoms to spend. At least the pool minimum order (0.01 USDM or 0.0001 SOL as configured).required
minOutbigint string. Smallest token amount you accept, atoms. Default "1".optional
tohex, 32 bytes. Your shielded coin public key: the tokens are paid to it.required
toEnchex, 32 bytes. Your shielded encryption public key.required
expiresAtinteger. Order expiry, unix seconds. At least 90 seconds and at most 86400 seconds ahead.required

The intent must:

  • hold exactly one intent with only a guaranteed unshielded offer: no contract call, no DUST, no shielded coins;
  • spend at most 8 inputs, all owned by one key and all of the pool's quote colour;
  • have at most one change output, in the quote colour, back to the signer;
  • offer inputs minus change equal to amount;
  • carry one valid signature per input;
  • have a ttl at least 2 minutes ahead.

The whole JSON body may be at most 64,000 characters. Posting the same intent again returns the same job.

Response (202):

{
  "id":      "<job id>",             // poll GET /api/fast/{id}
  "orderId": "<64 hex>",             // derived from the intent; use it with /api/fills
  "state":   "queued",
  ...the other job fields, see GET /api/fast/{id}
}

Flow:

// wallet: a Midnight DApp Connector API that implements makeIntent()
const coin   = await fetch('https://midnight.lumpfun.com/api/coin/' + pool).then(r => r.json());
const amount = 5_000_000n;                                  // 5 USDM
const res = await wallet.makeIntent(
  [{ kind: 'unshielded', type: coin.record.quote.color, value: amount }],
  [],
  { intentId: 'random', payFees: false },
);
const intent = (typeof res === 'string' ? res : res.tx).replace(/^0x/, '');

const r = await fetch('https://midnight.lumpfun.com/api/fast', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({
    intent, pool,
    amount: amount.toString(),
    minOut: minOut.toString(),                              // your floor, token atoms
    to, toEnc,                                              // 32-byte hex keys of the wallet
    expiresAt: Math.floor(coin.serverTime / 1000) + 600,    // the site uses 10 minutes
  }),
});
const job = await r.json();                                 // 202 { id, orderId, state }
// then poll GET /api/fast/{job.id} until state is filled, placed, failed or expired

The site sets minOut 3% below the amount it quoted. If the pool has moved past your floor the request is refused with 409 instead of queued: quote again.

Errors:

  • 400 — a field is missing or malformed, the amount is below the minimum order, expiresAt is out of range, or the intent breaks a rule (the message starts with intent:).
  • 404 — not a LumpFun pool.
  • 409 — the pool is not live or not a v4 pool, the pool moved past your floor, an input of the intent is already queued, or an input is not an unspent coin of the signer.
  • 413 — body too large.
  • 429 — too many trades, slow down or busy, try again in a minute.
  • 503 — the fee payer or the sequencer is not ready.
  • 502 Launcher offline. and 504 Launcher did not answer within 45 s.

curl

curl -X POST https://midnight.lumpfun.com/api/fast \
  -H "content-type: application/json" \
  -d '{"intent":"INTENT_HEX","pool":"b3f7e89f61e1c5466da65522168697deaf5d0328c096af4d6c55a35625f094c1","amount":"5000000","minOut":"1","to":"COIN_PK_HEX","toEnc":"ENC_PK_HEX","expiresAt":1795041200}'
POST

/api/fast/sell

Fast-lane sell on a v4 pool. Your wallet signs and proves one shielded spend of the pool's token: its coin in, change back, nothing else. The sequencer receives the coin, places the order and fills it in one block. The quote is paid to your unshielded address. It is all or nothing on chain: if the fill cannot happen the transaction is refused and the coin never leaves the wallet. Needs the trading backend.

Body:

namedescription
intenthex string. The proven transaction your wallet returned for the shielded spend.required
poolstring. Pool contract address, 64 hex. Must be a live v4 pool.required
amountbigint string. Token atoms to sell. Must be positive.required
minOutbigint string. Smallest quote amount you accept after fees, atoms. Default "1".optional
tohex, 32 bytes. Your unshielded address: the quote is paid to it.required
refundhex, 32 bytes. Your shielded coin public key.required
refundEnchex, 32 bytes. Your shielded encryption public key.required
expiresAtinteger. Order expiry, unix seconds. At least 90 seconds and at most 86400 seconds ahead.required

The intent must:

  • come already proved by the wallet;
  • hold only a guaranteed shielded offer: no contract call, no DUST, no unshielded part, no fallible offer, no transients;
  • spend at most 4 coins and have at most one change output;
  • move exactly amount of the pool's token colour, net of change, and nothing else;
  • have a ttl at least 2 minutes ahead, when it has one.

Response (202):

{ "id": "<job id>", "orderId": "<64 hex>", "state": "queued", ... }   // same job shape as POST /api/fast

Flow:

const res = await wallet.makeIntent(
  [{ kind: 'shielded', type: coin.record.tokenColor, value: tokensIn }],
  [],
  { intentId: 'random', payFees: false },
);
const intent = (typeof res === 'string' ? res : res.tx).replace(/^0x/, '');

await fetch('https://midnight.lumpfun.com/api/fast/sell', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({ intent, pool, amount: tokensIn.toString(), minOut: minOut.toString(),
                         to, refund, refundEnc, expiresAt }),
});

Errors are those of POST /api/fast, plus 503 pool not sequenced yet. A timeout is reported after 20 seconds.

curl

curl -X POST https://midnight.lumpfun.com/api/fast/sell \
  -H "content-type: application/json" \
  -d '{"intent":"INTENT_HEX","pool":"b3f7e89f61e1c5466da65522168697deaf5d0328c096af4d6c55a35625f094c1","amount":"1000000000","minOut":"1","to":"UNSHIELDED_ADDRESS_HEX","refund":"COIN_PK_HEX","refundEnc":"ENC_PK_HEX","expiresAt":1795041200}'
GET

/api/fast/{id}

Status of a fast-lane job. Needs the trading backend.

Parameters:

namedescription
idpath. Job id from POST /api/fast or POST /api/fast/sell: 8 to 32 letters, digits, "_" or "-".required

Response (200):

{
  "id":          "<job id>",
  "pool":        "<64 hex>",
  "state":       "filled",
  "orderId":     "<64 hex>",
  "amount":      "5000000",          // what the intent offers, atoms
  "out":         "2000000000000",    // what the fill pays, atoms; null until the trade landed
  "txId":        "<tx id>",          // null until the trade landed
  "blockHeight": "<height>",         // string, or null
  "error":       null,
  "createdAt":   "<ISO time>",
  "buildMs":     <number>,           // timings in ms, null until known
  "proveMs":     <number>,
  "payMs":       <number>,
  "postToBlockMs": <number>
}

States:

  • queued → building → submitting → landed — in progress. landed means the transaction is in a block.
  • filled — final. The order was placed and filled; out is what it paid.
  • placed — the order is in the book but was not filled in that block. A later batch fills it: follow it with GET /api/fills/{pool}?id={orderId}.
  • failed — final. Read error.
  • expired — final. The intent or the order expiry came too close before the job was built.

Errors: 400 {"error":"bad id"}, 404 {"error":"no such fast job"}, 429, 502 {"error":"sequencer offline"} or a 502 with an empty body. On a 404 the site falls back to /api/fills with the order id.

curl

curl https://midnight.lumpfun.com/api/fast/JOB_ID
POST

/api/submit

Submits a transaction that already pays its own fee. The site uses it as a fallback when a wallet's own submit fails. The transaction must arrive proven, balanced with its DUST fee, and signed by the wallet. The server only relays it to the node: no keys, no custody, no fee sponsorship.

Body:

namedescription
txHexhex string, even length, 200 to 400,000 characters. A leading 0x is accepted.required

The transaction must be signed, proven and bound, and hold exactly one contract call, on a pool the registry knows.

Response (200):

{ "ok": true, "extrinsicHash": "0x..." }   // returned once the transaction is in a block

Limit: 5 requests a minute per visitor.

Errors:

  • 400 — invalid JSON body, txHex must be an even-length hex transaction, not a signed, proven, bound transaction, unreadable transaction or one contract call expected.
  • 403 — not a LumpFun pool.
  • 429 — too many submissions, slow down.
  • 503 — submit unavailable.
  • 502 — the node refused the transaction or did not confirm it within 40 seconds. The message says which.

curl

curl -X POST https://midnight.lumpfun.com/api/submit \
  -H "content-type: application/json" \
  -d '{"txHex":"TX_HEX"}'
GET

/api/zswap/{address}

The current zswap chain state, filtered to one pool contract. A client that builds a contract call needs it: an indexer only serves the state as of the contract's last action, and the node rejects a call whose tree root is older than about an hour. Registered launches only. Needs the trading backend.

Parameters:

namedescription
addresspath. Pool contract address, 64 hex.required

Response (200):

{
  "address":    "<64 hex>",
  "firstFree":  "<index>",           // first free index of the commitment tree
  "root":       "<hex>",             // Merkle root of the tree
  "height":     <block height>,
  "source":     "head",              // "head" | "base"
  "serialized": "<hex>",             // the serialized ZswapChainState
  "asOf":       "<ISO time>"
}

Limit: 30 requests a minute per visitor. Errors: 400 {"error":"bad address"}, 404 {"error":"not found"}, 429, 503 {"error":"zswap state loading"}, 502.

curl

curl https://midnight.lumpfun.com/api/zswap/b3f7e89f61e1c5466da65522168697deaf5d0328c096af4d6c55a35625f094c1
POST

/api/upload

Uploads a coin image. A launch can only use an image uploaded here. The body is the raw image bytes, not JSON and not a form. JPEG, PNG and WebP are accepted, up to 4 MB. The type is read from the bytes; the content-type header is not trusted. The same bytes always give the same URL.

Response (200):

{
  "url":       "https://.../img/<sha256>.png",
  "sha256":    "<64 hex>",           // SHA-256 of the bytes
  "mediaType": "image/png"           // "image/jpeg" | "image/png" | "image/webp"
}

Limit: 6 uploads an hour and 20 a day per visitor.

Errors:

  • 400 — unreadable body or empty body.
  • 413 — image larger than 4 MB.
  • 415 — jpeg, png or webp only.
  • 429 — too many uploads, slow down.
  • 503 — uploads are not configured.
  • 502 — upload failed.

curl

curl -X POST https://midnight.lumpfun.com/api/upload \
  -H "content-type: image/png" \
  --data-binary @coin.png
POST

/api/launch

Starts a launch job. The backend publishes the metadata, deploys the pool contract, renounces its maintenance authority and, when there is no opening buy, initializes it. The backend pays the fees. Needs the trading backend.

In the current source code new launches are switched off. The route answers 503 with {"error":"New launches are paused for a moment while exciting new features land. Trading stays open."} before anything else happens.

Body:

namedescription
namestring, up to 32 characters. No control or invisible characters.required
tickerstring, 2 to 10 letters or digits. Stored upper case.required
descriptionstring, up to 500 characters.optional
socialsobject with optional x, telegram, website. Each an https URL of up to 200 characters.optional
imageobject { url, sha256 } from POST /api/upload, or null.optional
creatorstring. The creator: a mainnet unshielded address (mn_addr1...). Creator fees are paid to it.required
creatorCoinPkhex, 32 bytes. The creator shielded coin public key.required
creatorEncPkstring. The creator shielded encryption public key.optional
devBuydecimal string in quote units, for example "25" or "0.5". The creator opening buy. Empty for none. Within the pool minimum trade and maximum opening buy.optional
quote"USDM" (default) or "SOL". Chooses the quote asset of the pool.optional

Response (202):

{ "jobId": "<job id>", "phase": "queued" }

The jobId is what lets its holder skip the opening buy with finalize. Keep it private.

Flow:

// 1. optional image
const img = await fetch('https://midnight.lumpfun.com/api/upload', { method: 'POST', body: imageBytes }).then(r => r.json());

// 2. start the job
const res = await fetch('https://midnight.lumpfun.com/api/launch', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({
    name: 'My Coin', ticker: 'MYCOIN', description: '', socials: {},
    image: { url: img.url, sha256: img.sha256 },
    creator, creatorCoinPk, creatorEncPk,
    devBuy: '',                      // or an amount: see the two endpoints below
    quote: 'USDM',
  }),
});
const { jobId } = await res.json();  // 202

// 3. poll every few seconds
let job;
do {
  await new Promise(r => setTimeout(r, 2500));
  job = await fetch('https://midnight.lumpfun.com/api/launch/' + jobId).then(r => r.json());
} while (!['live', 'failed', 'awaiting-dev-buy'].includes(job.phase));

Errors:

  • 400 — a field fails validation. The message names it, for example ticker must be 2–10 letters or digits or image must be an uploaded LumpFun image.
  • 429 — too many launches this hour, try later, daily launch limit for this wallet or daily launch limit for this connection. The configured limits are 6 launches an hour in total, 5 a day per creator address and 3 a day per connection.
  • 503 — launches are paused, the backend is starting up, it has no DUST for the deploy, or the chosen quote asset is not open.
  • 502 Launcher offline. and 504 Launcher did not answer within 20 s.

curl

curl -X POST https://midnight.lumpfun.com/api/launch \
  -H "content-type: application/json" \
  -d '{"name":"My Coin","ticker":"MYCOIN","description":"","socials":{},"image":null,"creator":"mn_addr1...","creatorCoinPk":"COIN_PK_HEX","devBuy":"","quote":"USDM"}'
GET

/api/launch/{jobId}

Status of a launch job. Needs the trading backend.

Parameters:

namedescription
jobIdpath. The id from POST /api/launch. The pool address also works; the answer then omits jobId.required

Response (200):

{
  "jobId":         "<job id>",
  "phase":         "awaiting-dev-buy",
  "address":       "<64 hex>",       // pool contract address, once deployed
  "tokenColor":    "<64 hex>",
  "params":        { "supply": "...", "virtualQuote": "...", "bondTarget": "...",
                     "creatorFeeBps": 100, "platformFeeBps": 50, "poolFeeBps": 50 },
  "creatorCoinPk": "<64 hex>",
  "devBuyUsdm":    "25",             // opening buy in quote units, or null
  "error":         "<message>",      // set when the phase is failed
  "createdAt":     "<ISO time>",
  "updatedAt":     "<ISO time>",
  "txs":           { "deployed": "<tx id>", "renounced": "<tx id>" },   // tx ids by phase
  "record":        { ...launch record }   // or null before the contract exists
}

Phases:

  • queued → metadata → deploying → deployed → renouncing → renounced — in progress.
  • initializing → live — a launch with no opening buy: the backend initializes the pool.
  • awaiting-dev-buy — a launch with an opening buy: the pool is deployed and waits for the creator. See the next two endpoints.
  • live — done. The coin is on the board.
  • failed — read error.

Errors: 400 {"error":"bad job id"}, 404 {"error":"not found"}, 502, 504.

curl

curl https://midnight.lumpfun.com/api/launch/JOB_ID
POST

/api/launch/{jobId}/initialized

Tells the backend that the creator's wallet made the opening buy. In phase awaiting-dev-buythe creator's wallet calls the pool's init with the opening buy; the site sends that call through POST /api/sponsor with kind init. Then call this endpoint: the backend re-reads the chain and marks the launch live once the pool is initialized. No body is needed.

Response (200):

{ "jobId": "<job id>", "phase": "live", ... }   // the job, as in GET /api/launch/{jobId} without record

The phase stays awaiting-dev-buy while the chain does not show the pool as initialized. Errors: 400 {"error":"bad job id"}, 404 {"error":"not found"}, 409 {"error":"launch has no contract yet"}, 502, 504.

curl

curl -X POST https://midnight.lumpfun.com/api/launch/JOB_ID/initialized
POST

/api/launch/{jobId}/finalize

Skips the opening buy. The backend initializes the pool itself, with no opening buy, and the launch goes live. Use it when the creator gave up on the opening buy or it failed. No body is needed. A pending launch that nobody initializes is also initialized by the backend, without an opening buy, after a while.

Response (200):

{ "jobId": "<job id>", "phase": "live", ... }

Errors are those of initialized, plus 503 while the backend is starting up.

curl

curl -X POST https://midnight.lumpfun.com/api/launch/JOB_ID/finalize
GET

/api/payouts/{address}

Fees the backend has paid out of a pool so far. Unclaimed creator fees are in state.creatorAccrued of /api/coin. Needs the trading backend.

Parameters:

namedescription
addresspath. Pool contract address, 64 hex.required

Response (200):

{
  "creatorPaid":       "12.5",       // total paid to the creator, display units of the quote
  "platformPaid":      "6.25",
  "last":              "<ISO time>", // time of the last payout, or null
  "quote":             "USDM",       // name of the quote asset of the pool
  "decimals":          6,
  "creatorPaidAtoms":  "12500000",   // the same totals in atoms
  "platformPaidAtoms": "6250000"
}

A pool with no payouts returns zeros and last: null. Errors: 400 {"error":"bad address"}, 429, 502 {"error":"launcher offline"} or a 502 with an empty body.

curl

curl https://midnight.lumpfun.com/api/payouts/b3f7e89f61e1c5466da65522168697deaf5d0328c096af4d6c55a35625f094c1
POST

/api/claim/{address}

Pays out the creator fees a pool has accrued. The backend makes the withdrawal call and pays its fee. The contract pays only the creator address sealed at launch, in the pool's quote asset, so no wallet and no signature are needed and anyone may trigger it. No body is needed. Needs the trading backend.

Parameters:

namedescription
addresspath. Pool contract address, 64 hex.required

Response (202):

{
  "address":  "<64 hex>",
  "which":    "creator",
  "amount":   "12.5",                // what is being paid, display units
  "atoms":    "12500000",
  "quote":    "USDM",
  "decimals": 6,
  "to":       "<64 hex>",            // the sealed creator address
  "state":    "paying"
}

The answer comes at once; the payment lands in the background. Poll GET /api/payouts/{address} until creatorPaidAtoms has grown by atoms. The site polls every 4 seconds.

Errors:

  • 400 — bad address.
  • 404 — not a LumpFun pool.
  • 409 — nothing accrued, payout already in progress or orders are settling on this pool, try again in a minute.
  • 429 — claimed recently, try again in a few minutes (one claim per pool every 10 minutes) or payouts busy, try again later (30 claims an hour across all pools).
  • 503 — the backend is starting up, or payouts paused.
  • 502 Launcher offline. and 504 Launcher did not answer within 20 s.

curl

curl -X POST https://midnight.lumpfun.com/api/claim/b3f7e89f61e1c5466da65522168697deaf5d0328c096af4d6c55a35625f094c1
GET

/api/sol/{path}

Read routes of the SOL service. The service credits a SOL deposit on Midnight to the unshielded address named in its memo: as USDM at the SOL price minus a spread, or as bridged SOL one to one. It also cashes bridged SOL back out to Solana.

The service is offline today (see Status): its quote and px routes answer 502. While it is offline no deposit can be credited or tracked through this API. Read the vault address from a fresh quote every time; do not reuse one from an earlier answer.

Paths:

namedescription
quote?lamports=NDeposit terms, cash-out terms and the USDM credit for N lamports.
pxSOL/USD price.
blockhashA recent Solana blockhash, for building the deposit transaction.
balance/{solAddress}SOL balance of a Solana address (32 to 44 base58 characters).
reservesBacking of the bridged SOL.
deposit/{signature}Credit status of a deposit, by Solana transaction signature (80 to 90 base58 characters).
utxos/{mnAddress}Unshielded coins of a Midnight address (mn_addr1...).
holdings/{coinPk}?u=HEXLaunch tokens of a wallet, from LumpFun fill records. coinPk: 64 lower-case hex.
sell-kit/{coinPk}?u=HEXData to rebuild the shielded state of a wallet without a chain sync.
cashout/{id}Status of a cash-out.

Any other path answers 404 {"error":"not found"}.

quote (200):

{
  "lamports":       "100000000",
  "usdmAtoms":      "<atoms>",       // USDM credited for lamports; null while no price is available
  "px":             <number>,        // SOL/USD, or null
  "spreadBps":      100,
  "minLamports":    "2000000",       // deposit bounds
  "maxLamports":    "500000000",
  "vault":          "<Solana address>",   // where a deposit is sent
  "memoPrefix":     "lumpfun:sol:v1:",    // memo prefix for a USDM credit
  "asOf":           "<ISO time>",
  "floatOk":        true,            // the service can credit this amount now
  "floatUsdmAtoms": "<atoms>",       // USDM the service can credit
  "bsol": {                          // bridged SOL credit: 1 lamport = 1 atom, no spread
    "color":        "<64 hex>",      // colour of bridged SOL, or null
    "memoPrefix":   "lumpfun:bsol:v1:",
    "open":         true,
    "mintFallback": true,
    "floatAtoms":   "<atoms>"
  },
  "cashout": {
    "to":             "mn_addr1...", // Midnight address a cash-out intent pays
    "toHex":          "<64 hex>",    // the same address as hex
    "color":          "<64 hex>",    // colour of bridged SOL, or null
    "feeLamports":    "<lamports>",
    "feeBps":         500,
    "minFeeLamports": "<lamports>",
    "minLamports":    "<lamports>",
    "maxLamports":    "<lamports>",
    "open":           true
  }
}

The numbers and prefixes shown are the configured ones; always read them from the response.

Deposit flow:

Send one Solana transaction that transfers between minLamports and maxLamports to vault and carries an SPL Memo instruction with the text memoPrefix + your Midnight unshielded address (for USDM) or bsol.memoPrefix + that address (for bridged SOL). Once the transfer is finalized the service credits that address. Poll deposit/{signature}. A deposit with no valid memo, or outside the bounds, is recorded as rejected and is not credited.

deposit (200):

{
  "sig":         "<signature>",
  "state":       "credited",   // "unknown" | "pending" | "finalized" | "crediting" | "credited" | "rejected" | "failed"
  "kind":        "usdm",       // "usdm" | "bsol"
  "lamports":    "100000000",
  "atoms":       "<atoms>",    // credited amount: USDM atoms, or bridged SOL atoms
  "color":       "<64 hex>",
  "usdmAtoms":   "<atoms>",    // null for a bridged SOL credit
  "px":          <number>,
  "mnAddr":      "mn_addr1...",
  "txId":        "<tx id>",    // the Midnight credit
  "blockHeight": "<height>",
  "error":       null,
  "at":          "<ISO time>"
}

// a signature the service has not seen:
{ "sig": "<signature>", "state": "unknown" }

Other answers (200):

// px                 (503 with "px": null while no price source answers)
{ "px": <number>, "asOf": "<ISO time>" }

// blockhash          (cached for 2 seconds)
{ "blockhash": "<base58>", ... }

// balance/{solAddress}   (cached for 10 seconds)
{ "address": "<Solana address>", "lamports": "<lamports>", "sol": "1.5", "asOf": "<ISO time>" }

// utxos/{mnAddress}      (cached for 10 seconds)
{
  "address": "mn_addr1...",
  "byColor": { "<colour>": "<atoms>" },                  // balance per colour
  "all":     [ { "intentHash": "<hex>", "outputIndex": 0, "value": "<atoms>", "type": "<colour>" } ],
  "usdm":    "<atoms>",                                  // USDM balance
  "utxos":   [ { "intentHash": "<hex>", "outputIndex": 0, "value": "<atoms>" } ]   // the USDM coins only
}

// holdings/{coinPk}?u=HEX
{
  "coinPk": "<64 hex>", "unshieldedHex": "<64 hex>", "source": "lumpfun-fills",
  "pools":   [ { "pool": "<64 hex>", "ticker": "JUBJUB", "color": "<64 hex>", "atoms": "<atoms>" } ],
  "byColor": { "<colour>": "<atoms>" }
}

// sell-kit/{coinPk}?u=HEX
{
  "coinPk": "<64 hex>", "unshieldedHex": "<64 hex>",
  "firstFree": "<index>", "root": "<hex>", "height": <block height>, "source": "head", "asOf": "<ISO time>",
  "steps": [
    { "kind": "gap", "start": "<index>", "end": "<index>", "update": "<hex>" },
    { "kind": "tx", "identifier": "<hex>", "hash": "<hex>", "raw": "<hex>",
      "startIndex": 0, "endIndex": 1, "height": <block height> }
  ],
  "txs": 1
}

// reserves
{
  "vault": "<Solana address>", "vaultSol": "<SOL>", "cold": "<Solana address>", "coldSol": "<SOL>",
  "bridge": { "contract": "<64 hex>", "color": "<64 hex>", "minted": "<SOL>", "burned": "<SOL>" },   // or null
  "floatBsol": "<SOL>", "owedToUsers": "<SOL>", "pendingReleases": "<SOL>",
  "backed": true,            // SOL held covers the bridged SOL owed to users
  "hotCovers": true,         // the vault alone covers it, plus the cash-outs in flight
  "sweeps": [ ... ], "asOf": "<ISO time>"
}

holdings counts buys paid to the coin public key minus sells from the unshielded address u(64 lower-case hex). It is the launchpad's own record of fills, not a chain balance. sell-kit covers the same trades: apply its steps in order to an empty local zswap state, then check that the first free index and the Merkle root equal firstFree and root.

Limits per visitor: 60 requests per 10 seconds in total; per minute 6 for sell-kit, 20 for utxos, 30 for deposit and 30 for balance. Errors: 400 (bad signature, bad address, bad u), 404, 429 {"error":"rate limited"}, 500 {"error":"service error"}, 502 {"error":"SOL service offline."}, 504 {"error":"The SOL service did not answer in time."}.

curl (quote for 0.1 SOL)

curl "https://midnight.lumpfun.com/api/sol/quote?lamports=100000000"

curl (deposit status)

curl https://midnight.lumpfun.com/api/sol/deposit/SOLANA_SIGNATURE
GET

/api/ada/{path}

Read routes of the ADA service. The service builds one Cardano transaction that pays ADA or Cardano USDM into the launchpad vault, and credits USDM on Midnight to the unshielded address you name. It also withdraws USDM back to Cardano.

The service is offline today (see Status): its quote and px routes answer 502. While it is offline no deposit can be built, credited or tracked through this API.

Paths:

namedescription
quoteDeposit terms, withdraw terms and the ADA/USD price.
pxADA/USD price.
deposit/{txHash}?t=Status of a deposit, by Cardano transaction hash (64 hex). t: the 32-hex ticket of the deposit.
cashout/{id}Status of a withdraw.

Any other path answers 404 {"error":"not found"}.

quote (200):

{
  "open":           true,            // deposits can be credited now
  "px":             <number>,        // ADA/USD, or null
  "asOf":           "<ISO time>",
  "spreadBps":      100,             // taken from an ADA deposit
  "vault":          "addr1...",      // where deposits are paid
  "label":          <number>,        // metadata label a deposit carries
  "usdmUnit":       "<hex>",         // Cardano asset unit of USDM
  "ttlMin":         10,              // minutes a built deposit stays valid
  "slippageBps":    200,
  "minLovelace":    "5000000",       // deposit bounds
  "maxLovelace":    "500000000",
  "minUsdm":        "1000000",
  "maxUsdm":        "100000000",
  "instantMaxUsdm": "25000000",      // a credit up to this size does not wait for a block
  "floatUsdmAtoms": "<atoms>",       // USDM the service can still credit
  "dayLeftAtoms":   "<atoms>",       // what is left of the daily limit
  "cashout": {
    "open":             true,
    "feeBps":           500,
    "minFeeUsdm":       "50000",
    "minUsdm":          "2000000",
    "maxUsdm":          "100000000",
    "dayLeftUsdm":      "<atoms>",
    "toHex":            "<64 hex>",  // Midnight address a withdraw intent pays
    "color":            "<64 hex>",  // colour of USDM on Midnight
    "px":               <number>,
    "pxAsOf":           "<ISO time>",
    "pxToleranceBps":   150,
    "pxFavorBps":       30,
    "adaAvailLovelace": "<lovelace>", // ADA the vault can pay now
    "usdmAvail":        "<atoms>",    // Cardano USDM the vault can pay now
    "kinds":            [ "ada" ]     // payout kinds open now: "ada", "usdm"
  }
}

The numbers shown are the configured ones; always read them from the response. A deposit is credited one to one for USDM. For ADA the credit is floor(lovelace * round(px * 1e6) * (10000 - spreadBps) / (10000 * 1000000)) USDM atoms.

deposit (200):

// without the ticket: the state only
{ "txHash": "<64 hex>", "state": "submitted", "chain": "mempool", "credit": "none" }

// with ?t=<ticket>: the full record
{
  "txHash":      "<64 hex>",
  "state":       "credited",   // "built" | "submitting" | "submitted" | "confirmed" | "crediting" | "credited" | "failed" | "expired"
  "chain":       "block",      // "unsigned" | "mempool" | "block" | "expired" | "double-spent"
  "credit":      "credited",   // "none" | "queued" | "crediting" | "credited" | "failed"
  "kind":        "ada",        // "ada" | "usdm"
  "lovelace":    "10000000",
  "usdm":        "0",
  "atoms":       "<atoms>",    // USDM atoms credited, or to be credited, on Midnight
  "px":          <number>,
  "instant":     true,
  "mnAddr":      "mn_addr1...",
  "mnTxId":      "<tx id>",    // the Midnight credit
  "blockHeight": "<height>",
  "slot":        <number>,
  "error":       null,
  "at":          "<ISO time>",
  "mnUtxo":      { "intentHash": "<hex>", "outputIndex": 0, "value": "<atoms>" }   // the credited coin, once visible
}

A transaction that was built but not submitted answers {"state":"built","chain":"unsigned","credit":"none"}. An unknown hash answers 404 with {"txHash":"...","state":"unknown"}. px answers {"px":<number>,"asOf":"<ISO time>"}, or 503 with px: null while no price source answers. cashout/{id} answers the record of a withdraw (withdraws are made on the site itself; making one is not part of this reference), or 404 {"error":"unknown withdraw"}.

Limits per visitor: 60 requests per 10 seconds in total; per minute 40 for deposit and 40 for cashout/{id}. Errors: 429 {"error":"rate limited"}, 500 {"error":"service error"}, 502 {"error":"ADA service offline."}, 504 {"error":"The ADA service did not answer in time."}.

curl

curl https://midnight.lumpfun.com/api/ada/quote

curl (deposit status)

curl "https://midnight.lumpfun.com/api/ada/deposit/TX_HASH?t=TICKET"
POST

/api/ada/build

Builds an unsignedCardano transaction that pays the deposit into the vault from your wallet's own coins. The service holds no key for your wallet: your wallet signs the transaction and POST /api/ada/submit sends it.

Body:

namedescription
kind"ada" or "usdm". What the deposit pays in.required
amountbigint string. Lovelace for ada, USDM atoms for usdm. Within the bounds of the quote.required
mnAddrstring. Midnight unshielded address that receives the USDM credit.required
changestring. Your mainnet Cardano payment address. Change is returned to it.required
stakestring. Your mainnet reward address (stake1...).optional
utxosarray of 1 to 200 hex strings. Your wallet UTxOs as CBOR, as a CIP-30 wallet returns them.required

Response (200):

{
  "txHash":     "<64 hex>",
  "cbor":       "84a4...",           // unsigned transaction: sign this
  "kind":       "ada",
  "ticket":     "<32 hex>",          // needed for submit and for the full deposit status
  "expiresAt":  "<ISO time>",        // sign and submit before this
  "vault":      "addr1...",
  "vaultIndex": 0,                   // index of the output that pays the vault
  "fee":        "<lovelace>",        // Cardano network fee
  "expect": {                        // what the transaction must pay: check cbor against it before signing
    "vault": "addr1...", "lovelace": "10000000", "usdm": "0",
    "usdmUnit": "<hex>", "label": <number>, "ticket": "<32 hex>", "change": "addr1..."
  },
  "estimate": {
    "atoms":     "<atoms>",          // USDM atoms the deposit would be credited as now
    "minAtoms":  "<atoms>",          // lowest credit submit will accept
    "px":        <number>,
    "spreadBps": 100,
    "instant":   true                // credited without waiting for a block
  }
}

Flow:

const post = (path, body) => fetch('https://midnight.lumpfun.com/api/ada/' + path, {
  method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body),
}).then(r => r.json());

const utxos = await walletApi.getUtxos();                        // CIP-30
const built = await post('build', { kind: 'ada', amount: '10000000', mnAddr, change, stake, utxos });
// check built.cbor against built.expect before signing
const witness = await walletApi.signTx(built.cbor, true);        // partial sign
const status  = await post('submit', { txHash: built.txHash, witness, ticket: built.ticket });
// then poll GET /api/ada/deposit/{txHash}?t={ticket} until credit is "credited"

Limit: 12 requests a minute per visitor. The body may be at most 400,000 characters.

Errors:

  • 400 — a field is missing or malformed, or the amount is outside the deposit bounds.
  • 409 — none of the wallet's coins could be found on chain yet.
  • 429 — the daily limit for Cardano payments is reached, or rate limited.
  • 503 — the service is starting up, there is no ADA price, or the USDM it can credit is too low for this amount.
  • 500 — could not prepare this payment; try again in a moment.
  • 502 ADA service offline. and 504 The ADA service did not answer in time.

curl

curl -X POST https://midnight.lumpfun.com/api/ada/build \
  -H "content-type: application/json" \
  -d '{"kind":"ada","amount":"10000000","mnAddr":"mn_addr1...","change":"addr1...","utxos":["UTXO_CBOR_HEX"]}'
POST

/api/ada/submit

Attaches your wallet's witness to a transaction built by POST /api/ada/buildand submits it through the launchpad's Cardano node. The credit is priced at this moment. If it would fall below estimate.minAtoms nothing is sent.

Body:

namedescription
txHashstring. txHash from the build answer.required
witnesshex string. The CBOR witness set from walletApi.signTx(cbor, true).required
ticketstring. ticket from the build answer.required

Response (202):

{ "txHash": "<64 hex>", "state": "submitted", "chain": "mempool", "credit": "none", ... }
// the deposit record, as in GET /api/ada/deposit/{txHash}?t={ticket}

Posting the same request again returns the existing record. Limit: 12 requests a minute per visitor.

Errors:

  • 400 — txHash required, a witness that cannot be read, or a signed transaction that does not match the prepared one.
  • 403 — the ticket is missing or wrong.
  • 409 — the payment was not prepared here or has expired, it is already being submitted, or the ADA price moved. Build it again.
  • 429 — the daily limit for Cardano payments is reached.
  • 503 — the service is starting up, there is no ADA price, or the USDM it can credit is too low. Nothing was sent.
  • 502 and 504 — as for build.

curl

curl -X POST https://midnight.lumpfun.com/api/ada/submit \
  -H "content-type: application/json" \
  -d '{"txHash":"TX_HASH","witness":"WITNESS_CBOR_HEX","ticket":"TICKET"}'

Rate limits

Limits are counted per visitor IP. The limits this site enforces itself answer 429 with {"error":"too many requests, slow down"} and a retry-after: 60 header:

  • GET /api/coin — 240 a minute; fresh=1 honoured 20 times a minute.
  • GET /api/pool — 240 a minute; fresh=1 honoured 20 times a minute.
  • GET /api/history — 30 a minute.
  • GET /api/zswap — 30 a minute.
  • POST /api/submit — 5 a minute.
  • POST /api/upload — 6 an hour and 20 a day.

The trading backend and the SOL and ADA services keep their own limits. Their 429 answers are passed on without a retry-after header:

  • POST /api/sponsor, POST /api/fast, POST /api/fast/sell — 6 a minute and 40 an hour per visitor, plus limits across all visitors.
  • POST /api/launch — 6 an hour in total, 5 a day per creator address, 3 a day per connection.
  • POST /api/claim — one per pool every 10 minutes, 30 an hour across all pools.
  • Backend reads (orders, fills, payouts, fast and launch jobs, sponsor tickets) — can answer {"error":"rate limited"}.
  • /api/sol and /api/ada — see their sections.

Errors

Most errors are JSON with a single error field holding a plain message. The exceptions: /api/board adds an empty items list, /api/history answers its empty result shape with no error field, an unknown ADA deposit answers 404 with state: "unknown", and a 502 passed on from an unreachable backend can have an empty body. Read the status code first.

  • 400 — a missing or malformed parameter, body or transaction.
  • 403 — a POST from another origin (forbidden), or a transaction that is not allowed to do what it tries.
  • 404 — an address that is not a registered launch, or an unknown job, ticket or path.
  • 409 — a real request that does not fit the current state: a pool that is not live, coins already in use, a price that moved.
  • 413 / 415 — a body that is too large, or an image of the wrong type.
  • 429 — rate limited. Honour retry-after when it is present.
  • 499 — request cancelled: the caller dropped the connection.
  • 500 — internal error or service error.
  • 502 / 503 / 504 — the backend, a service or the chain could not be reached, is not ready, or did not answer in time. The answer is unknown, not empty.

The same holds for a 200 that carries state: null: the registry answered but the chain did not. Do not read it as a pool with no liquidity. Retry instead of caching it.