Skip to main content←Back to docsData model (Firestore mirror)
TL;DR
- Each vault is mirrored into Firestore for fast UI reads.
- Factory ID maps to collection name; vault account ID maps to document ID.
- Indexed fields drive Discover, vault views, and positions.
Collection layout
- Collection key: factory ID (
nzaza.testnet or sudostake.near). - Document key: vault account ID (for example
vault-12.nzaza.testnet).
Core fields used by UI
ownerstate (idle, pending, active) derived from liquidity request + accepted offerliquidity_request (token, amount, interest, collateral, duration)accepted_offer (lender, accepted_at)liquidationunstake_entriescurrent_epoch- indexing metadata (
factory_id, tx_hash, created_at, updated_at)
Refresh model
- On key mutations, the app re-reads on-chain vault state and rewrites the document.
- If data appears stale, retry indexing from the UI.
SudoStake | Stake-Backed Liquidity