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 allows | 7 days |
| Sessions per wallet | 1; starting again replaces it (copy trading uses the same one: Copy trading) |
| Spend cap | the USDC allowance approved at the start (site default: the wallet's balance) |
| SOL sent to the key | topped up to 0.02 SOL when it holds under 0.01 |
| Ends | at 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
- 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.
- 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.
- 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.
- 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.
Order types
There are two things a trader can send: a batch order, which goes into the next auction now, and a trigger, which waits for a price and then becomes a batch order. Two more are built from those: a TWAP, which sends one order into the batches in slices on a clock, and a scale ladder of triggers.
Copy trading
Pick a trader, set a size and a total to spend, and sign once. From then on unwind's copy keeper places that trader's trades for your wallet, sized as you chose, until you stop or the session ends.