Problem
There is no yield snapshot background job. The product vision requires periodic yield/APY calculations, but no such job exists. The liquidity service computes APY as a weighted average from off-chain loan data rather than from actual contract yield.
User impact: The displayed APY is an estimate, not the actual yield earned by the pool. Sponsors may make decisions based on inaccurate yield data.
Before Starting
Read: context/architecture-context.md
Root Cause
The yield snapshot job was never implemented.
What To Build
- Create
src/jobs/yield-snapshot.processor.ts
- Read pool share price from contract at regular intervals
- Calculate APY from share price changes over time
- Store yield snapshots in a
yield_history table
- Schedule: every 6 hours
- Add GET /liquidity/yield-history endpoint to serve snapshots
Files To Touch
src/jobs/yield-snapshot.processor.ts — new file
src/jobs/jobs.module.ts — register processor
src/modules/liquidity/liquidity.controller.ts — add yield-history endpoint
Acceptance Criteria
Mandatory Checks
Problem
There is no yield snapshot background job. The product vision requires periodic yield/APY calculations, but no such job exists. The liquidity service computes APY as a weighted average from off-chain loan data rather than from actual contract yield.
User impact: The displayed APY is an estimate, not the actual yield earned by the pool. Sponsors may make decisions based on inaccurate yield data.
Before Starting
Read: context/architecture-context.md
Root Cause
The yield snapshot job was never implemented.
What To Build
src/jobs/yield-snapshot.processor.tsyield_historytableFiles To Touch
src/jobs/yield-snapshot.processor.ts— new filesrc/jobs/jobs.module.ts— register processorsrc/modules/liquidity/liquidity.controller.ts— add yield-history endpointAcceptance Criteria
Mandatory Checks