File tree Expand file tree Collapse file tree
app/controllers/perps/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,6 +115,15 @@ export function getSpotBalance(
115115 ) ;
116116}
117117
118+ // `total - hold` gives the free-to-trade portion of supported spot collateral
119+ // (currently USDC only). Under HL's unified account mode — the default, where
120+ // most users are — `hold` captures perps margin reserved against spot USDC in
121+ // addition to classic open-spot-order reservations. This matches the "source
122+ // of truth for trading account balance across spot and perps" pattern HL
123+ // documents for unified accounts. For the current market surface (USDC
124+ // validator-operated perps, no HIP-3 markets, no portfolio margin) this is
125+ // the correct "reserved, not free to trade" signal. Revisit if USDH markets
126+ // or portfolio margin land.
118127export function getAvailableToTradeSpotBalance (
119128 spotState ?: SpotClearinghouseStateResponse | null ,
120129) : number {
You can’t perform that action at this time.
0 commit comments