A trader’s margin and vault
Every trader has two accounts: a margin account, which is just a ledger offree_balance and locked_balance, and a vault, the token account
that USDC actually sits in. Depositing and withdrawing moves tokens in and
out of that vault; opening and closing a position just moves the ledger
between free and locked.
Isolated margin locks margin + a reserved fee out of free balance the
moment an order is submitted, checked against both the worst price the
batch could give it and the oracle price, so a position can never land
already underwater. If free balance alone is short, the difference is
pulled automatically from the trader’s cross collateral, if any.
Cross margin works differently. Every trader’s cross position lives in
one single, shared account, not one per trader: up to 1024 entries, each
holding up to 4 open positions and its own small price table that’s kept
current for every market it’s exposed to, refreshed every batch. Opening a
cross position needs the account’s total equity, collateral plus every open
position’s running PnL and funding, to cover its initial margin requirement
plus whatever’s already reserved; only one cross order can be in flight at
a time per account. Withdrawing needs collateral, after unrealized losses,
to still clear the account’s initial margin requirement. A market only
carries cross positions if it has opted in, and can’t opt back out while
any are still open.
The first cross deposit needs at least 1 USDC, specifically so the account
can’t be left open on dust that nobody would bother to use, and anyone can
evict a genuinely idle entry, freeing it for someone else.
A maker’s capital
A maker does not fund each market, or even each leverage tier, separately, and does not hold a private vault at all. Every maker approved on a pool shares one token account, owned by the pool itself. A maker’s own share of it is tracked as a balance in their own slot inside the pool, alongside one inventory record per leverage tier in that pool, so a single deposit can back live positions on every tier an asset offers at once.
A withdrawal isn’t just a balance check. It’s only allowed once the maker’s
own equity, their balance plus every leverage tier’s inventory marked at
the pool’s last recorded price, still clears a 20% cover requirement on
what they have open, and the pool as a whole still has enough left to cover
everything it owes and everything already promised out. Pairing a real
solvency check with a 24 hour delay on withdrawal requests is what lets
makers fund many markets from one balance without that balance quietly
becoming unable to back what it’s already quoting.

