Problem
There is no endpoint returning protocol-wide loan
statistics. The web app explorer page needs this
to show total loans, active loans, repaid loans,
and total volume.
What To Build
Add GET /api/v1/loans/stats endpoint.
No auth required.
Response:
{
totalLoans: number,
activeLoans: number,
repaidLoans: number,
defaultedLoans: number,
totalVolume: number,
onTimeRepaymentRate: number
}
Query Supabase loans table for aggregated counts.
Files To Touch
- src/modules/loans/loans.controller.ts
- src/modules/loans/loans.service.ts
Acceptance Criteria
Mandatory Checks Before PR
Problem
There is no endpoint returning protocol-wide loan
statistics. The web app explorer page needs this
to show total loans, active loans, repaid loans,
and total volume.
What To Build
Add GET /api/v1/loans/stats endpoint.
No auth required.
Response:
{
totalLoans: number,
activeLoans: number,
repaidLoans: number,
defaultedLoans: number,
totalVolume: number,
onTimeRepaymentRate: number
}
Query Supabase loans table for aggregated counts.
Files To Touch
Acceptance Criteria
Mandatory Checks Before PR