margin_execute call.
What counts
- Every allowed token in the margin’s vaults, including borrowed tokens and receipts (Kamino cTokens, Perena shares, basis-vault shares).
- The Phoenix trader account, as one line: collateral plus position equity, floored at zero.
- Every debt, at its accrued value.
Rounding
The protocol would rather reject a tight borrow than mark an account safer than it is.
Prices that fail a check
For the owner’s own actions, a collateral token whose price is stale or off its TWAP counts as zero, so a stale-priced token can’t be used to borrow more. A debt must have a good price, or the action is blocked. For liquidation, collateral counts at its reported value and only the debts need fresh prices.In the app
The app uses the same formula (lib/account-model.ts) and the same price sources as the oracle. Its own limits target HF ≥ 1.15, so price drift between quote and execution doesn’t trip the on-chain check.
