Session keys
A session key is a browser-held signing key that places trades and orders without a wallet prompt, and can never withdraw funds.
A session key is a key pair generated locally in the browser and registered on-chain by the user's wallet. Once registered, it signs trades and orders on the wallet's behalf. The private key never leaves the device.
Registration#
The wallet signs a single registration message that records the session key in the SessionKeyManager contract together with its expiry. From then on, opens, closes and order placements are signed by the session key and submitted by the relayer.
Limits#
- Valid for up to 30 days. The app defaults to 30 days.
- At most 5 active keys per wallet.
- Permitted actions: open positions, close positions, place orders and cancel orders.
- No withdrawals. Withdrawals, staking actions and key registration always require the wallet.
Intent lifetime#
An intent is a signed instruction submitted to the relayer. Market trades signed by a session key expire one hour after signing if not executed. Limit orders and TP/SL remain valid until cancelled, for at most 30 days or until the key expires, whichever comes first.
Example#
Alice registers a session key on day 0 and uses it over the following month.
| Event | Rule | Result |
|---|---|---|
| Key registered on day 0 | Maximum validity 30 days | Key expires on day 30 |
| Market order signed at 12:00 | Market intents expire after one hour | Must execute by 13:00, otherwise discarded |
| Limit order placed on day 20 | Order lifetime = min(30 days, key expiry) | Valid until day 30, not day 50 |
| Sixth key registration attempted while five are active | At most 5 active keys | Rejected |
key expiry = day 0 + 30 days = day 30
market intent = 12:00 + 1 hour = 13:00
limit order expiry = min(day 20 + 30, day 30) = day 30
active keys = 5 → a sixth is rejected
← Scroll sideways for long formulas
A resting order never outlives the session key that signed it.
Revocation#
Any key can be revoked from Settings at any time. Revocation is an on-chain call from the wallet and takes effect immediately: every intent and resting order signed by that key becomes invalid.