11 MARKETSUSDG10 S GRIDNEXT FILL 00:10
//10_ Docs

ONE-CLICK TRADING

//01_ WHAT IT IS

Without it, every open and every close asks your wallet to confirm a transaction. One-click trading authorises a second key, generated in this browser, to send those requests for you. It is optional, it is limited to trading, and you can switch it off at any time.

//02_ ENABLING IT

  1. 01
    The app generates a new key in your browser. Its private part stays on your device: it is stored in this browser's localStorage under ph.session.<wallet address>, one entry per wallet, and is never sent to our server.
  2. 02
    Your wallet sends one transaction, authorizeSession(key, expiry), with 0.00002 ETH attached. The contract records the key and forwards the ETH to it in the same transaction, so the key can pay its own gas. At the chain's usual gas price that covers a handful of requests. When the key cannot pay for the next one, the app sends that request from your wallet instead, and the account panel has a button to top the key up with another 0.00002 ETH.
  3. 03
    The expiry is at most 30 days after that transaction; the contract refuses anything longer. After the expiry the key is refused and the app asks you to enable it again.

//03_ WHAT THE KEY CAN DO

ACTIONSESSION KEYWALLET
requestOpenyes, for its wallet onlyyes
requestCloseyes, for its wallet onlyyes
cancelRequestafter the 3,600 s TTL, like any addresssame
withdrawnoyes
collectClaimsnoyes
claimRewardsnoyes
donatenoyes
authorizeSession, revokeSessionnoyes

The restriction is enforced by the contract, not by the app. Withdrawals, claims and rewards always act on the balance of the address that sends the transaction, and the key's own balance in the exchange is zero. Opening and closing positions are the only functions that accept an authorised key acting for another address.

//04_ REVOKING

  • revokeSession(), sent from your wallet, removes the key at once. The app has a button for it.
  • Enabling one-click trading again replaces the old key: a wallet has one key at a time.
  • The key stops working by itself at its expiry.

//05_ IF YOU CLEAR THIS BROWSER

Clearing the site's storage, or using another browser or device, loses the key. Your balance, positions, claims, paper and rewards are untouched: they belong to your wallet, not to the key. What is lost is the ETH left on the key, at most 0.00002 ETH. The old key stays authorised on chain until its expiry, but nobody holds it anymore; you can revoke it from your wallet to be tidy, then enable one-click trading again.

//06_ THE TRADE-OFF

Credits: hands from Michelangelo, The Creation of Adam (detail), public domain, via Wikimedia Commons. Marks of the markets and integrations belong to their owners (sources, credits).