-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Summary
Production stats show:
- total_donations_usd: $210,869.18
- total_payouts_usd: $295,036.12
Payouts are higher than donations, which should never happen.
After investigation, donations appear correct, but payouts are over-counted by approximately $106,000 due to 4x duplicate payout records for the AI pot in the indexer database.
Environment
- Frontend:
potlock-nextjs-app - Backend:
django-indexer - Production API:
https://api.potlock.io - Date: Jan 19, 2026
Observed Behavior
From /v1/stats:
total_donations_usd: 210869.18
total_payouts_usd: 295036.12
yaml
Copy code
- Payouts ($295k) > Donations ($210k)
- This violates expected quadratic funding logic.
Root Cause
The issue is isolated to the pot:
ai.v1.potfactory.potlock.near
Blockchain vs indexer:
- Blockchain: 20 payouts, 11,149 NEAR
- Indexer: 80 payouts, 30,627 NEAR
The same payouts were indexed four times.
Other pots do not show this duplication.
Impact
AI pot over-counting:
- Inflated AI pot payout USD: $141,256
- Real AI pot payout USD: ~$35,314
- Over-counted by: ~$105,942
Expected corrected totals:
total_donations_usd: $210,869 (unchanged)total_payouts_usd: ~$189,094
After correction, donations > payouts.
Initial Assumption (Later Proven Incorrect)
It was initially thought that:
- Donations with NULL
total_amount_usdwere not counted - Missing CoinGecko price mappings caused under-reporting
These were not the main cause.
The discrepancy was caused by duplicate payout indexing.
Fix Required
- Remove duplicate
PotPayoutrecords for the AI pot - Investigate why AI pot payouts were indexed multiple times
- Add a uniqueness constraint or deduplication logic
- Recompute
/v1/statsafter cleanup - Verify payouts < donations
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels