Skip to main content

Module balance

Module balance 

Source

Functionsยง

calculate_value_usdc_base_units
Calculate value of token balance in USDC base units. Takes a signed token balance and converts it to USDC value using the oracle price.
compute_token_balance
Calculate token balance from raw Drift position fields.
get_token_balance
Calculate token balance from a Drift spot position and market data. Returns signed balance in base units (positive = deposit, negative = borrow).