What counts as collateral

V1: USDC only. A single 6-decimal SPL token.
Where your collateral lives
Deposited USDC goes tomarket.collateral_vault, a token account owned by
the market PDA. It is never rehypothecated; the vault only transfers out
on:
withdraw_collateral(authority only)place_ordermatching (transfers fees tofee_vault)liquidate(transfers fee split + bad-debt cover)
UserAccount.collateral. The on-chain
token balance in the vault equals the sum of all user collateral plus any
outstanding fees not yet swept.
Deposits
user_account.delegate can deposit, useful for keeper
bots that top up accounts automatically.
Withdrawals
deposit → open max position → withdraw games.
Reserved margin
Resting orders lock margin at placement, not fill. Your accessible collateral is:free_collateral + unrealized_pnl, not raw collateral.
This is deliberate, without it, spamming a hundred limit orders could all
simultaneously satisfy their individual margin checks but share the same
USDC.
Precision
All conversions are handled in
perps-math::safe_math.
Delegate trading
You can set a delegate viaset_delegate(delegate: Pubkey):
- Delegate can:
deposit_collateral,place_order,cancel_order,cancel_all_orders. - Delegate cannot:
withdraw_collateral,set_delegate,liquidate(except against others, liquidation doesn’t require delegation), delete the user account.
UserAccount inside
kimia-perp.
