{"openapi":"3.1.0","info":{"title":"Blockflow Index API","version":"1.0.0","summary":"Ground-truth token prices for Alephium: mid price, executable depth and confidence.","description":"Prices for every token traded on Elexium, Ayin and Powfi, computed from the exact curve of each pool.\n\n**Everything about the current state of the chain is free and needs no key** — prices, depth, confidence, pools.\n**History needs a key**: it cannot be recomputed after the fact, so it is the part a key pays for.\n\nThree fields travel together and are meant to be read together:\n\n- `alph` — the depth-weighted mean of every pool's *mid* price (marginal, no fee, no slippage).\n- `depthAlph` — how much can actually be traded within a given price impact. **Not TVL**: for a concentrated-liquidity pool the two are unrelated.\n- `confidence` — depth x how closely the pools agree x how directly the token connects to ALPH.\n\nOn a chain where most markets are a few hundred ALPH deep, a price without its depth is misleading. That is why depth is a first-class field rather than an extra.\n\n## Licence and commercial use\n\n**Free for personal, research and evaluation use.** Use it, build against it, judge whether it is any good.\n\n**Commercial use requires a licence**, whether or not the endpoint you call needs a key. That includes wallets, exchanges, explorers, trading tools, dashboards and any product or service you charge for, run a business on, or redistribute the data through. The free tier exists so you can evaluate the data and so the ecosystem has a reference — not to underwrite a commercial product.\n\nA licence also gets you what an unkeyed caller cannot rely on: a rate limit sized for your traffic, an uptime commitment, the full hourly history, and notice before anything about the shape changes.\n\nRedistributing or reselling the data, or using it to build a competing index, needs written permission in every case.\n\nGet in touch and we will keep it proportionate — a small integration is not priced like an exchange.","contact":{"name":"Blockflow Index","url":"https://blockflowindex.com"},"license":{"name":"Proprietary — commercial use requires a licence","url":"https://blockflowindex.com/docs#licence"},"x-commercial-use":"A licence is required for commercial use, including of the free endpoints."},"servers":[{"url":"https://blockflowindex.com/api/v1","description":"Production"}],"tags":[{"name":"Prices","description":"Free. The current state of the chain."},{"name":"History","description":"Requires an API key."},{"name":"Service","description":"Operational. Unversioned."}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"`Authorization: Bearer <key>`. A `?key=` query parameter is accepted too, for clients that cannot set headers.\n\nA key presented with an `Origin` header is refused unless that origin was allow-listed for it: a key used from client-side code is published on that page. Call from your server."}},"schemas":{"Token":{"type":"object","description":"One token's published price and the evidence behind it.","properties":{"id":{"type":"string","description":"64-hex token id. The canonical identifier; symbols are not unique."},"symbol":{"type":"string"},"name":{"type":"string"},"decimals":{"type":"integer"},"logoURI":{"type":"string","nullable":true},"listed":{"type":"boolean","description":"Present in the official Alephium token list. An unlisted token may use a familiar symbol."},"alph":{"type":"number","description":"Price in ALPH: the depth-weighted mean of every contributing pool's mid price."},"usd":{"type":"number","nullable":true,"description":"alph x the off-chain ALPH/USD rate. NULL when that rate is unavailable — never 0."},"hops":{"type":"integer","description":"Pools between this token and ALPH. 0 for ALPH itself."},"poolCount":{"type":"integer"},"depthAlph":{"type":"number","nullable":true,"description":"ALPH tradeable within 1% of the mid. NULL for ALPH, whose depth against itself is unbounded. This is NOT TVL: for a concentrated-liquidity pool the two are unrelated."},"depthAlphWide":{"type":"number","nullable":true,"description":"The same at 5%."},"depthUsd":{"type":"number","nullable":true},"dispersionBps":{"type":"number","description":"How far the contributing pools disagree, in basis points. High means the price is contested."},"confidence":{"type":"number","description":"depth x agreement x directness, each in [0,1]. See /docs."},"confidenceParts":{"type":"object","properties":{"depth":{"type":"number"},"dispersion":{"type":"number"},"hops":{"type":"number"}}},"observations":{"type":"array","description":"Each pool's implied price and the weight it carried.","items":{"type":"object","properties":{"pairAddress":{"type":"string"},"dex":{"type":"string"},"viaTokenId":{"type":"string"},"viaSymbol":{"type":"string"},"alphPerToken":{"type":"number"},"weightAlph":{"type":"number"},"deviationBps":{"type":"number"}}}}},"required":["id","symbol","alph","confidence"]},"Pool":{"type":"object","properties":{"pairAddress":{"type":"string"},"pairContractId":{"type":"string"},"dex":{"type":"string","enum":["elexium","ayin","powfi-clmm","powfi-cpmm","powfi-stake"]},"feeBps":{"type":"number"},"isStable":{"type":"boolean"},"token0Id":{"type":"string"},"token1Id":{"type":"string"},"mid":{"type":"number","description":"token1 per token0, decimal-adjusted."},"midMethod":{"type":"string","enum":["constant-product","solidly-stable","clmm-sqrt-price","stake-mint-rate"]},"oneWay":{"type":"boolean","description":"True for xALPH staking: a mint rate, not a two-sided market."},"depth0":{"type":"number"},"depth1":{"type":"number"},"depth0Wide":{"type":"number"},"depth1Wide":{"type":"number"},"curveLimited":{"type":"boolean","description":"The CLMM curve ran out before the impact cap; depth is a lower bound."},"depthAlph":{"type":"number","nullable":true}}}},"responses":{"Unauthorized":{"description":"No key, or an unknown key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"}},"required":["error"]}}}},"Forbidden":{"description":"Key disabled, or used from a browser origin that was not allow-listed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"}},"required":["error"]}}}},"RateLimited":{"description":"Rate limit or monthly quota exceeded. Unauthenticated callers get 60 requests per minute per IP.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"}},"required":["error"]}}}},"NotReady":{"description":"No snapshot has been built yet.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"}},"required":["error"]}}}}}},"paths":{"/tokens":{"get":{"tags":["Prices"],"summary":"Every priced token","description":"All tokens the index can price, deepest first.","parameters":[{"name":"minConfidence","in":"query","required":false,"schema":{"type":"number","minimum":0,"maximum":1},"description":"Return only tokens at or above this confidence. Most tokens on this chain score low, which is the market rather than a defect."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"builtAt":{"type":"string","format":"date-time"},"alphUsd":{"type":"number","nullable":true},"method":{"type":"object"},"tokens":{"type":"array","items":{"$ref":"#/components/schemas/Token"}}}}}}},"503":{"$ref":"#/components/responses/NotReady"}}}},"/token/{idOrSymbol}":{"get":{"tags":["Prices"],"summary":"One token, with every pool trading it","parameters":[{"name":"idOrSymbol","in":"path","required":true,"schema":{"type":"string"},"description":"The 64-hex token id, or its symbol. Prefer the id: symbols are not unique on this chain.","example":"USDTeth"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"builtAt":{"type":"string","format":"date-time"},"alphUsd":{"type":"number","nullable":true},"token":{"$ref":"#/components/schemas/Token"},"pools":{"type":"array","items":{"$ref":"#/components/schemas/Pool"}}}}}}},"404":{"description":"Unknown token, or a token that is deliberately not priced (the reason is included).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"}},"required":["error"]}}}}}}},"/pools":{"get":{"tags":["Prices"],"summary":"Every pool, with its mid price and depth","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"builtAt":{"type":"string","format":"date-time"},"venues":{"type":"array","items":{"type":"object"}},"pools":{"type":"array","items":{"$ref":"#/components/schemas/Pool"}}}}}}}}}},"/meta":{"get":{"tags":["Prices"],"summary":"Snapshot metadata, rates and method parameters","description":"Includes `alphUsd` (off-chain market rate) beside `alphUsdOnChain` (what this chain's own dollar-pegged pools imply). They are published separately on purpose: when they diverge, bridged stables here are trading off peg, and averaging that away would hide it.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/unpriced":{"get":{"tags":["Prices"],"summary":"Tokens deliberately not priced, and why","description":"A token whose decimals cannot be established is omitted rather than guessed at: a price without them is wrong by a factor of 10^n.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/history/{idOrSymbol}":{"get":{"tags":["History"],"summary":"One token's recorded price history","security":[{"bearerAuth":[]}],"description":"Recorded once per UTC hour. Points are downsampled to `points`, keeping the first and last.\n\nALPH is the exception: its price against itself is 1 by definition, so this returns its **dollar** price and says so in `unit`.","parameters":[{"name":"idOrSymbol","in":"path","required":true,"schema":{"type":"string"},"example":"USDTeth"},{"name":"range","in":"query","schema":{"type":"string","enum":["24h","7d","30d","90d","1y","all"],"default":"7d"}},{"name":"points","in":"query","schema":{"type":"integer","default":300,"maximum":2000},"description":"Maximum points returned. A chart cannot render more than its pixel width."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"symbol":{"type":"string"},"range":{"type":"string"},"unit":{"type":"string","enum":["ALPH","USD"],"description":"What the price column is denominated in. USD for ALPH itself."},"fields":{"type":"array","items":{"type":"string"},"example":["t","alph","depthAlph","confidence"]},"points":{"type":"array","description":"[unixSeconds, price, depthAlph, confidence]. depth and confidence are null where they have no finite value.","items":{"type":"array","items":{"type":"number","nullable":true}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/sparklines":{"get":{"tags":["History"],"summary":"Recent prices for every token, in one request","security":[{"bearerAuth":[]}],"description":"One request rather than one per token. This is history, so it needs a key.","parameters":[{"name":"hours","in":"query","schema":{"type":"integer","default":24,"maximum":2160}},{"name":"points","in":"query","schema":{"type":"integer","default":24,"maximum":2000}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"builtAt":{"type":"string","format":"date-time"},"hours":{"type":"integer"},"series":{"type":"object","additionalProperties":{"type":"object","properties":{"p":{"type":"array","items":{"type":"number"}},"changePct":{"type":"number","nullable":true}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/history/export":{"get":{"tags":["History"],"summary":"The whole record, streamed as JSONL","security":[{"bearerAuth":[]}],"description":"One line per UTC hour, with full token ids, so the file stands alone.","responses":{"200":{"description":"OK","content":{"application/x-ndjson":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}