Skip to content

    Press / to search, [ and ] for the previous and next page.

    How it works

    Session keys

    Why you don't see a wallet popup on every trade, and what exactly you authorise.

    Why one click is enough

    When you enable trading, your wallet signs one message that names a key pair created in your browser and its expiry: RegisterSessionKeyV2 the first time (it may also name who referred you, bound for good), RegisterSessionKey for every later key. The relayer submits it and the SessionKeyManager contract records the key for your account. From then on the session key signs your opens and closes, the relayer submits them, and the contracts accept them as yours.

    The key is generated and used inside a separate browser worker and stored encrypted with a key the browser keeps non-extractable, so the raw key never sits in page storage. The worker signs nothing but trading messages for your account on this deployment.

    What a session key can do

    • Open positions on your account, funded from your available balance or your queued balance (OpenPosition).
    • Close positions on your account (Close).
    • Cancel your orders that are still queued at the relayer (CancelIntent).

    What a session key cannot do

    • Withdraw: every withdrawal needs your wallet’s own signature.
    • Stake, unstake or claim: those are wallet signatures too.
    • Register or revoke keys.

    The worst case if a session key leaks: someone can open and close positions on your account, and could lose your balance in trades, but cannot move it out of the exchange. Code running in the page, such as a malicious browser extension, could use an unlocked key while it runs, so revoke keys you no longer need.

    Builder fees

    The registration you sign also carries a builder address and the highest builder fee you agree to, which the app leaves empty and zero. A key registered through another frontend may name that frontend; while the owner approves it as a builder, positions the key closes pay it the lower of its rate and your signed maximum, at most 0.5% of the PnL: out of your gain on a win, out of the LP’s gain on a loss. See Builder codes.

    Expiry

    A key is registered for 30 days. Each order it signs carries its own deadline, 1 hour ahead, which must fall within the key’s lifetime. An account can have at most 8 active or pending keys.

    Revoking

    The Sessions dialog in the app lists every key of your account, marks the one on this device, and revokes one key or all of them, including keys on devices you no longer have. Revoking works in two ways:

    • as a transaction from your wallet to the SessionKeyManager, which needs a little HYPE for gas;
    • as a signed message that the relayer submits for free, for up to 32 keys at once or all of them. This gasless path is a deliberate addition, so that you can cut off a lost device even with no HYPE in your wallet.

    When a key is revoked, every queued order it signed is cancelled, and any order it signed that reaches the chain later is rejected. Every message the exchange asks your wallet to sign is listed on official signatures.

    Last updated: