{
  "openapi": "3.1.0",
  "info": {
    "title": "ElonPad preview API",
    "version": "1.0.0",
    "description": "ElonPad chain-backed launchpad APIs. New launches pair with TSLAx (8 decimals); targets 1/2.5/5/10 TSLAx. Legacy SOL records remain compatible. Wallet signing follows simulation and explicit review. Educational quote endpoints remain simulations."
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "paths": {
    "/api/v1": {
      "get": {
        "operationId": "getPreviewCapabilities",
        "description": "Discover this preview and its read-only API.",
        "responses": {
          "200": {
            "description": "Simulation-only JSON. Does not execute a trade.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/curves": {
      "get": {
        "operationId": "getPreviewCurves",
        "description": "Get sample points for the four SOL curves.",
        "responses": {
          "200": {
            "description": "Simulation-only JSON. Does not execute a trade.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/coins": {
      "get": {
        "operationId": "getSampleCoins",
        "description": "Get demonstration coins. These are not Solana mints.",
        "responses": {
          "200": {
            "description": "Simulation-only JSON. Does not execute a trade.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/quote": {
      "get": {
        "operationId": "quoteSimulatedTrade",
        "description": "Calculate a simulated buy or sell with a 1% fee. Never signs or submits a transaction.",
        "parameters": [
          {
            "name": "target",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "enum": [
                10,
                25,
                50,
                100
              ]
            },
            "description": "Graduation target in SOL."
          },
          {
            "name": "raised",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "minimum": 0
            },
            "description": "SOL already raised in the simulation."
          },
          {
            "name": "side",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "buy",
                "sell"
              ],
              "default": "buy"
            },
            "description": "Trade direction."
          },
          {
            "name": "amount",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "description": "SOL for buys; token amount for sells."
          }
        ],
        "responses": {
          "200": {
            "description": "Simulation-only JSON. Does not execute a trade.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or insufficient curve capacity.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/status": {
      "get": {
        "operationId": "getMainnetStatus",
        "summary": "Mainnet RPC/storage status. Does not certify wallet-signed tests.",
        "responses": {
          "200": {
            "description": "Mainnet RPC/storage status. Does not certify wallet-signed tests.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "503": {
            "description": "Mainnet service unavailable"
          }
        },
        "description": "Mainnet RPC/storage status. Does not certify wallet-signed tests."
      }
    },
    "/api/coins": {
      "get": {
        "operationId": "getMainnetCoins",
        "summary": "Shared on-chain-verified Solana mainnet-beta coin registry.",
        "responses": {
          "200": {
            "description": "Shared on-chain-verified Solana mainnet-beta coin registry.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "503": {
            "description": "Mainnet service unavailable"
          }
        },
        "description": "Shared on-chain-verified Solana mainnet-beta coin registry."
      }
    },
    "/api/activity": {
      "get": {
        "operationId": "getMainnetPoolActivity",
        "description": "Finalized authenticated DBC/DAMM swap events with immutable backup and a Neon trade index. Database archive reads use chronological keyset pagination without RPC; volume covers loaded trades only.",
        "parameters": [
          {
            "name": "mint",
            "in": "query",
            "required": true,
            "description": "Registered Solana mainnet-beta token mint.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "venue",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "curve",
                "damm"
              ],
              "default": "curve"
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "Live next cursor from the preceding page; only with source=live.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "live",
                "archive"
              ],
              "default": "live"
            },
            "description": "Live reads finalized onchain pages and saves them; archive reads saved records without RPC."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2000
            },
            "description": "Opaque archive_next cursor; only with source=archive. Neon pages are chronological; Blob-only fallback pages use storage order."
          }
        ],
        "responses": {
          "200": {
            "description": "Finalized authenticated DBC/DAMM swap events with immutable backup and a Neon trade index. Database archive reads use chronological keyset pagination without RPC; volume covers loaded trades only.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "cluster": {
                      "const": "mainnet-beta"
                    },
                    "simulation": {
                      "const": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or mainnet-beta lookup failed"
          },
          "405": {
            "description": "Use GET"
          },
          "503": {
            "description": "RPC/storage unavailable; no saved trade fallback available."
          }
        }
      }
    },
    "/api/graduation": {
      "get": {
        "operationId": "getMainnetGraduation",
        "description": "Exact on-chain graduation readiness and successor DAMM pool. Read-only; no automated signing.",
        "parameters": [
          {
            "name": "mint",
            "in": "query",
            "required": true,
            "description": "Registered Solana mainnet-beta token mint.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Exact on-chain graduation readiness and successor DAMM pool. Read-only; no automated signing.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "cluster": {
                      "const": "mainnet-beta"
                    },
                    "simulation": {
                      "const": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or mainnet-beta lookup failed"
          },
          "405": {
            "description": "Use GET"
          }
        }
      }
    },
    "/api/index-status": {
      "get": {
        "operationId": "getMainnetIndexStatus",
        "description": "Mainnet-only persisted trade indexing; never signs. Status exposes public checkpoints; POST processes a bounded registered mint/venue page.",
        "responses": {
          "200": {
            "description": "Mainnet index result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid index request"
          },
          "503": {
            "description": "Database unavailable"
          }
        }
      }
    },
    "/api/index-activity": {
      "post": {
        "operationId": "indexMainnetActivityPage",
        "description": "Mainnet-only persisted trade indexing; never signs. Status exposes public checkpoints; POST processes a bounded registered mint/venue page.",
        "responses": {
          "200": {
            "description": "Mainnet index result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid index request"
          },
          "503": {
            "description": "Database unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "mint"
                ],
                "properties": {
                  "mint": {
                    "type": "string"
                  },
                  "venue": {
                    "type": "string",
                    "enum": [
                      "curve",
                      "damm"
                    ],
                    "default": "curve"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/assets/tslax": {
      "get": {
        "summary": "Read-only validated TSLAx mainnet mint state; does not enable trading",
        "responses": {
          "200": {
            "description": "Token-2022 mint facts and disabled pairing status"
          },
          "503": {
            "description": "Asset lookup unavailable"
          }
        },
        "description": "Read-only validated TSLAx mainnet mint state; does not enable trading",
        "operationId": "getTeslaAssetFacts"
      }
    },
    "/api/v1/features": {
      "get": {
        "summary": "Actual ecosystem feature status",
        "responses": {
          "200": {
            "description": "Implemented, proposed and unavailable capabilities"
          }
        },
        "description": "Actual ecosystem feature status",
        "operationId": "getEcosystemFeatures"
      }
    },
    "/api/burns": {
      "get": {
        "operationId": "getBurnHistoryStatus",
        "summary": "Burn history and configuration status",
        "description": "Returns an explicit unconfigured status and no fabricated transactions. No burn scanner or buyback execution is active.",
        "responses": {
          "200": {
            "description": "Unconfigured native mint/keeper status"
          }
        }
      }
    },
    "/api/files/{path}": {
      "get": {
        "operationId": "getPublicMetadataObject",
        "summary": "Read immutable public mainnet-beta metadata or images",
        "description": "Reads validated metadata and assets from the Neon public object store. Registry, nonce and private database objects are not exposed by this route.",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Immutable public asset"
          },
          "404": {
            "description": "Not found"
          },
          "503": {
            "description": "Storage unavailable"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "required": [
          "title",
          "status",
          "code",
          "detail",
          "resolution"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "code": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "resolution": {
            "type": "string"
          }
        }
      },
      "SimulationResponse": {
        "type": "object",
        "required": [
          "simulation",
          "live"
        ],
        "properties": {
          "simulation": {
            "const": true
          },
          "live": {
            "const": false
          }
        },
        "additionalProperties": true
      }
    }
  }
}
