Skip to content

Commit 4f3b264

Browse files
committed
chore: add comment on trade spot balance
1 parent d31f459 commit 4f3b264

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

app/controllers/perps/utils/accountUtils.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff 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.
118127
export function getAvailableToTradeSpotBalance(
119128
spotState?: SpotClearinghouseStateResponse | null,
120129
): number {

0 commit comments

Comments
 (0)