docs

One-click trading

A wallet signs once to start a session. For the next 24 hours a key the page holds signs that wallet's trades, so no order asks the wallet again.

Key figures

Session length (site)24 hours
Longest session the program allows7 days
Sessions per wallet1; starting again replaces it (copy trading uses the same one: Copy trading)
Spend capthe USDC allowance approved at the start (site default: the wallet's balance)
SOL sent to the keytopped up to 0.02 SOL when it holds under 0.01
Endsat expiry, or at once when the wallet turns it off

What a session key can do

For its own wallet only, on any market, until the session expires:

  • open, close and flip positions, in the batch or as an instant fill;
  • cancel its wallet's orders in the collecting batch;
  • set and cancel take profits, stops, limit closes, trailing stops and limit opens;
  • place and cancel TWAPs and scale ladders.

What it cannot do

Everything else still needs the wallet's own signature:

  • withdraw from the pool, or claim a withdrawal;
  • add or remove margin;
  • claim referral or listing rewards;
  • back or unback a market, or list one;
  • take a referral code or name a referrer.

The key's trades pay out to the wallet, never to the key: a close, a cancel and a refund all land in the wallet's own USDC account, and the rent of an order account it closes goes to the wallet.

How the money is held to the cap

  1. The start transaction approves the wallet's session account, a program address, as the SPL delegate of its USDC account for the allowance. The key itself is never approved for anything.
  2. An open signed by the key moves its collateral with that session account as the token authority. Only the program can sign for it, and only in the instructions above, and only into the pool's vault.
  3. Each open uses up allowance. A cancel or a close returns money to the wallet, not to the allowance, so the allowance is a cap on what the session posts in all. Renewing approves a fresh one.
  4. An open larger than what is left is refused (SessionAllowanceExceeded); the page sends that one to the wallet instead.

Example: a session approved for $500. The key opens with $300 of collateral ($200 left), cancels it ($300 back in the wallet, still $200 left), then tries to open with $250. The program refuses it, and the wallet signs that order itself.

Checks on every trade

The instruction names the wallet as owner and the key as signer, and passes the wallet's session account. It goes ahead when the signer is the owner, or when the session belongs to the owner, names this key as its delegate, and has not expired. Otherwise it fails with NotSessionDelegate or SessionExpired.

Ending a session

Turning it off revokes the USDC approval, closes the session account (its rent back to the wallet), and sends the key's remaining SOL back, in one transaction. A session that simply expires leaves its approval in place with nothing able to use it; the next start replaces it.

Risks

The key lives in the browser's storage, like the guest wallet's. Anything that can read the page can use it until it expires, within the cap and only to trade. A session started in one browser does not work from another.

On this page