{"openapi":"3.1.0","info":{"title":"On-Chain Activity Index","description":"Computes a 0-100 quantitative DeFi Protocol Activity Index from real, public DefiLlama data (TVL trend, fee/volume activity trend, chain diversification, scale). Pure descriptive metric -- not a trading signal or financial advice of any kind.","version":"1.0.0","contact":{"email":"dasaanrod@gmail.com"}},"paths":{"/activity-index":{"post":{"summary":"Activity Index Endpoint","description":"Computes a 0-100 quantitative DeFi Protocol Activity Index from real, public\nDefiLlama data. This is a descriptive metric of recent on-chain activity level --\nit is NOT a trading signal, price prediction, or financial recommendation of any\nkind, and must not be interpreted or represented as investment advice.\n\nComponents (see README.md 'Methodology' for the exact formulas): TVL trend (~7d),\nfee-generation activity trend, DEX-volume activity trend, chain diversification,\nand absolute scale. A protocol missing a component (e.g. no DEX volume for a\nnon-DEX protocol) has that component's weight redistributed across the components\nit does have -- see `coverage`/`components_evaluated`/`components_missing`.\n\nPayment (x402) is settled by PaymentMiddlewareASGI BEFORE this handler runs -- a\ncall is charged even if it returns a 404 (unknown protocol_slug) or 422 (no usable\ndata), same payment-before-validation disclosure as the sibling manual assets.","operationId":"activity_index_endpoint_activity_index_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityIndexRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityIndexResponse"}}}},"404":{"description":"protocol_slug not found on DefiLlama -- still charged, see below"},"422":{"description":"protocol_slug found but had no usable TVL/fee/volume data -- still charged"},"402":{"description":"Payment Required"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.30"},"protocols":[{"x402":{}}]}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Health Get"}}}}}}}},"components":{"schemas":{"ActivityIndexRequest":{"properties":{"protocol_slug":{"type":"string","maxLength":80,"minLength":1,"title":"Protocol Slug","description":"DefiLlama protocol slug, e.g. 'uniswap', 'aave', 'lido'. Find slugs at https://defillama.com/protocols."}},"type":"object","required":["protocol_slug"],"title":"ActivityIndexRequest"},"ActivityIndexResponse":{"properties":{"protocol_slug":{"type":"string","title":"Protocol Slug"},"protocol_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Protocol Name"},"activity_index":{"type":"number","title":"Activity Index","description":"0-100 composite quantitative index. A descriptive metric of recent on-chain activity level, NOT a trading signal, price prediction, or recommendation to buy/sell/hold."},"coverage":{"type":"number","title":"Coverage","description":"Fraction (0-1) of the 5 possible components that had usable data for this protocol -- lower coverage means the index rests on fewer computed inputs (e.g. a lending protocol typically has no DEX volume)."},"components":{"$ref":"#/components/schemas/ComponentScores"},"components_evaluated":{"items":{"type":"string"},"type":"array","title":"Components Evaluated","description":"Which of the 5 component keys (see ComponentScores) had usable data and contributed to activity_index."},"components_missing":{"items":{"type":"string"},"type":"array","title":"Components Missing","description":"Which of the 5 component keys had no usable data for this protocol -- their weight was redistributed across the components that did, not zero-filled."},"current_tvl_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Tvl Usd"},"evaluated_at":{"type":"string","title":"Evaluated At"}},"type":"object","required":["protocol_slug","activity_index","coverage","components","components_evaluated","components_missing","evaluated_at"],"title":"ActivityIndexResponse"},"ComponentScores":{"properties":{"tvl_trend":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tvl Trend","description":"~7-day TVL percent-change, saturated to [0,100]."},"scale":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Scale","description":"Absolute TVL, log-scaled to [0,100]."},"fee_activity_trend":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fee Activity Trend","description":"Recent vs. trailing-30d fee-generation rate, saturated to [0,100]."},"volume_activity_trend":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume Activity Trend","description":"Recent vs. trailing-30d DEX-volume rate, saturated to [0,100]. Null for non-DEX protocols."},"chain_diversification":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Chain Diversification","description":"Count of chains with real TVL, log-scaled to [0,100]."}},"type":"object","title":"ComponentScores","description":"Per-component 0-100 sub-scores (null if unavailable for this protocol).\nSee README.md 'Methodology' for the exact formula behind each. Typed as\nits own model (not a bare dict) so a buyer generating a client from\n/openapi.json gets the 5 keys and their types without reading prose --\nfound in buyer-experience review, 2026-08-22."}}}}