-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Issue: Support LocalDB as a data source for Order Detail “Volume” tab
Summary
The Order Detail Volume tab currently relies on the subgraph to fetch trades and compute vault volumes. When LocalDB is configured and has indexed the relevant trades, the Volume tab still does not use it, which adds latency and makes the feature unavailable when the subgraph is slow/unreachable.
Problem
RaindexOrder.getVaultsVolume(...)currently computes volumes via the subgraph client path only.- This means users cannot benefit from LocalDB’s locally indexed trade deltas for faster, offline/low-latency volume results.
- We need volume results to be available from LocalDB when LocalDB is enabled and contains the required data, without changing the public JS/WASM API.
Requirements
- Preserve existing volume semantics:
- trade deltas are hex Float
- positive = in, negative = out
totalVol = totalIn + totalOutnetVol = totalIn - totalOut(signed)
- Keep APY out of scope.
- Keep the external API unchanged:
RaindexOrder.getVaultsVolume(startTimestamp?: u64, endTimestamp?: u64) -> RaindexVaultVolume[]
- Ensure optional time filters continue to work for both data sources.
Done when
- With LocalDB enabled and populated, the Volume tab can load vault volumes without depending on the subgraph.
- With LocalDB disabled/unavailable, the existing subgraph-backed behavior remains unchanged.
Metadata
Metadata
Assignees
Labels
No labels