Appearance
The house
The house, or LP, is the counterparty to every trade. It is funded only by traders' realized losses. There is no external liquidity provider and no deposit into the house; settling losses is the only way money enters it. Winning traders are paid from it. When it can't pay, wins wait in a first-in, first-out payout queue.
Balances
| Balance | Meaning |
|---|---|
| Treasury (LP balance) | USDC available to pay wins. Losses credit it while the queue is empty. |
| Side bucket | Losses that arrived while the queue was active. They are reserved for paying the queue. |
| Queue debt | The total of unpaid queue claims. These are IOUs, not cash. |
| House funds | treasury + side bucket − queue debt, the house's net position. It can be negative. |
Treasury, side bucket and queue debt are stored in the program's Config account (Config.lp). House funds is computed from them, not stored. The program's cash accounting is designed so that the vault holds at least: all available balances + locked margin + open position margin + treasury + side bucket + accrued dev fees + staker revenue not yet distributed + staking cash. The program never counts queue claims or $NOTE balances as cash. The keeper monitors this and alerts on any deficit.
Where losses go
| Queue empty | Queue active | |
|---|---|---|
| Loss or liquidated margin | loss − 2% to the treasury; 2% fee to stakers and dev | 100% to the side bucket; no fee |
How wins are paid
At close, the haircut win (adjusted, Fees and PnL) is:
- paid now if the queue is empty and the treasury holds at least
adjusted. The treasury paysadjusted, you receiveadjusted − 2%, and the 2% is split between stakers and dev; - queued in full otherwise. There is no partial payment at close: either the whole win is paid or the whole win is queued. Once the queue is active, every new win with a positive haircut amount queues behind it, however small, even if the treasury could cover it. A win whose haircut amount is 0 creates no claim.
Your margin is never queued. It always comes back at close.
The payout queue
- Each queued win becomes a
QueueClaimaccount recording its sequential queue index, the amount owed, the owner and the position it came from. Its address is derived from the owner and the position id (["claim", owner, position_id]), not from the index; queue order is the index. Your trading account'squeuedfield is the total of your unpaid claims. - Strict FIFO. Only the claim at the front can be paid.
- Harvest (
harvest,harvest_one) is permissionless. It pays the front claim from the side bucket first, then from the treasury, in full or in part. A large front claim is paid down with whatever cash exists, so backing cash never sits idle behind it.harvestpays several claims in order in one transaction and stops when the cash runs out. - Each payment
pcreditsp − floor(p × 2%)to your available balance. The fee is split as usual and uses the fee rate in force when the payment is made. - When the last claim is paid, any cash left in the side bucket moves to the treasury.
- When a claim is fully paid, its account closes and its rent goes back to whoever escrowed it, normally the account that signed your close request.
- The Papersol keeper calls
harvest_oneabout every 2 seconds whenever the queue has backing, and raises an alert if the queue has cash but stops advancing. - Queued amounts can't be withdrawn and can't be used as margin until they are paid.
Staker cap and sweeps
staker_cap is currently $5,000,000 (a governance parameter). When the queue is empty and the treasury is above the cap, a settling instruction sweeps the excess to $NOTE stakers as USDC revenue ($NOTE). Sweeps run as part of every close fill, liquidation, retired settlement, harvest, stake, unstake and reward claim, and anyone can trigger one with sweep. The cap applies to the treasury only at those moments:
- nothing is swept while the queue is active;
- side-bucket cash is never capped;
- if governance lowers the cap, the excess is swept at the next settling instruction, not immediately.
What this means for traders
- Wins can queue. A queued claim is first paid from whatever backing cash already exists. For example, if the treasury holds $50 and a $100 win queues, harvest can pay $50 of it right away. Any remainder depends on future realized losses. If they don't come, the remainder can wait indefinitely: there is no other source of funds and no deadline.
- The house starts empty. No instruction can fund the treasury, so at launch it holds $0. Until losses have built it up, winning closes queue.
- Small wins queue too while any claim is outstanding, unless the haircut reduces them to zero.
- Exposure is bounded by caps, not by the house's balance. Open-interest, per-position and per-trader caps limit how much the house can owe. Nothing checks the house balance when you open a trade.
- The house's balance and the queue are public: the
Configaccount and theQueueClaimaccounts are on-chain.