Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,9 @@ Returns [`[RiskScoreLegacy]`](#riskscorelegacy).
| `cvxAPR` | `Float` | Convex APR |
| `keepCRV` | `Float` | Keep CRV |
| `keepVelo` | `Float` | Keep VELO |
| `estimatedDebtCoverage` | `Float` | Share of active debt backed by a live Morpho estimate (0–1); remainder falls back to Kong's APR oracle |
| `morphoBaseAPY` | `Float` | Debt-weighted Morpho base APY leg |
| `morphoRewardsAPR` | `Float` | Debt-weighted Morpho rewards APR leg |

### Historical

Expand Down
22 changes: 22 additions & 0 deletions packages/ingest/helpers/apy-apr.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,28 @@ describe('getLatestEstimatedAprV3', function() {
expect(result!.apy).to.equal(0.031)
expect(result!.components).to.deep.equal({})
})

it('returns debt-coverage components unchanged for katana-estimated-apr rows', async function() {
const t = new Date()
const KATANA_LABEL = 'katana-estimated-apr'

await insertOutput(VAULT_ADDR, KATANA_LABEL, 'netAPR', 0.062, t)
await insertOutput(VAULT_ADDR, KATANA_LABEL, 'netAPY', 0.064, t)
await insertOutput(VAULT_ADDR, KATANA_LABEL, 'estimatedDebtCoverage', 0.75, t)
await insertOutput(VAULT_ADDR, KATANA_LABEL, 'morphoBaseAPY', 0.041, t)
await insertOutput(VAULT_ADDR, KATANA_LABEL, 'morphoRewardsAPR', 0.019, t)

const result = await getLatestEstimatedAprV3(TEST_CHAIN, VAULT_ADDR)
expect(result).to.not.be.undefined
expect(result!.type).to.equal(KATANA_LABEL)
expect(result!.apr).to.equal(0.062)
expect(result!.apy).to.equal(0.064)
expect(result!.components).to.deep.equal({
estimatedDebtCoverage: 0.75,
morphoBaseAPY: 0.041,
morphoRewardsAPR: 0.019
})
})
})

describe('getLatestApy', function() {
Expand Down
3 changes: 3 additions & 0 deletions packages/web/app/api/gql/typeDefs/vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ type EstimatedAprComponents {
baseNetAPY: Float
lockerBonusAPR: Float
lockerBonusAPY: Float
estimatedDebtCoverage: Float
morphoBaseAPY: Float
morphoRewardsAPR: Float
}

type EstimatedApr {
Expand Down
Loading