Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: pigi.finance Vault Intelligence Vaults 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: Vaults
paths:
/vaults:
get:
tags:
- Vaults
summary: List vaults
parameters:
- name: protocol_name
in: query
schema:
type: string
- name: chain_id
in: query
schema:
type: string
- name: strategy_id
in: query
schema:
type: string
- name: tvl_filter
in: query
schema:
type: string
enum:
- gte_1m
- gte_2m
- gte_5m
- gte_10m
- non_na
- na
- name: apr_filter
in: query
schema:
type: string
enum:
- lte_10
- gt_5
- gt_10
- gt_15
- gt_20
- non_na
- na
- name: age_filter
in: query
schema:
type: string
enum:
- new
- 3mo
- 6mo
- 12mo
- 18mo
- 24mo
- non_na
- na
- name: limit
in: query
schema:
type: integer
default: 100
maximum: 1000
- name: offset
in: query
schema:
type: integer
default: 0
responses:
'200':
description: A page of vaults
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Vault'
pagination:
type: object
properties:
total:
type: integer
limit:
type: integer
offset:
type: integer
hasMore:
type: boolean
availableFilters:
type: object
properties:
protocol_names:
type: array
items:
type: string
chain_ids:
type: object
additionalProperties:
type: array
items:
type: integer
all_chain_ids:
type: array
items:
type: integer
plan_required:
$ref: '#/components/schemas/PlanRequired'
'401':
description: invalid_token
operationId: getVaults
x-operation-id-source: derived
/vaults/{id}:
get:
tags:
- Vaults
summary: Get a single vault by pool id
parameters:
- name: id
in: path
required: true
schema:
type: integer
responses:
'200':
description: The vault
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/Vault'
plan_required:
$ref: '#/components/schemas/PlanRequired'
'404':
description: not_found
operationId: getVaultsById
x-operation-id-source: derived
/vaults/{id}/history:
get:
tags:
- Vaults
summary: Daily time-series for a vault (by strategy id)
parameters:
- name: id
in: path
required: true
schema:
type: integer
description: strategy id
- name: range
in: query
schema:
type: string
enum:
- 7D
- 30D
- 90D
- 180D
default: 7D
responses:
'200':
description: Time-series + latest values
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
timestamp:
type: string
tvl:
type: number
apr:
type: number
apy:
type: number
ra_apr:
type:
- number
- 'null'
description: 'risk-adjusted APR: apr minus a penalty derived from the vault''s published overall risk score (0-100, higher = safer; piecewise-linear); null when the vault has no published assessment'
tvl_30d_ma:
type: number
apr_30d_ma:
type: number
apy_30d_ma:
type: number
lastTvl:
type: number
lastApr:
type: number
lastApy:
type: number
lastRaApr:
type:
- number
- 'null'
lastTvl30dMa:
type: number
lastApr30dMa:
type: number
lastApy30dMa:
type: number
lastRaApr30dMa:
type:
- number
- 'null'
operationId: getVaultsByIdHistory
x-operation-id-source: derived
/vaults/{id}/stats:
get:
tags:
- Vaults
summary: Windowed stats for a vault (by strategy id)
parameters:
- name: id
in: path
required: true
schema:
type: integer
description: strategy id
- name: period
in: query
schema:
type: string
enum:
- weekly
- monthly
- quarterly
- yearly
- lifetime
responses:
'200':
description: Windowed stats (all windows if period omitted)
content:
application/json:
schema:
type: object
properties:
weekly:
$ref: '#/components/schemas/PeriodStats'
monthly:
$ref: '#/components/schemas/PeriodStats'
quarterly:
$ref: '#/components/schemas/PeriodStats'
yearly:
$ref: '#/components/schemas/PeriodStats'
lifetime:
$ref: '#/components/schemas/PeriodStats'
operationId: getVaultsByIdStats
x-operation-id-source: derived
/vaults/{id}/holders:
get:
tags:
- Vaults
summary: Holder list for a vault (by strategy id) — Pro plan
x-plan: pro
description: 'PRO PLAN. The vault''s holder list, ranked by share-token balance, with each address''s share of the total and the cumulative share down the ranking, plus `meta.concentration`. A Free client receives 403 plan_required. (Vault.holders exposes the holder count on every plan.) The list is replayed from on-chain transfers by pigi''s holders scan: a vault not yet scanned with per-address storage returns `data: []` with `meta.scan: null` — not scanned, not zero holders. Every scan is checked against the vault''s own totalSupply(); one that does not add up returns `meta.scan.status: "inconsistent"` with `data: []` and null `meta.holders` / `meta.concentration` until a later scan passes. The vault''s own address is never listed. `balance` is in raw share-token units and loses precision above 2^53; read the shares. Above 20,000 holders the total is not walked: `share_pct` is null and `meta.total_known` is false.'
parameters:
- name: id
in: path
required: true
schema:
type: integer
description: strategy id
- name: limit
in: query
schema:
type: integer
default: 100
maximum: 500
- name: offset
in: query
schema:
type: integer
default: 0
responses:
'200':
description: One page of the holder list
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Holder'
meta:
allOf:
- $ref: '#/components/schemas/HolderListMeta'
- type: object
properties:
concentration:
allOf:
- $ref: '#/components/schemas/Concentration'
description: The map's concentration at the scan's block; null until the vault's next scan writes it.
'403':
description: plan_required (Free plan)
content:
application/json:
schema:
$ref: '#/components/schemas/PlanRequiredError'
operationId: getVaultsByIdHolders
x-operation-id-source: derived
/vaults/{id}/risk:
get:
tags:
- Vaults
summary: Published risk assessment for a vault (by strategy id)
description: 'pigi''s published risk assessment, a relative risk-of-loss band and score, not a credit rating (see the API description). Every plan gets the Basic block — band, overall score (0-100, higher = safer), their date-keyed history over `range`, the band thresholds under the current methodology, event markers, and any binding hard floor (the standing warning, e.g. "redemption blocked"). CUSTOM additionally gets `full`: the structural rosette with its ladder rungs and precedents, the quantitative anchor inputs, the dependency cap (edges, min, slack, binding), overlays, floors with their cap arithmetic, the blend and the final computation, plus the per-day anchor / rosette / cap series. Below Custom, `full` is null and `plan_required` is `{ "full": "custom" }`. `assessed: false` means the vault has no published assessment (most vaults).'
parameters:
- name: id
in: path
required: true
schema:
type: integer
description: strategy id
- name: range
in: query
schema:
type: string
enum:
- 7D
- 30D
- 90D
- 180D
- 365D
- ALL
default: 90D
responses:
'200':
description: The assessment
content:
application/json:
schema:
$ref: '#/components/schemas/VaultRisk'
'400':
description: invalid_id / invalid_parameter
'503':
description: risk_unavailable — the risk database could not be reached; retry
operationId: getVaultsByIdRisk
x-operation-id-source: derived
components:
schemas:
VaultRisk:
type: object
properties:
strategy_id:
type: integer
assessed:
type: boolean
description: false = no published assessment; the other fields are then null / empty.
band:
type:
- string
- 'null'
description: A (safest) .. F, displayed by pigi as A(rb) .. F(rb). Not a credit rating.
score:
type:
- number
- 'null'
description: 0-100, higher = safer.
date:
type:
- string
- 'null'
description: Date of the latest published row.
methodology_version:
type:
- string
- 'null'
bands:
type: array
description: Band thresholds under the current methodology, e.g. [["A",85],["B",70],...].
items:
type: array
items: {}
minItems: 2
maxItems: 2
floors:
type: array
description: Binding hard floors on the latest row — the standing warning strip.
items:
type: object
properties:
key:
type: string
label:
type: string
range:
type: string
from:
type:
- string
- 'null'
to:
type:
- string
- 'null'
history:
type: array
items:
type: object
properties:
date:
type: string
band:
type:
- string
- 'null'
score:
type:
- number
- 'null'
methodology_version:
type: string
event_flags:
type: array
items:
type: string
events:
type: array
items:
type: object
properties:
date:
type: string
event_type:
type: string
enum:
- methodology_update
- overlay
- hard_floor
- band_transition
- contagion_flag
title:
type: string
is_global:
type: boolean
full:
x-plan: custom
allOf:
- $ref: '#/components/schemas/RiskFull'
description: CUSTOM. The decomposition; null below Custom (with plan_required).
plan_required:
$ref: '#/components/schemas/PlanRequired'
PlanRequiredError:
type: object
properties:
error:
type: string
enum:
- plan_required
required:
$ref: '#/components/schemas/Plan'
RiskFull:
type: object
description: The full decomposition behind the score, rebuilt from the published vector.
properties:
methodology_version:
type: string
raw_band:
type:
- string
- 'null'
description: Band the score sits in before dwell; may differ from the published band.
blend:
type: object
properties:
rosette_weight:
type: number
anchor_weight:
type: number
rosette:
type: object
properties:
score:
type:
- number
- 'null'
dimensions:
type: array
items:
type: object
properties:
key:
type: string
label:
type: string
weight:
type: number
score:
type: number
points:
type: number
max:
type: number
subscores:
type: array
items:
type: object
properties:
key:
type: string
label:
type: string
position:
type:
- string
- 'null'
points:
type:
- number
- 'null'
max:
type:
- number
- 'null'
applicable:
type: boolean
precedent:
type:
- string
- 'null'
anchor:
type: object
properties:
score:
type:
- number
- 'null'
points:
type:
- number
- 'null'
max:
type:
- number
- 'null'
inputs:
type: array
items:
type: object
properties:
key:
type: string
label:
type: string
value:
type:
- number
- 'null'
unit:
type:
- string
- 'null'
band:
type: string
points:
type: number
max:
type: number
dependency_cap:
type: object
properties:
cap:
type:
- number
- 'null'
binding:
type: boolean
critical_dep_min:
type:
- number
- 'null'
slack:
type:
- number
- 'null'
critical_edges:
type: array
items:
type: string
edges:
type: array
items:
type: object
properties:
type:
type: string
node_id:
type: string
label:
type:
- string
- 'null'
node_type:
type:
- string
- 'null'
critical:
type: boolean
rated:
type: boolean
rating:
type:
- number
- 'null'
unrated_reason:
type:
- string
- 'null'
overlays:
type: object
properties:
clamp:
type:
- number
- 'null'
net:
type: number
applied:
type: array
items:
type: object
properties:
key:
type: string
delta:
type: number
reason:
type:
- string
- 'null'
expires:
type:
- string
- 'null'
floors:
type: array
items:
type: object
properties:
key:
type: string
label:
type: string
cap:
type:
- number
- 'null'
applied_cap:
type:
- number
- 'null'
binding:
type: boolean
computation:
type: object
properties:
s_raw:
type:
- number
- 'null'
overlays_net:
type:
- number
- 'null'
cap_applied:
type:
- number
- 'null'
final:
type:
- number
- 'null'
history:
type: array
description: Per-day private series over the same window as the Basic history.
items:
type: object
properties:
date:
type: string
anchor_score:
type:
- number
- 'null'
rosette_score:
type:
- number
- 'null'
dependency_cap:
type:
- number
- 'null'
HolderListMeta:
type: object
properties:
strategy_id:
type: integer
holders:
type:
- integer
- 'null'
description: Holder count; null when the vault has never been scanned with the store, or its scan failed verification.
total_balance:
type:
- number
- 'null'
total_known:
type: boolean
page:
type: object
properties:
limit:
type: integer
offset:
type: integer
total_rows:
type:
- integer
- 'null'
scan:
type:
- object
- 'null'
description: The scan checkpoint the list is consistent with; null = not scanned yet.
properties:
status:
type: string
enum:
- running
- completed
- failed
- inconsistent
description: completed = the list reconciles with the vault's totalSupply(); running / failed = a scan in progress or interrupted, the list may be partial; inconsistent = the scan did not reconcile, no list is served.
last_committed_block:
type: integer
full_scan_at:
type:
- string
- 'null'
updated_at:
type: string
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
Holder:
type: object
properties:
rank:
type: integer
description: 1-based position by balance, descending.
address:
type: string
balance:
type: number
description: Raw share-token units; loses precision above 2^53.
share_pct:
type:
- number
- 'null'
description: This address's share of all positive balances, %. null when the total is not known.
cumulative_pct:
type:
- number
- 'null'
description: Share of this address and every address ranked above it, %.
Concentration:
type: object
description: Holder concentration of the vault's share-token map, computed by the scanner at the block the scan completed. Shares are fractions in [0, 1].
properties:
block_number:
type: integer
computed_at:
type: string
holders:
type: integer
description: Addresses with a positive balance.
total_balance:
type: number
description: Sum of positive balances, raw share-token units (loses precision above 2^53).
decimals:
type:
- integer
- 'null'
description: Share-token decimals; null for Uniswap liquidity or when unreadable.
top1_share:
type: number
description: Share held by the largest address.
top5_share:
type: number
top10_share:
type: number
hhi:
type: number
description: Herfindahl-Hirschman index, sum of squared shares; 1 = a single holder.
gini:
type: number
description: Gini coefficient of positive balances; 0 = all holders equal.
holders_gt_1pct:
type: integer
description: Addresses holding more than 1% of the total.
deposit_events:
type: integer
description: Deposit events over the indexed life — the same figure as Vault.deposit_count.
active_addresses_30d:
type:
- integer
- 'null'
description: Distinct depositors in the trailing 30 days — the same figure as Vault.active_addresses_30d.
window_start_block:
type:
- integer
- 'null'
description: First block of that 30-day window.
Vault:
type: object
properties:
id:
type: integer
strategy_id:
type: integer
protocol_name:
type: string
chain_id:
type: integer
pool_name:
type: string
pool_address:
type: string
asset_address:
type:
- string
- 'null'
type:
type: string
tvl_30d_ma:
type:
- number
- 'null'
apr_30d_ma:
type:
- number
- 'null'
display_name:
type:
- string
- 'null'
description: pool_name plus the minimum qualifier (chain · symbol · framework) that makes it unique. Prefer this for display; null until the row's first nightly.
holders:
type:
- integer
- 'null'
description: Holder count. Every plan. null while the vault's last holders scan failed verification.
pool_creation_date:
type:
- string
- 'null'
updated_at:
type:
- string
- 'null'
tvl_flow_1d:
type:
- number
- 'null'
tvl_flow_7d:
type:
- number
- 'null'
apr_trend_1d:
type:
- number
- 'null'
risk_band:
type:
- string
- 'null'
description: 'Published pigi-risk band: A (safest) .. F, displayed by pigi as A(rb) .. F(rb). A relative risk-of-loss assessment, not a credit rating. null when the vault has not been assessed yet.'
risk_score:
type:
- number
- 'null'
description: Published overall risk score, 0-100 (higher = safer). null when unassessed.
active_addresses_30d:
type:
- integer
- 'null'
x-plan: pro
description: 'PRO. Distinct depositors in the trailing 30 days ending at the last scan: owner addresses on ERC-4626 Deposit logs (Morpho, Euler, Yearn); for Uniswap V3 the current owners of positions minted inside the window. null + plan_required on Free; null with no marker until the vault has been scanned (Aave reserves are not scanned).'
deposit_count:
type:
- integer
- 'null'
x-plan: pro
description: 'PRO. Deposit events over the vault''s indexed life: ERC-4626 Deposit logs (Morpho, Euler, Yearn, generic 4626), pool Mint logs for Uniswap V3; withdrawals are not counted. null + plan_required on Free; null with no marker until the vault has been scanned with per-address storage (Aave reserves are not scanned).'
tvl_concentration_top10pct:
type:
- number
- 'null'
x-plan: pro
description: PRO. % of TVL held by the top 10% of holders. null + plan_required on Free; null with no marker while holder analytics are still being indexed.
Plan:
type: string
enum:
- free
- pro
- custom
description: The caller's plan. Unknown values in the account record read as free.
PeriodStats:
type: object
description: Aggregated risk/return stats for a single time window.
properties:
tvl_low:
type:
- number
- 'null'
tvl_high:
type:
- number
- 'null'
apr:
type:
- number
- 'null'
apy:
type:
- number
- 'null'
inflows:
type:
- number
- 'null'
description: 'Net TVL change over the window (last day − first day): positive = net inflow, negative = net outflow. TVL-based, so it also reflects yield earned over the window, not just deposits/withdrawals.'
period_start:
type:
- string
- 'null'
period_end:
type:
- string
- 'null'
cagr:
type:
- number
- 'null'
description: Compound annual growth rate (%) over the window.
volatility:
type:
- number
- 'null'
description: Return volatility over the window.
sharpe:
type:
- number
- 'null'
description: Sharpe ratio over the window.
sortino:
type:
- number
- 'null'
description: Sortino ratio over the window.
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT