Context
Liquidators and frontends query health across multiple pools. Each query is a separate storage read.
Current Limitation/Problem
Health check per pool requires separate cross-contract call. N pools = N calls with N storage reads each.
Expected Outcome
Batched health check function that reads multiple pool states in a single call and computes health for all.
Acceptance Criteria
- BatchView function: accepts array of (pool, user, asset) tuples
- Single storage read to load pool config for all queried pools
- Parallel health computation: no cross-contract calls between computations
- Response: array of health factors, collateral values, debt values
- Gas comparison: batched vs individual per query count
- Pagination for large queries (100+ positions)
- Caching: cache batched results within transaction scope
Technical Scope
contracts/lending-pool/src/batch_view.rs - batched health check
- Frontend use: batch all visible positions in single query
- Gas benchmark: individual vs batched at various query sizes
- Edge cases: partial results on pool failure, stale data in cached results
Context
Liquidators and frontends query health across multiple pools. Each query is a separate storage read.
Current Limitation/Problem
Health check per pool requires separate cross-contract call. N pools = N calls with N storage reads each.
Expected Outcome
Batched health check function that reads multiple pool states in a single call and computes health for all.
Acceptance Criteria
Technical Scope
contracts/lending-pool/src/batch_view.rs- batched health check