Skip to main content←Back to docsIndexing and consistency
TL;DR
- Indexing keeps Firestore vault documents aligned with on-chain vault state.
- Most important actions trigger indexing automatically.
- If indexing fails, the app blocks with a
Retry indexing modal until it succeeds.
When indexing runs
- After creating a vault.
- After opening/canceling/accepting a request.
- After repayment and claim processing.
- During manual retry flows.
What indexing does
- Reads fresh vault state from chain.
- Transforms state to the app document shape.
- Writes back to Firestore for realtime subscribers.
Route behavior
/api/index_vault performs immediate indexing and returns success/failure./api/indexing/enqueue stores a background job for worker recovery./api/indexing/worker processes queued jobs with retry backoff.
Symptoms of stale data
- Request state does not change after a confirmed transaction.
- Lender/owner action buttons do not match expected role.
- Discover and vault page show different state briefly.
Recovery steps
- Wait a few seconds after wallet confirmation.
- Use retry indexing where available.
- Refresh the page.
- If still stale, escalate with transaction hash.
SudoStake | Stake-Backed Liquidity