HelioxTradeBook
Append-only trade history
HelioxTradeBook maintains an append-only, onchain record of every trade executed by the protocol. Each entry captures the trade details (side, amounts, price, timestamp) and is associated with the user's address.
Design Properties
Append-Only
Once a trade is recorded, it cannot be modified or deleted. The history is immutable.
Per-User Arrays
Trades are stored per-user in dynamic arrays, enabling efficient pagination queries.
Write-Restricted
Only the Heliox contract can call recordTrade(). External callers revert with NotHeliox().
Paginated Reads
getTrades(user, from, to) supports efficient pagination. InvalidRange() and OutOfRange() protect against bad queries.
IntegrationThe HelioxReader contract provides a higher-level
getTrades(user, from, to) view that reads from the TradeBook for frontend/integrator consumption.