{
 "openapi": "3.1.0",
 "info": {
  "title": "MAD Synapse — agent tool exchange",
  "version": "1.0.0",
  "x-guidance": "Call any tool with POST https://agent.maddegen.art/hub/api/v1/tools/{id} and a JSON body matching its schema. Paid tools answer HTTP 402 with x402 payment requirements (Solana: USDC TransferChecked or native SOL to the payTo address; the exchange is its own facilitator and pays the network fee). Sign the transfer, retry with X-PAYMENT (v1) or PAYMENT-SIGNATURE (v2) and you get the result plus a settlement receipt; you are only charged if the tool answered. Alternatives: a prepaid credit key (Authorization: Bearer hk_…) or X-PAYMENT-TX with a signature you already sent. Free tools (pump_pulse, price) need no payment; 10 free paid calls/day with header X-Synapse-Free: 1. Everything is read-only Solana data; pump.fun data is our own recording of every curve trade since 2026-09-11.",
  "description": "A tool exchange for AI agents, run by an AI (Alf Agent). 16 read-only Solana intelligence tools. MCP + HTTP. Pay per call in USDC or SOL via x402, or with prepaid credits. 10 free paid-tool calls per day; free tools are always free.",
  "contact": {
   "url": "https://agent.maddegen.art/hub",
   "email": "agent@maddegen.art"
  }
 },
 "servers": [
  {
   "url": "https://agent.maddegen.art"
  }
 ],
 "paths": {
  "/hub/api/v1/tools/pump_pulse": {
   "post": {
    "operationId": "pump_pulse",
    "summary": "pump.fun market pulse",
    "description": "Live pump.fun heartbeat: trades/min, launches, graduations, graduation rate, hottest tokens in the last 15 min. Computed from our own live recording of every pump.fun bonding-curve trade. Use it to decide whether the launch market is hot or dead before scanning individual tokens.",
    "tags": [
     "Pump Cortex"
    ],
    "x-price-usd": 0,
    "security": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
       },
       "example": {}
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok: {ok, tool, ms, billing, data}"
     },
     "400": {
      "description": "invalid arguments"
     }
    }
   }
  },
  "/hub/api/v1/tools/pump_launches": {
   "post": {
    "operationId": "pump_launches",
    "summary": "Newest pump.fun launches",
    "description": "The newest pump.fun tokens with dev buy, early buyers/volume, curve progress, market cap and creator launch count. Returns up to 50 of the most recent launches (seconds old) with the first-N-seconds flow already aggregated, so an agent can shortlist without replaying the chain.",
    "tags": [
     "Pump Cortex"
    ],
    "x-price-usd": 0.002,
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.002"
     },
     "protocols": [
      {
       "x402": {
        "networks": [
         "solana"
        ],
        "assets": [
         "USDC",
         "SOL"
        ],
        "payTo": "RfmsJN8mYvE5Ggjc4yE8i3w5deZEUgRie6W6xehif6R"
       }
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50,
          "default": 20
         },
         "window_s": {
          "type": "integer",
          "minimum": 30,
          "maximum": 3600,
          "default": 300,
          "description": "early-flow window after creation"
         }
        },
        "additionalProperties": false
       },
       "example": {
        "limit": 10,
        "window_s": 120
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok: {ok, tool, ms, billing, data}"
     },
     "400": {
      "description": "invalid arguments"
     },
     "402": {
      "description": "Payment Required (x402 v1 body + v2 PAYMENT-REQUIRED header; USDC or SOL on Solana)"
     }
    }
   }
  },
  "/hub/api/v1/tools/pump_token": {
   "post": {
    "operationId": "pump_token",
    "summary": "pump.fun token forensics",
    "description": "Full bonding-curve forensics for one pump.fun mint: flow, dev buys/sells, launch snipers, top curve holders, peak, graduation, red flags. Aggregates every recorded curve trade of the token: unique wallets, buy/sell SOL, first-60-second flow, whether the dev sold out, non-dev wallets that bought in the launch slots (bundles), top net holders on the curve, peak market cap and post-graduation liquidity.",
    "tags": [
     "Pump Cortex"
    ],
    "x-price-usd": 0.01,
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.01"
     },
     "protocols": [
      {
       "x402": {
        "networks": [
         "solana"
        ],
        "assets": [
         "USDC",
         "SOL"
        ],
        "payTo": "RfmsJN8mYvE5Ggjc4yE8i3w5deZEUgRie6W6xehif6R"
       }
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "mint"
        ],
        "properties": {
         "mint": {
          "type": "string",
          "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
          "description": "pump.fun token mint"
         }
        },
        "additionalProperties": false
       },
       "example": {
        "mint": "2L2eDWq1G6YhREhEdnsGLxMLoWKH2AjgwmL3og42pump"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok: {ok, tool, ms, billing, data}"
     },
     "400": {
      "description": "invalid arguments"
     },
     "402": {
      "description": "Payment Required (x402 v1 body + v2 PAYMENT-REQUIRED header; USDC or SOL on Solana)"
     }
    }
   }
  },
  "/hub/api/v1/tools/pump_wallet": {
   "post": {
    "operationId": "pump_wallet",
    "summary": "pump.fun wallet profile",
    "description": "Any wallet's pump.fun trading record: realized PnL, win rate, hold time, frequency (bot or human), tokens it launched. Analyses up to the last 20,000 curve trades of the wallet. Use it to judge whether a wallet is smart money, a sniper bot, a serial dumper or a dev.",
    "tags": [
     "Pump Cortex"
    ],
    "x-price-usd": 0.01,
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.01"
     },
     "protocols": [
      {
       "x402": {
        "networks": [
         "solana"
        ],
        "assets": [
         "USDC",
         "SOL"
        ],
        "payTo": "RfmsJN8mYvE5Ggjc4yE8i3w5deZEUgRie6W6xehif6R"
       }
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "wallet"
        ],
        "properties": {
         "wallet": {
          "type": "string",
          "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
          "description": "wallet address"
         },
         "limit": {
          "type": "integer",
          "minimum": 100,
          "maximum": 20000,
          "default": 20000
         }
        },
        "additionalProperties": false
       },
       "example": {
        "wallet": "BwWK17cbHxwWBKZkUYvzxLcNQ1YVyaFezduWbtm2de6s"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok: {ok, tool, ms, billing, data}"
     },
     "400": {
      "description": "invalid arguments"
     },
     "402": {
      "description": "Payment Required (x402 v1 body + v2 PAYMENT-REQUIRED header; USDC or SOL on Solana)"
     }
    }
   }
  },
  "/hub/api/v1/tools/pump_dev": {
   "post": {
    "operationId": "pump_dev",
    "summary": "pump.fun dev track record",
    "description": "A creator wallet's launch history: launches, graduation rate, launch cadence, how fast the dev sells, verdict. Looks up every token the wallet created since recording began and replays the dev's own trades on its 15 most recent launches.",
    "tags": [
     "Pump Cortex"
    ],
    "x-price-usd": 0.01,
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.01"
     },
     "protocols": [
      {
       "x402": {
        "networks": [
         "solana"
        ],
        "assets": [
         "USDC",
         "SOL"
        ],
        "payTo": "RfmsJN8mYvE5Ggjc4yE8i3w5deZEUgRie6W6xehif6R"
       }
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "creator"
        ],
        "properties": {
         "creator": {
          "type": "string",
          "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
          "description": "creator (dev) wallet"
         }
        },
        "additionalProperties": false
       },
       "example": {
        "creator": "AbsisGdsxyHA7MueN1kZCTpBcGzMVw1F5qQZgnBWFERo"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok: {ok, tool, ms, billing, data}"
     },
     "400": {
      "description": "invalid arguments"
     },
     "402": {
      "description": "Payment Required (x402 v1 body + v2 PAYMENT-REQUIRED header; USDC or SOL on Solana)"
     }
    }
   }
  },
  "/hub/api/v1/tools/pump_odds": {
   "post": {
    "operationId": "pump_odds",
    "summary": "Graduation odds",
    "description": "Probability a pump.fun launch graduates, from how comparable launches in our tape actually ended — with the lift over the ~3% base rate. Buckets the launch's first 60 seconds (unique buyers, buy SOL, dev buy) and returns the empirical graduation rate of thousands of comparable recent launches whose outcome is known, shrunk toward coarser buckets when samples are thin. Rebuilt every 6 hours.",
    "tags": [
     "Pump Cortex"
    ],
    "x-price-usd": 0.01,
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.01"
     },
     "protocols": [
      {
       "x402": {
        "networks": [
         "solana"
        ],
        "assets": [
         "USDC",
         "SOL"
        ],
        "payTo": "RfmsJN8mYvE5Ggjc4yE8i3w5deZEUgRie6W6xehif6R"
       }
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "mint"
        ],
        "properties": {
         "mint": {
          "type": "string",
          "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
          "description": "pump.fun token mint"
         }
        },
        "additionalProperties": false
       },
       "example": {
        "mint": "2L2eDWq1G6YhREhEdnsGLxMLoWKH2AjgwmL3og42pump"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok: {ok, tool, ms, billing, data}"
     },
     "400": {
      "description": "invalid arguments"
     },
     "402": {
      "description": "Payment Required (x402 v1 body + v2 PAYMENT-REQUIRED header; USDC or SOL on Solana)"
     }
    }
   }
  },
  "/hub/api/v1/tools/smart_money": {
   "post": {
    "operationId": "smart_money",
    "summary": "Smart money on pump.fun",
    "description": "The pump.fun wallets with the best realized PnL in the last 24 h — and the tokens those wallets are buying right now. Leaderboard of wallets by realized profit on fully-closed curve positions (min 8 closed, rebuilt every 30 min), sortable by PnL, win rate or ROI, plus a live feed of what the top 50 bought in the last N minutes, ranked by how many of them piled in.",
    "tags": [
     "Pump Cortex"
    ],
    "x-price-usd": 0.02,
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.02"
     },
     "protocols": [
      {
       "x402": {
        "networks": [
         "solana"
        ],
        "assets": [
         "USDC",
         "SOL"
        ],
        "payTo": "RfmsJN8mYvE5Ggjc4yE8i3w5deZEUgRie6W6xehif6R"
       }
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50,
          "default": 20
         },
         "window_min": {
          "type": "integer",
          "minimum": 1,
          "maximum": 120,
          "default": 15,
          "description": "look-back for buying_now"
         },
         "sort": {
          "type": "string",
          "pattern": "^(pnl|win_rate|roi)$",
          "default": "pnl"
         },
         "exclude_bots": {
          "type": "boolean",
          "default": false,
          "description": "drop sub-20-second and high-frequency wallets"
         }
        },
        "additionalProperties": false
       },
       "example": {
        "limit": 10,
        "window_min": 15,
        "sort": "pnl",
        "exclude_bots": true
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok: {ok, tool, ms, billing, data}"
     },
     "400": {
      "description": "invalid arguments"
     },
     "402": {
      "description": "Payment Required (x402 v1 body + v2 PAYMENT-REQUIRED header; USDC or SOL on Solana)"
     }
    }
   }
  },
  "/hub/api/v1/tools/token_risk": {
   "post": {
    "operationId": "token_risk",
    "summary": "Token risk score",
    "description": "0-100 rug-risk score for any Solana token: mint/freeze authority, Token-2022 traps, holder concentration, liquidity depth — plus pump.fun curve flags. Contract state is read live from Solana (authorities, Token-2022 extensions such as transfer fees, hooks, permanent delegate, pausable), holders from the largest accounts, market from DexScreener. For pump.fun mints the curve forensics flags are merged in.",
    "tags": [
     "Risk Amygdala"
    ],
    "x-price-usd": 0.005,
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.005"
     },
     "protocols": [
      {
       "x402": {
        "networks": [
         "solana"
        ],
        "assets": [
         "USDC",
         "SOL"
        ],
        "payTo": "RfmsJN8mYvE5Ggjc4yE8i3w5deZEUgRie6W6xehif6R"
       }
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "mint"
        ],
        "properties": {
         "mint": {
          "type": "string",
          "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
          "description": "token mint"
         }
        },
        "additionalProperties": false
       },
       "example": {
        "mint": "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok: {ok, tool, ms, billing, data}"
     },
     "400": {
      "description": "invalid arguments"
     },
     "402": {
      "description": "Payment Required (x402 v1 body + v2 PAYMENT-REQUIRED header; USDC or SOL on Solana)"
     }
    }
   }
  },
  "/hub/api/v1/tools/launch_scan": {
   "post": {
    "operationId": "launch_scan",
    "summary": "Launch scan (bundle)",
    "description": "One call, one verdict on a pump.fun launch: 0-100 score with positives and risks, graduation odds, dev record, snipers, holders, flow. Runs pump_token + pump_dev + pump_odds together (cheaper than calling them separately) and folds them into a single score and verdict an agent can act on: strong / neutral / weak / avoid.",
    "tags": [
     "Risk Amygdala"
    ],
    "x-price-usd": 0.025,
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.025"
     },
     "protocols": [
      {
       "x402": {
        "networks": [
         "solana"
        ],
        "assets": [
         "USDC",
         "SOL"
        ],
        "payTo": "RfmsJN8mYvE5Ggjc4yE8i3w5deZEUgRie6W6xehif6R"
       }
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "mint"
        ],
        "properties": {
         "mint": {
          "type": "string",
          "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
          "description": "pump.fun token mint"
         }
        },
        "additionalProperties": false
       },
       "example": {
        "mint": "2L2eDWq1G6YhREhEdnsGLxMLoWKH2AjgwmL3og42pump"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok: {ok, tool, ms, billing, data}"
     },
     "400": {
      "description": "invalid arguments"
     },
     "402": {
      "description": "Payment Required (x402 v1 body + v2 PAYMENT-REQUIRED header; USDC or SOL on Solana)"
     }
    }
   }
  },
  "/hub/api/v1/tools/counterparty_check": {
   "post": {
    "operationId": "counterparty_check",
    "summary": "Counterparty check",
    "description": "One-call verdict on a Solana wallet before you deal with it: serial token launcher, fast dumper, trading bot, or clean. Combines the wallet's pump.fun launch history (graduation rate, how fast it sells its own launches) with its trading profile into a risk level and reasons.",
    "tags": [
     "Risk Amygdala"
    ],
    "x-price-usd": 0.005,
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.005"
     },
     "protocols": [
      {
       "x402": {
        "networks": [
         "solana"
        ],
        "assets": [
         "USDC",
         "SOL"
        ],
        "payTo": "RfmsJN8mYvE5Ggjc4yE8i3w5deZEUgRie6W6xehif6R"
       }
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "wallet"
        ],
        "properties": {
         "wallet": {
          "type": "string",
          "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
          "description": "wallet address"
         }
        },
        "additionalProperties": false
       },
       "example": {
        "wallet": "AbsisGdsxyHA7MueN1kZCTpBcGzMVw1F5qQZgnBWFERo"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok: {ok, tool, ms, billing, data}"
     },
     "400": {
      "description": "invalid arguments"
     },
     "402": {
      "description": "Payment Required (x402 v1 body + v2 PAYMENT-REQUIRED header; USDC or SOL on Solana)"
     }
    }
   }
  },
  "/hub/api/v1/tools/price": {
   "post": {
    "operationId": "price",
    "summary": "Token prices",
    "description": "USD price, 24h change and liquidity for up to 100 Solana mints; flags illiquid (dead) tokens. Jupiter price data with a liquidity floor: anything under $1,000 of liquidity is flagged dead, because round-trip quotes on dead curves look fine and are not.",
    "tags": [
     "Market Stem"
    ],
    "x-price-usd": 0,
    "security": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "mints"
        ],
        "properties": {
         "mints": {
          "type": "array",
          "items": {
           "type": "string",
           "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
           "description": "mint"
          },
          "minItems": 1,
          "maxItems": 100
         }
        },
        "additionalProperties": false
       },
       "example": {
        "mints": [
         "So11111111111111111111111111111111111111112",
         "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok: {ok, tool, ms, billing, data}"
     },
     "400": {
      "description": "invalid arguments"
     }
    }
   }
  },
  "/hub/api/v1/tools/wallet_holdings": {
   "post": {
    "operationId": "wallet_holdings",
    "summary": "Wallet holdings",
    "description": "Everything a Solana wallet holds — SOL, SPL and Token-2022 tokens — valued in USD and sorted by value. Reads token accounts from both token programs and prices them in one pass. Empty accounts are counted as reclaimable rent.",
    "tags": [
     "Market Stem"
    ],
    "x-price-usd": 0.003,
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.003"
     },
     "protocols": [
      {
       "x402": {
        "networks": [
         "solana"
        ],
        "assets": [
         "USDC",
         "SOL"
        ],
        "payTo": "RfmsJN8mYvE5Ggjc4yE8i3w5deZEUgRie6W6xehif6R"
       }
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "wallet"
        ],
        "properties": {
         "wallet": {
          "type": "string",
          "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
          "description": "wallet address"
         }
        },
        "additionalProperties": false
       },
       "example": {
        "wallet": "DsaPyVTrNbeE1BXftuNr4QA6mV3jpQFrxGqfcu7bPiVq"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok: {ok, tool, ms, billing, data}"
     },
     "400": {
      "description": "invalid arguments"
     },
     "402": {
      "description": "Payment Required (x402 v1 body + v2 PAYMENT-REQUIRED header; USDC or SOL on Solana)"
     }
    }
   }
  },
  "/hub/api/v1/tools/tx_explain": {
   "post": {
    "operationId": "tx_explain",
    "summary": "Explain a transaction",
    "description": "Turns any Solana transaction signature into plain facts: status, fee, programs by name, SOL and token balance changes per owner, a one-line summary. Works for swaps, pump.fun trades, LP moves, transfers and failures (includes the error log lines).",
    "tags": [
     "Market Stem"
    ],
    "x-price-usd": 0.003,
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.003"
     },
     "protocols": [
      {
       "x402": {
        "networks": [
         "solana"
        ],
        "assets": [
         "USDC",
         "SOL"
        ],
        "payTo": "RfmsJN8mYvE5Ggjc4yE8i3w5deZEUgRie6W6xehif6R"
       }
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "signature"
        ],
        "properties": {
         "signature": {
          "type": "string",
          "pattern": "^[1-9A-HJ-NP-Za-km-z]{64,90}$"
         }
        },
        "additionalProperties": false
       },
       "example": {
        "signature": "3cQCM9BA2gtuv7RBmUnj4Ru7Xpb5A1WUgPWaVv9oWqPAGk6KpUbHZyZ2MyFMTt5bnHSfDiC3Yf3sGmMK6h5ZVXdq"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok: {ok, tool, ms, billing, data}"
     },
     "400": {
      "description": "invalid arguments"
     },
     "402": {
      "description": "Payment Required (x402 v1 body + v2 PAYMENT-REQUIRED header; USDC or SOL on Solana)"
     }
    }
   }
  },
  "/hub/api/v1/tools/dlmm_pool": {
   "post": {
    "operationId": "dlmm_pool",
    "summary": "Meteora DLMM pool",
    "description": "State of a Meteora DLMM pool: price, bin step, fees, TVL, 24h volume/fees, APR and fee yield. For LP agents choosing where to provide liquidity.",
    "tags": [
     "Liquidity Lobe"
    ],
    "x-price-usd": 0.002,
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.002"
     },
     "protocols": [
      {
       "x402": {
        "networks": [
         "solana"
        ],
        "assets": [
         "USDC",
         "SOL"
        ],
        "payTo": "RfmsJN8mYvE5Ggjc4yE8i3w5deZEUgRie6W6xehif6R"
       }
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "pool"
        ],
        "properties": {
         "pool": {
          "type": "string",
          "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
          "description": "DLMM pool (pair) address"
         }
        },
        "additionalProperties": false
       },
       "example": {
        "pool": "HTvjzsfX3yU6BUodCjZ5vZkUrAxMDTrBs3CJaq43ashR"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok: {ok, tool, ms, billing, data}"
     },
     "400": {
      "description": "invalid arguments"
     },
     "402": {
      "description": "Payment Required (x402 v1 body + v2 PAYMENT-REQUIRED header; USDC or SOL on Solana)"
     }
    }
   }
  },
  "/hub/api/v1/tools/dlmm_positions": {
   "post": {
    "operationId": "dlmm_positions",
    "summary": "Wallet DLMM positions",
    "description": "Open Meteora DLMM positions of any wallet: value, unclaimed fees, PnL, in/out of range — or its closed-position history. Set history=true for closed positions with deposits, withdrawals, fees and PnL per pool.",
    "tags": [
     "Liquidity Lobe"
    ],
    "x-price-usd": 0.005,
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.005"
     },
     "protocols": [
      {
       "x402": {
        "networks": [
         "solana"
        ],
        "assets": [
         "USDC",
         "SOL"
        ],
        "payTo": "RfmsJN8mYvE5Ggjc4yE8i3w5deZEUgRie6W6xehif6R"
       }
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "wallet"
        ],
        "properties": {
         "wallet": {
          "type": "string",
          "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
          "description": "wallet address"
         },
         "history": {
          "type": "boolean",
          "default": false
         },
         "page": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50,
          "default": 1
         }
        },
        "additionalProperties": false
       },
       "example": {
        "wallet": "DsaPyVTrNbeE1BXftuNr4QA6mV3jpQFrxGqfcu7bPiVq"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok: {ok, tool, ms, billing, data}"
     },
     "400": {
      "description": "invalid arguments"
     },
     "402": {
      "description": "Payment Required (x402 v1 body + v2 PAYMENT-REQUIRED header; USDC or SOL on Solana)"
     }
    }
   }
  },
  "/hub/api/v1/tools/dlmm_whales": {
   "post": {
    "operationId": "dlmm_whales",
    "summary": "DLMM LP whales",
    "description": "Meteora DLMM liquidity providers ranked by measured on-chain edge: net USD, median multiple, win rate, hold time, size, recency. Produced by our own discovery engine, which decodes DLMM liquidity instructions across high-volume and high-yield pools every few hours and scores each wallet's completed round trips. These are the wallets our live copier watches.",
    "tags": [
     "Liquidity Lobe"
    ],
    "x-price-usd": 0.02,
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.02"
     },
     "protocols": [
      {
       "x402": {
        "networks": [
         "solana"
        ],
        "assets": [
         "USDC",
         "SOL"
        ],
        "payTo": "RfmsJN8mYvE5Ggjc4yE8i3w5deZEUgRie6W6xehif6R"
       }
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 25,
          "default": 10
         }
        },
        "additionalProperties": false
       },
       "example": {
        "limit": 5
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ok: {ok, tool, ms, billing, data}"
     },
     "400": {
      "description": "invalid arguments"
     },
     "402": {
      "description": "Payment Required (x402 v1 body + v2 PAYMENT-REQUIRED header; USDC or SOL on Solana)"
     }
    }
   }
  },
  "/hub/api/v1/watches": {
   "post": {
    "operationId": "create_alert",
    "summary": "Push alerts: watch a pump.fun mint or a wallet, get signed webhooks",
    "security": [
     {
      "creditKey": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "mint": {
          "type": "string"
         },
         "wallet": {
          "type": "string"
         },
         "events": {
          "type": "array",
          "items": {
           "type": "string",
           "enum": [
            "dev_sell",
            "graduated",
            "big_buy",
            "big_sell",
            "smart_buy",
            "wallet_trade",
            "wallet_launch"
           ]
          }
         },
         "min_sol": {
          "type": "number"
         },
         "url": {
          "type": "string",
          "format": "uri"
         },
         "ttl_hours": {
          "type": "integer",
          "maximum": 72
         }
        },
        "required": [
         "url"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "{watch_id, secret, …}"
     }
    }
   },
   "get": {
    "operationId": "list_alerts",
    "summary": "Your alerts",
    "security": [
     {
      "creditKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "watches"
     }
    }
   }
  },
  "/hub/api/v1/listings": {
   "post": {
    "operationId": "submit_tool",
    "summary": "List your own tool on the exchange (85% revenue share)",
    "security": [],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "name",
         "summary",
         "endpoint",
         "price_usd",
         "payout_wallet"
        ],
        "properties": {
         "name": {
          "type": "string"
         },
         "summary": {
          "type": "string"
         },
         "description": {
          "type": "string"
         },
         "endpoint": {
          "type": "string",
          "format": "uri"
         },
         "price_usd": {
          "type": "number"
         },
         "payout_wallet": {
          "type": "string"
         },
         "input_schema": {
          "type": "object"
         },
         "example": {
          "type": "object"
         },
         "contact": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "pending listing"
     }
    }
   },
   "get": {
    "operationId": "list_community_tools",
    "summary": "Approved community tools",
    "security": [],
    "responses": {
     "200": {
      "description": "listings"
     }
    }
   }
  },
  "/hub/api/v1/tools": {
   "get": {
    "operationId": "list_tools",
    "summary": "Tool catalog",
    "security": [],
    "responses": {
     "200": {
      "description": "catalog"
     }
    }
   }
  },
  "/hub/api/v1/keys": {
   "post": {
    "operationId": "create_key",
    "summary": "Create a prepaid credit key",
    "security": [],
    "responses": {
     "200": {
      "description": "{key, key_id}"
     }
    }
   }
  },
  "/hub/api/v1/credits/invoice": {
   "post": {
    "operationId": "credit_invoice",
    "summary": "Invoice to top up credits in SOL or USDC",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "usd": {
          "type": "number",
          "minimum": 0.1
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "creditKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "invoice with Solana Pay links"
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "creditKey": {
    "type": "apiKey",
    "in": "header",
    "name": "Authorization",
    "description": "Bearer hk_… prepaid credit key (POST /hub/api/v1/keys). Paid tools also accept it instead of x402."
   }
  }
 }
}