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
| Field | Decimals | Example |
|---|---|---|
collateral (USDC) | 6 | 1,000.000000 USDC = 1_000_000_000 |
base_amount (SOL) | 9 | 1.5 SOL = 1_500_000_000 |
price | 6 | $130.00 = 130_000_000 |
| Margin ratios | BPS | 10% = 1000; denominator 10_000 |
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.
