Tutorial

Your first trade

In this tutorial you buy a directional position in an open market and then exit part of it. You will see how one ETH entry becomes a complete set, a swap, and an INVALID share you keep, and how the exit gives that INVALID back in exchange for ETH.

Before you start

Open the standalone UI on a supported network as described in Configure the Trading UI; it derives and verifies the deterministic trading contracts for you. Connect a wallet on that network and select an initialized, open pair. To practise without a wallet, add ?simulate=1 for the browser-local simulator, which is clearly labeled and never reflects live chain state.

Enter a position

  1. Select Enter, choose YES or NO, and enter an ETH amount. Set the slippage tolerance (0% to 5%) and how many whole minutes the transaction stays valid (1 to 1440), then select Preview trade. Lower slippage tolerates less adverse movement from the quote; a shorter validity window reduces stale-transaction exposure. Either setting makes reverts more likely.
  2. Review the simulation: complete-set shares, opposite shares swapped, additional and total long shares, INVALID insurance, fee, average execution price, conditional price impact, your slippage tolerance, deadline, and minimum received.
  3. Select Enter YES (or Enter NO) and confirm the single enterPosition transaction in the wallet.
  4. Check the wallet. A YES entry delivers the complete-set YES plus the additional YES from the swap. Its INVALID insurance equals the complete-set quantity, not the larger total YES delivered, and the operation leaves you no NO.

Exit a position

  1. Select Exit and the side you hold, then enter the Complete-set value to redeem. No approval step is needed: the exit is a single share transfer from your wallet to the router.
  2. Select Preview trade. The simulation shows the complete sets redeemed, the opposite shares the router buys for you, the INVALID required, the estimated and minimum ETH out, the fee, and the deadline.
  3. Select Exit insured YES (or Exit insured NO) and confirm the wallet transaction. It calls the ShareToken's safeBatchTransferFrom with your INVALID and long shares; the router buys exactly the missing opposite shares, redeems the complete sets at the pool's current collateral rate, and forwards only that operation's ETH to you.
  4. Check the wallet: the ETH arrived, the INVALID you redeemed is gone, and any long shares beyond what the exit needed came back.

If your INVALID balance cannot cover the exit you asked for, reduce the amount; directional profit beyond what you can insure stays in your wallet as shares. Why early ETH exits are limited explains the bound, and Exit an insured position covers the SDK helper that finds the largest exit for you.