Skip to content

Deposits and withdrawals ​

Your trading account ​

Each wallet has one trading account, a program account at the address derived from ["trader", your wallet]. It records your USDC balances, your $NOTE and your session key. The USDC itself sits in the program's single vault, a token account owned by the program's config account. Only the program's own instructions can move it out.

  • create_trader creates the account. Only your wallet can sign it, and your wallet pays its rent: about 0.0022 SOL. This rent is not refundable: the program has no instruction that closes a trading account.
  • The Papersol app adds create_trader to your first deposit automatically.

Balances ​

BalanceWhat it isWithdrawable
Available (trading balance)Free USDC. Deposits, refunds, closed-position proceeds, queue payments and staking rewards all land here.Yes
LockedMargin held by open requests that are still pendingNo. It becomes position margin at fill, or returns to available on cancellation.
Position marginHeld in each open positionAt close: winning closes return the full margin, losing closes return margin − loss, liquidations return nothing
QueuedTotal of your unpaid payout-queue claims (IOUs)No. Each payment, minus 2%, goes to available.
$NOTE, unstakedEarned at close; held on your trading accountYes, to a wallet as the SPL token (withdraw_token, wallet signature)
$NOTE, stakedEarns USDC rewardsAfter unstaking (instant)
Accrued rewardsUSDC earned by staking, not yet claimedAfter claim_rewards, which credits available

Deposit ​

  • deposit(amount) moves USDC from a token account you own into the vault and credits available by the same amount.
  • Your wallet must sign. Session keys can't deposit.
  • It requires the protocol to have launched. It still works while trading is paused.
  • Only the configured USDC mint is accepted. The program requires a classic SPL Token mint and refuses Token-2022 mints when it is initialized.
  • No fee and no minimum, other than amount > 0.
  • When an order needs more than your trading balance, the Papersol app can put the deposit and the order request in one transaction (one wallet approval).

Withdraw ​

  • withdraw(amount) moves USDC from the vault to a USDC token account and debits available.

  • Only your wallet can sign. A session key can never withdraw.

  • Never paused. The program has no withdrawal pause, no oracle or keeper requirement, and no governance-controlled withdrawal gate. A withdrawal needs:

    • amount > 0 and amount ≤ available;
    • the correct trading account, vault and config;
    • a destination token account for the configured USDC mint that isn't the vault;
    • a successful SPL Token transfer. For example, a frozen token account would make the transfer fail.

    A program upgrade could change any of this (Oracle and safety).

  • The destination can be any USDC token account except the vault itself. The Papersol app withdraws to your wallet's associated token account and creates it if it is missing.

  • No fee, no delay, no withdrawal queue. Locked margin, open positions and queued wins can't be withdrawn until they become available.

What's on-chain ​

Everything:

  • your trading account (balances, $NOTE, session key, counters), each position, each pending request, each queue claim;
  • the global Config account (parameters, house balances, payout-queue state, staking pool) and one account per market (parameters, open interest, OI limits, oracle watermark);
  • the vault's USDC balance.

Most state changes emit an event (CashFlow, PositionOpened, PositionClosed, RequestCreated, RequestCancelled, ClaimHarvested, StakeChanged, LpSettled, among others). The Papersol indexer and app read these, but the chain is the source of truth. Account addresses are listed in Accounts and transactions.

Papersol is experimental software. Trading with leverage can lose your whole margin.