{
  "openapi": "3.1.0",
  "info": {
    "title": "Flash launch, Token War and trading API (read routes)",
    "version": "1.0.0",
    "description": "Public read routes behind the Flash agent kit, plus the two writes a launch needs (image upload and moderation). The best way to quote and swap Flash assets is Uniswap v4 via the Universal Router on the Flash hook pools, quoted through the Uniswap v4 Quoter; Aerodrome support is planned as a future expansion but is NOT live and must not be used. For unsigned transactions use the MCP server at https://api.tryflash.app/mcp (quote_trade, build_trade, build_curve_trade, build_launch, build_war_action). Guides: https://tryflash.app/agents/flash/SKILL.md. Send no Origin header (or Origin https://tryflash.app); other origins get 403."
  },
  "servers": [
    {
      "url": "https://api.tryflash.app"
    }
  ],
  "paths": {
    "/v1/config": {
      "get": {
        "operationId": "getConfig",
        "summary": "Core addresses",
        "description": "FLASH token, the Flash hook (the hooks field of every Flash pool key), registry and the RWA/stock catalogue (rwas).",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Config.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "chainId": {
                      "type": "integer"
                    },
                    "hook": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]{40}$"
                    },
                    "mainToken": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]{40}$"
                    },
                    "rwas": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "symbol": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$"
                          },
                          "decimals": {
                            "type": "integer"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "routeReady": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/launch-v2": {
      "get": {
        "operationId": "getLaunchConfig",
        "summary": "Launch stack snapshot",
        "description": "Whether launching is live, the launchpad / Token War / config / engine addresses, modes, FLASH price, quoteAssets (launch pair assets with quoteClass SUB/STOCK/PERP), inputRoutes and launchV4. If launchV4.active is false (or absent), new coins are created with launchpad.createLaunch (gas only) and the agent kit only uses the direct FLASH input route (id flash). If launchV4.active is true, the launchpad only accepts creation through the launch input router V4 (launchV4.contracts.inputRouter, also contracts.launchInputRouter): createWithFlash, createWithEth or createWithToken, which pay the creation fee ($0.169 by default: launchV4.creationFee.usd18; launchV4.creationFee.flash = ceil($fee / FLASH TWAP), re-read on-chain as currentCreationFee() when the tx executes) and spend the rest on the creator's first buy in the same transaction. ETH/USDC are converted to FLASH on the Flash Uniswap v4 hook pool inside the router. Re-read every time; the MCP tools also check approval on-chain.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Launch snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "configured": {
                      "type": "boolean"
                    },
                    "stackVersion": {
                      "type": "integer"
                    },
                    "contracts": {
                      "type": "object"
                    },
                    "quoteAssets": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "address": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$"
                          },
                          "quoteClass": {
                            "enum": [
                              "SUB",
                              "STOCK",
                              "PERP"
                            ]
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "decimals": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "inputRoutes": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "pricing": {
                      "type": "object",
                      "properties": {
                        "flashUsd": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "launchV4": {
                      "type": "object",
                      "description": "Launch V4 (Phase B) cutover state. active is true only once every V4 address is configured; until then creation is launchpad.createLaunch with no fee.",
                      "properties": {
                        "active": {
                          "type": "boolean"
                        },
                        "reason": {
                          "type": "string",
                          "description": "Why the cutover is inactive (for example INCOMPLETE_LAUNCH_V4_CUTOVER:...)."
                        },
                        "contracts": {
                          "type": "object",
                          "properties": {
                            "inputRouter": {
                              "type": "string",
                              "pattern": "^0x[0-9a-fA-F]{40}$",
                              "description": "FlashLaunchInputRouterV4: createWithFlash / createWithEth / createWithToken and the buy routes."
                            },
                            "previousInputRouter": {
                              "type": "string",
                              "pattern": "^0x[0-9a-fA-F]{40}$",
                              "description": "The de-listed router (history only; its create reverts once a fee is charged)."
                            }
                          },
                          "additionalProperties": true
                        },
                        "creationFee": {
                          "type": "object",
                          "properties": {
                            "usd18": {
                              "type": "string",
                              "description": "Creation fee in USD, 18 decimals (169000000000000000 = $0.169)."
                            },
                            "flash": {
                              "type": "string",
                              "description": "The fee in FLASH wei at the live price when the snapshot was read."
                            }
                          }
                        },
                        "floatingGoal": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/launch-v2/prelaunches": {
      "get": {
        "operationId": "listPrelaunches",
        "summary": "Bonding-curve markets",
        "description": "Tokens still on their bonding curve: token, curve, phase (pending, trading, ready, graduated, aborted), graduationGoal, principalRaised (FLASH, 18 decimals), buy and sell counts.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Up to 100.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Curves.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "launches": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "contracts": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/launch-v2/wars/current": {
      "get": {
        "operationId": "getCurrentWar",
        "summary": "Current Token War",
        "description": "state.phase: 0 standby, 1 open and trading, 2 winner locked, 3 graduated, 4 aborted. entryFee, goal and totalPrincipal are FLASH wei. candidates[] has id, symbol, name, quoteToken, quoteClass, principal.",
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Pagination offset.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Up to 100.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "War page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "warId": {
                      "type": "string"
                    },
                    "state": {
                      "type": "object"
                    },
                    "candidates": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "nextOffset": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/launch-v2/wars/{warId}": {
      "get": {
        "operationId": "getWar",
        "summary": "A specific war",
        "description": "Same shape as the current war.",
        "parameters": [
          {
            "name": "warId",
            "in": "path",
            "required": true,
            "description": "War id.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "War page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/launch-v2/wars/{warId}/accounts/{address}": {
      "get": {
        "operationId": "getWarAccount",
        "summary": "A wallet in a war",
        "description": "positions[].principal is the FLASH value of the position in each contender; hasClaimed tells whether claim was used.",
        "parameters": [
          {
            "name": "warId",
            "in": "path",
            "required": true,
            "description": "War id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "description": "Wallet.",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "warId": {
                      "type": "string"
                    },
                    "totalPosition": {
                      "type": "string"
                    },
                    "hasClaimed": {
                      "type": "boolean"
                    },
                    "positions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "candidateId": {
                            "type": "integer"
                          },
                          "principal": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/launch-v2/wars/{warId}/activity": {
      "get": {
        "operationId": "getWarActivity",
        "summary": "War trades",
        "description": "Every boost and cash-out in the war.",
        "parameters": [
          {
            "name": "warId",
            "in": "path",
            "required": true,
            "description": "War id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Activity.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/launch-v2/claims": {
      "get": {
        "operationId": "getClaims",
        "summary": "Claimable rewards for a wallet",
        "description": "Claims across curves, wars and creator fees.",
        "parameters": [
          {
            "name": "account",
            "in": "query",
            "required": true,
            "description": "Wallet.",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Claims.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/launches": {
      "get": {
        "operationId": "listLaunches",
        "summary": "Graduated launches",
        "description": "Launched tokens with their Uniswap v4 pool: tokenAddress, quoteToken, uniswapFee, uniswapTickSpacing, poolId. The pool key is (token and quoteToken sorted ascending, uniswapFee, uniswapTickSpacing, hooks = /v1/config hook); keccak256(abi.encode(key)) equals poolId.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Up to 200.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "token",
            "in": "query",
            "required": false,
            "description": "Focus one token address.",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Launches.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "launches": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/tokens/prices": {
      "get": {
        "operationId": "getPrices",
        "summary": "USD prices",
        "description": "Map of lowercase token address to USD price for FLASH and launched tokens.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Prices.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "prices": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/markets/stocks": {
      "get": {
        "operationId": "getStocks",
        "summary": "Stock prices",
        "description": "Real-market and onchain USD price per ticker (for example NVDA).",
        "parameters": [
          {
            "name": "symbols",
            "in": "query",
            "required": true,
            "description": "Comma separated tickers.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stocks.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/wallet/{address}/balances": {
      "get": {
        "operationId": "getBalances",
        "summary": "Wallet token balances",
        "description": "ETH, FLASH, launched tokens and perps held.",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "description": "Wallet.",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Balances.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/bonding/positions": {
      "get": {
        "operationId": "getBondingPositions",
        "summary": "Wallet curve and war positions",
        "description": "Positions for kind launch or war.",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "description": "launch or war.",
            "schema": {
              "enum": [
                "launch",
                "war"
              ]
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": true,
            "description": "Wallet.",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Positions.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/uploads": {
      "post": {
        "operationId": "uploadTokenImage",
        "summary": "Upload and moderate a token image",
        "description": "multipart/form-data with the image in field image (png, jpg, webp or gif, up to 10 MB). Header x-flash-uploader: the creator wallet. The image is moderated, normalised and hosted; the response imageUrl is what prepare_launch and prepare_war_entry take. This writes data: do not call it with junk.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "image": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "image"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Uploaded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "imageUrl": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/launch-v2/prepare": {
      "post": {
        "operationId": "prepareLaunch",
        "summary": "Moderate a launch or war entry",
        "description": "Prefer the MCP tools prepare_launch and prepare_war_entry, which check pair approval and liquidity first. Header x-flash-uploader: creator wallet. Body: action (launch or war), name, symbol, mode, quoteClass, quoteToken, inputRouteId (flash), amountIn (wei string), description, imageUrl, twitterUrl, websiteUrl. Stores the approved profile against the wallet. Rate limited. When launchV4.active, a launch response also carries creation: { version: 4, router, method (createWithFlash / createWithEth / createWithToken), creationFeeFlash }.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Normalised identity (name, symbol, digest).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/launch-v2/input-plan": {
      "post": {
        "operationId": "launchInputPlan",
        "summary": "Signed ETH/USDC route quote for router V4",
        "description": "Prefer the MCP tool build_launch (payWith ETH or USDC), which calls this and encodes the router call. Only for launch V4 (launchV4.active). Header x-flash-uploader: the creator wallet. Body: action (launch-create, launch-buy, war-buy or war-register), routeId (an inputRoutes id other than flash), amountIn (wei string), subject (ticker or token). Returns adapter, routeData, minFlashOut, expectedFlashOut and deadline: put them in the RoutedCreateInput (launch, minFlashOut, minTokens, recipient, adapter, data) passed to createWithEth / createWithToken. launch-create is refused with V4_CUTOVER_NOT_ACTIVE before the cutover and with V4_CREATE_BELOW_CREATION_FEE when minFlashOut is below the live creation fee. The conversion is Uniswap v4 (Flash hook pool) only.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed input plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    }
  }
}
