Creating a swap
The swapping UI looks like this: openSwap V2 currently supports swapping ETH ↔ USDC on Base. Choose the amount you want to sell and hit Create Swap. After this point, the user typically does not have to do anything and will receive their tokens back after a short wait.Order submitted
When a swap is created, an order is submitted, and you will see the below: At the submission stage, orders can be canceled until someone matches. The fulfillment fee paid to the matcher starts at the configured starting fee and increases over time until the swap is matched or the configured cap is reached.Order matched
Once your order submission has been matched, you will see the following: The matcher creates the oracle game and submits the initial report in the samematchSwap() transaction. Once the swap is matched, the oracle game is already live and can be disputed or settled.
If the swap is not executed within the configured max game time after match, a Bail Out path is available that refunds the swapper and matcher their original amounts.
Oracle game
While the swapper doesn’t have to play the oracle game to swap, the steps of the game are exposed in the UI. This is the permissionless escalation game step, where the execution price is determined by the final ratio of token balances in the oracle game. Each challenge (dispute) requires increasing token commitments. During an openSwap order, the price may change, so it may be profitable for a disputer to step in and correct the matcher’s initial price. The execution step is typically handled by MEV bots. After the most recent report or dispute sits undisputed for the configured settlement time, the oracle game becomes settleable and the swap becomes executable. The executor callsexecute(), which settles the oracle inline if needed and either fulfills the swap at the final price or refunds the swapper and matcher their original amounts. If an MEV bot does not pick up the execute, the UI exposes an Execute button for the user to call. Refunds happen when the execution price is outside the slippage tolerance passed by the swapper, when there is not enough liquidity at the final price, or when the implied blocks-per-second sanity check fails.