pigi.finance Protocols API

The protocols API from pigi.finance — 2 operation(s) for protocols.

GitHub OpenAPI

Operations 2

GET /protocols Cumulative protocol rating for every rated protocol node #
GET /protocols/{node_id} Cumulative protocol rating for one protocol node, with its vault contributions #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/pigi-finance:pigi-finance-protocols-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

pigi-finance-protocols-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: pigi.finance Vault Intelligence Protocols API
  version: 1.0.0
  description: 'Programmatic access to pigi.finance DeFi vault data: APR, APY, TVL (with 30-day moving averages) across daily and weekly/monthly/quarterly/yearly windows, plus holder counts, vault risk ratings, cumulative protocol ratings and DeFi/T-Bill reference rates. Authenticate by exchanging your API key for a short-lived JWT, then send `Authorization: Bearer ` on every request.


    RISK BANDS ARE NOT CREDIT RATINGS. A pigi risk band (`band`, `risk_band`) and its 0-100 score are a relative assessment of the risk of loss to a depositor''s position in a DeFi vault, compared across the vaults pigi tracks; a protocol band applies the same scale to a protocol as a dependency of the vaults that deposit into it. They are not credit ratings issued in accordance with Regulation (EC) No 1060/2009 on credit rating agencies, and pigi is not a registered or certified credit rating agency in the EU, the UK or anywhere else. A band does not address the ability or willingness of any person, protocol or issuer to meet payment or other financial obligations, and is not an opinion on the creditworthiness of any entity, debt or financial instrument. Fields carry the bare letter ("A" .. "F"); pigi displays bands with the (rb) suffix, e.g. B(rb). Nothing in this API is financial advice. Methodology: https://app.pigi.finance/risk


    PLANS (free / pro / custom — https://pigi.finance/defi-api). Every plan gets every rate, TVL and window figure, the holder COUNT (`Vault.holders`), Basic risk (`/vaults/{id}/risk`: band, score, history, floors) and the protocol ratings (`/protocols`, `/protocols/{node_id}`: score, band, node rating, vault contributions). Pro adds the holder LIST (`/vaults/{id}/holders`, with its concentration block) and the holder-analytics fields on `Vault` (`deposit_count`, `active_addresses_30d`, `tvl_concentration_top10pct`). Custom adds the `full` risk decomposition and the protocol `rubric`. A gated FIELD is served as null and named in a top-level `plan_required` object (`{ "": "" }`); a gated ENDPOINT answers 403 `{ "error": "plan_required", "required": "" }`. A null with no marker is a real null (not indexed yet, vault not assessed). Gated elements below carry `x-plan`.'
servers:
- url: https://pigi.finance/api/v1
security:
- bearerAuth: []
tags:
- name: Protocols
paths:
  /protocols:
    get:
      tags:
      - Protocols
      summary: Cumulative protocol rating for every rated protocol node
      description: 'pigi rates vaults, and rates protocols as the dependency NODES that cap the vaults depositing into them. This endpoint publishes ONE cumulative figure per protocol node: `score = 0.6 × the node''s own rating + 0.4 × the TVL-weighted mean (tvl_30d_ma share) of the latest published score of every rated vault that deposits into it`. The weights are pigi''s published formula (echoed in `formula`) and are not adjustable by the caller, so the number can be carried verbatim as pigi''s own. With no rated vault the node rating stands alone (`applied.k1 = 1`). The band comes straight from the methodology thresholds, without the dwell rule that smooths vault bands. One call covers every node and costs one request; per-vault contributions are on `/protocols/{node_id}`. `date` is the last date the number could have changed (max of the node''s rating date and the newest vault row).'
      parameters:
      - name: chain_id
        in: query
        schema:
          type: integer
        description: Count only the depositing vaults on this chain (e.g. 1 = Ethereum). Narrows the vault set only — the node term is unchanged.
      responses:
        '200':
          description: Every rated protocol node, sorted by node_id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProtocolList'
        '400':
          description: invalid_parameter
        '503':
          description: risk_unavailable — the risk database could not be reached; retry
      operationId: getProtocols
      x-operation-id-source: derived
  /protocols/{node_id}:
    get:
      tags:
      - Protocols
      summary: Cumulative protocol rating for one protocol node, with its vault contributions
      description: 'The same figure as `/protocols` for one node (e.g. `aave-v3-ethereum`, `euler-v2`, `morpho-blue-ethereum`, `metamorpho-v1-1`, `sparklend`, `uniswap-v3` — the ids are listed by `/protocols`), plus `vaults.items`: every rated vault that counted, with its published score and band, TVL and the share of the vault term it carried. A vault counts when its latest published row deposits into the node, is at most `formula.vault_max_age_days` old and the vault is still listed; a Morpho vault deposits into two protocol nodes (the framework and the Blue instance) and counts toward each. CUSTOM additionally gets `rubric`: the node''s own rubric lines (audit & bounty, admin authority, pause authority, operational history, scale) with the rung and points on each. Below Custom, `rubric` is null and `plan_required` is `{ "rubric": "custom" }`. A node that is not rated as a protocol answers 404.'
      parameters:
      - name: node_id
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-z0-9][a-z0-9-]*$
        description: Protocol node id, as listed by /protocols.
      - name: chain_id
        in: query
        schema:
          type: integer
        description: Count only the depositing vaults on this chain. Narrows the vault set only.
      responses:
        '200':
          description: The rating
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProtocolRating'
        '400':
          description: invalid_id / invalid_parameter
        '404':
          description: not_found — no rated protocol node with that id
        '503':
          description: risk_unavailable — the risk database could not be reached; retry
      operationId: getProtocolsByNodeId
      x-operation-id-source: derived
components:
  schemas:
    ProtocolRating:
      type: object
      properties:
        node_id:
          type: string
        label:
          type:
          - string
          - 'null'
        assessed:
          type: boolean
          description: Always true on a 200 — an unrated node answers 404.
        score:
          type: number
          description: The cumulative score, 0-100, higher = safer.
        band:
          type: string
          description: A (safest) .. F, straight from the thresholds (no dwell). Not a credit rating.
        date:
          type: string
          description: Last date the number could have changed.
        chain_id:
          type:
          - integer
          - 'null'
          description: Echo of the filter; null = all chains.
        formula:
          $ref: '#/components/schemas/ProtocolFormula'
        applied:
          $ref: '#/components/schemas/ProtocolApplied'
        protocol:
          type: object
          properties:
            rating:
              type: number
            date:
              type: string
            methodology_version:
              type: string
            source:
              type: string
        vaults:
          type: object
          properties:
            rated_count:
              type: integer
            stale_excluded:
              type: integer
              description: Depositing vaults dropped because their latest published row is past vault_max_age_days.
            tvl_usd:
              type: number
            score_tvl_weighted:
              type:
              - number
              - 'null'
            score_mean:
              type:
              - number
              - 'null'
            score_min:
              type:
              - number
              - 'null'
            score_max:
              type:
              - number
              - 'null'
            latest_date:
              type:
              - string
              - 'null'
            bands:
              type: object
              description: Counted vaults per published band.
              properties:
                A:
                  type: integer
                B:
                  type: integer
                C:
                  type: integer
                D:
                  type: integer
                F:
                  type: integer
            chain_ids:
              type: array
              items:
                type: integer
            items:
              type: array
              description: Sorted by weight, descending.
              items:
                $ref: '#/components/schemas/ProtocolVaultItem'
        rubric:
          x-plan: custom
          allOf:
          - $ref: '#/components/schemas/ProtocolRubric'
          description: CUSTOM. The node's rubric lines; null below Custom (with plan_required).
        note:
          type: string
          description: Present only when no rated vault counted.
        plan_required:
          $ref: '#/components/schemas/PlanRequired'
    PlanRequired:
      type: object
      description: 'Present only when the caller''s plan withholds fields of this response: each key is a field that came back null for that reason, its value the plan that unlocks it.

        '
      additionalProperties:
        $ref: '#/components/schemas/Plan'
      example:
        deposit_count: pro
        active_addresses_30d: pro
        tvl_concentration_top10pct: pro
    ProtocolRubric:
      type: object
      description: CUSTOM. The node's own rubric lines, rebuilt from the published evidence; the analyst's justification prose is never included.
      properties:
        methodology_version:
          type: string
        subtype:
          type:
          - string
          - 'null'
        points:
          type: number
        max:
          type: number
        lines:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                description: audit_and_bounty, admin_authority, pause_authority, operational_history, scale_and_adoption.
              label:
                type:
                - string
                - 'null'
              position:
                type: string
                description: The rung taken, e.g. dao_timelock.
              points:
                type:
                - number
                - 'null'
              max:
                type: number
    ProtocolList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ProtocolListItem'
        count:
          type: integer
        chain_id:
          type:
          - integer
          - 'null'
          description: Echo of the filter; null = all chains.
        formula:
          $ref: '#/components/schemas/ProtocolFormula'
    Plan:
      type: string
      enum:
      - free
      - pro
      - custom
      description: The caller's plan. Unknown values in the account record read as free.
    ProtocolVaultItem:
      type: object
      properties:
        strategy_id:
          type: integer
        name:
          type: string
        chain_id:
          type: integer
        protocol_name:
          type: string
          description: The catalogue label the vault is filed under, e.g. Morpho.
        score:
          type: number
          description: The vault's published score.
        band:
          type: string
          description: The vault's published (dwell-smoothed) band.
        date:
          type: string
          description: Date of the vault's latest published row.
        tvl_usd:
          type:
          - number
          - 'null'
          description: tvl_30d_ma; a null carries weight 0.
        weight:
          type: number
          description: Share of the vault term this vault carried (TVL share, or 1/n under mean).
        critical:
          type: boolean
          description: DEPOSITS_INTO is a critical edge under the methodology.
        cap_binding:
          type: boolean
          description: This node's rating is what capped the vault's score on its latest row.
    ProtocolFormula:
      type: object
      description: pigi's published formula behind every protocol score — fixed, never caller-adjustable.
      properties:
        k1:
          type: number
          description: Weight of the node's own rating (0.6).
        k2:
          type: number
          description: Weight of the vault term (0.4).
        vault_aggregation:
          type: string
          enum:
          - tvl_weighted_mean
          description: 'How the vault term is aggregated: mean of the vaults'' published scores weighted by tvl_30d_ma.'
        vault_max_age_days:
          type: integer
          description: A vault whose latest published row is older than this is not counted (7).
        bands:
          type: array
          description: Band thresholds under the active methodology, e.g. [["A",85],["B",70],...].
          items:
            type: array
            items: {}
            minItems: 2
            maxItems: 2
        note:
          type: string
          description: The formula and its caveats, in prose — quote it when republishing the number.
    ProtocolListItem:
      type: object
      properties:
        node_id:
          type: string
          description: Protocol node id, e.g. aave-v3-ethereum.
        label:
          type:
          - string
          - 'null'
        score:
          type: number
          description: The cumulative score, 0-100, higher = safer.
        band:
          type: string
          description: A (safest) .. F, straight from the thresholds (no dwell). Not a credit rating.
        date:
          type: string
          description: 'Last date the number could have changed: max(protocol.date, newest vault row).'
        applied:
          $ref: '#/components/schemas/ProtocolApplied'
        protocol:
          type: object
          properties:
            rating:
              type: number
              description: The node's own rating, 0-100.
            date:
              type: string
              description: The analyst's as-of date of that rating.
        vaults:
          type: object
          properties:
            rated_count:
              type: integer
            tvl_usd:
              type: number
              description: Sum of tvl_30d_ma over the counted vaults.
            score_tvl_weighted:
              type:
              - number
              - 'null'
            score_mean:
              type:
              - number
              - 'null'
    ProtocolApplied:
      type: object
      description: What actually entered THIS number.
      properties:
        k1:
          type: number
          description: 0.6, or 1 when no rated vault deposits into the node.
        k2:
          type: number
          description: 0.4, or 0 when no rated vault deposits into the node.
        vault_aggregation:
          type: string
          enum:
          - tvl_weighted_mean
          - mean
          - none
          description: tvl_weighted_mean; mean when no counted vault carries a TVL; none when no vault counted.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT