{
  "openapi": "3.1.0",
  "info": {
    "title": "MEMEPOOL API",
    "version": "1",
    "description": "MEMEPOOL is a memecoin launchpad on the BSV blockchain, made by TX Blaster: anyone launches a BSV-21 token with a fixed supply of 1,000,000,000 on a bonding curve (pump.fun-style), and anyone buys and sells it on that curve. Every trade is ONE atomic BSV transaction — the tokens and the BSV move together or not at all — signed by the trader's own wallet; network fees are fractions of a cent. Traders keep their own keys; each coin's pool is held by the MEMEPOOL service, and every pool is checked against the chain in public (proof of reserves). Public, CORS open, no API key. Money moves only through transactions your own keys sign: prepare returns a template, you verify and sign your inputs, submit; MEMEPOOL signs the pool's side last. Name your program with the X-Memepool-Client header. SDK/CLI/MCP server: https://txblaster.xyz/memepool/dev.html",
    "contact": {
      "name": "TX Blaster",
      "url": "https://txblaster.xyz/memepool/dev.html"
    }
  },
  "servers": [
    {
      "url": "https://txblaster.xyz/memepool/api"
    }
  ],
  "externalDocs": {
    "description": "Developers & agents",
    "url": "https://txblaster.xyz/memepool/dev.html"
  },
  "paths": {
    "/config": {
      "get": {
        "operationId": "getConfig",
        "summary": "Network, fees, prices and limits",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Network, fees, prices and limits",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/tokens": {
      "get": {
        "operationId": "listTokens",
        "summary": "The board: listed coins as cards",
        "parameters": [
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "trending | new | mcap | graduating | graduated | paid | burned | fair",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Filter by name, ticker or id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1–96",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Paging",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The board: listed coins as cards",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/tokens/{id}": {
      "get": {
        "operationId": "getToken",
        "summary": "One coin: card, curve state, stats, fee route, locks",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Token id: \"<deploy txid>_<vout>\"",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}_\\d{1,4}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One coin: card, curve state, stats, fee route, locks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/tokens/{id}/trades": {
      "get": {
        "operationId": "getTrades",
        "summary": "A coin's trades, newest first",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Token id: \"<deploy txid>_<vout>\"",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}_\\d{1,4}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1–200",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "ms",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A coin's trades, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/tokens/{id}/candles": {
      "get": {
        "operationId": "getCandles",
        "summary": "OHLC candles",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Token id: \"<deploy txid>_<vout>\"",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}_\\d{1,4}$"
            }
          },
          {
            "name": "tf",
            "in": "query",
            "required": false,
            "description": "1m | 5m | 15m | 1h | 4h | 1d",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1–1000",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OHLC candles",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/tokens/{id}/holders": {
      "get": {
        "operationId": "getHolders",
        "summary": "Holders, with the curve, vaults and the dev labelled",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Token id: \"<deploy txid>_<vout>\"",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}_\\d{1,4}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Holders, with the curve, vaults and the dev labelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/tokens/{id}/reserves": {
      "get": {
        "operationId": "getReserves",
        "summary": "Proof of reserves of this coin: expected, ledger, chain",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Token id: \"<deploy txid>_<vout>\"",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}_\\d{1,4}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Proof of reserves of this coin: expected, ledger, chain",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/quote": {
      "get": {
        "operationId": "getQuote",
        "summary": "What a trade gives before it is made",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Token id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "side",
            "in": "query",
            "required": false,
            "description": "buy | sell | swap",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sats",
            "in": "query",
            "required": false,
            "description": "buy: gross sats",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "tokens",
            "in": "query",
            "required": false,
            "description": "sell / swap: tokens",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "swap: the token id bought with the proceeds",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "What a trade gives before it is made",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/stats": {
      "get": {
        "operationId": "getStats",
        "summary": "Totals and the market mood (buys vs sells of people, last hour and day)",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Totals and the market mood (buys vs sells of people, last hour and day)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/feed": {
      "get": {
        "operationId": "getFeed",
        "summary": "The latest trades, launches and graduations",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1–100",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The latest trades, launches and graduations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/leaderboard": {
      "get": {
        "operationId": "getLeaderboard",
        "summary": "Top traders, creators or agents",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "traders | creators | agents",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "description": "24h | 7d | 30d | all",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1–100",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Top traders, creators or agents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/portfolio/{address}": {
      "get": {
        "operationId": "getPortfolio",
        "summary": "A wallet's holdings and profit",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A wallet's holdings and profit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/proof": {
      "get": {
        "operationId": "getProof",
        "summary": "Every pool against its ledger and the chain",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Every pool against its ledger and the chain",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/shouts": {
      "get": {
        "operationId": "getShouts",
        "summary": "The paid lines running in the live tape",
        "parameters": [],
        "responses": {
          "200": {
            "description": "The paid lines running in the live tape",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/stream": {
      "get": {
        "operationId": "stream",
        "summary": "Server-Sent Events: trade, launch, graduate, token, comment, reward, transfer, shout",
        "responses": {
          "200": {
            "description": "text/event-stream"
          }
        }
      }
    },
    "/trade/prepare": {
      "post": {
        "operationId": "prepareTrade",
        "summary": "Quote a trade as a transaction template",
        "description": "Body: { tokenId, side: \"buy\"|\"sell\", sats | tokens, minTokens | minSats, trader: { ord, pay }, coins: [{ txid, vout }] }. Returns { quoteId, template, expiresAt }. Verify the template, sign your inputs only.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Quote a trade as a transaction template",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Refused (see error code)"
          },
          "409": {
            "description": "Stale: another trade landed first — prepare again"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/trade/submit": {
      "post": {
        "operationId": "submitTrade",
        "summary": "Submit the signed trade",
        "description": "Body: { quoteId, unlocks: { \"<input index>\": \"<unlocking script hex>\" } }. 202 = sent, settling.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Submit the signed trade",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Refused (see error code)"
          },
          "409": {
            "description": "Stale: another trade landed first — prepare again"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/launch/prepare": {
      "post": {
        "operationId": "prepareLaunch",
        "summary": "Prepare a launch (signed by the creator's keys)",
        "description": "Returns the pool address, fee and supply the deploy+mint transaction must pay.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Prepare a launch (signed by the creator's keys)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Refused (see error code)"
          },
          "409": {
            "description": "Stale: another trade landed first — prepare again"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/launch/submit": {
      "post": {
        "operationId": "submitLaunch",
        "summary": "Submit the signed deploy+mint",
        "description": "Body: { launchId, ef } — the transaction in Extended Format.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Submit the signed deploy+mint",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Refused (see error code)"
          },
          "409": {
            "description": "Stale: another trade landed first — prepare again"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/promo/submit": {
      "post": {
        "operationId": "submitPromo",
        "summary": "Pay for a featured slot, a banner or a shout",
        "description": "One transaction of the payer's own coins: price to MEMEPOOL, a memo naming the coin, change back.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pay for a featured slot, a banner or a shout",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Refused (see error code)"
          },
          "409": {
            "description": "Stale: another trade landed first — prepare again"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    }
  }
}