Execution Flow

This section outlines Optimex’s swap execution process using an example where a user swaps BTC for ETH while maintaining full custody of their BTC—without relying on intermediaries or wrapped assets.

Fixed-Rate Swap

  1. BTC Deposit & Swap Intent

    • The user deposits BTC into the Optimex Vault on the Bitcoin network.

    • This deposit signals their commitment to swap, though they can reclaim their BTC after a timelock (T) expires (e.g., 24 hours).

  2. Quote Request & Selection

    • The user requests quotes from market makers (MMs) via the Solver.

    • Since BTC is already in the Vault, MMs provide competitive, market-aligned quotes.

    • The user selects the best quote and confirms the swap by signing a transaction that authorizes the Vault to send BTC to the chosen MM (pending final approval).

  3. ETH Payment & Swap Settlement

    • The MM sends the ETH payment to the user based on the agreed rate.

    • Once confirmed on-chain, the Settlement Committee authorizes the Vault to release BTC to the MM, completing the swap.

Security Mechanisms

If the Settlement Committee or MM acts maliciously, Optimex ensures fairness through:

  • Blocking BTC Release: If the MM doesn’t send ETH, the Settlement Committee’s security deposit covers user losses.

  • Unauthorized BTC Transfers: If the Committee colludes with the MM to take BTC without payment, both the MM and the Committee are penalized.

  • Swap Failure: If the MM fails to fulfill the swap, part of its security deposit is slashed and paid as compensation to the user. The user can then reclaim BTC after the timelock expires.

Turbo Swap (Faster Settlements)

The Fixed-Rate Swap requires Bitcoin confirmations, which can take ~30 minutes. To streamline execution, Optimex enables an "Turbo Swap", allowing users to pre-confirm swaps while their BTC deposit is still pending.

  1. Indicative Quotes & Pre-Confirmation

    • The user requests indicative quotes from MMs via the Solver.

    • Solver selects the best two quotes (from two MMs) and informs the User.

    • The User sets a minimum acceptable rate and an expiry time for the swap.

    • The user deposits BTC into the Vault and pre-signs a transaction allowing settlement to one of the selected MMs if conditions are met.

  2. Final Quote & Execution

    • Once the BTC deposit is confirmed, the Solver fetches committed, binding quotes from the selected MMs.

    • If a quote meets the user’s minimum acceptable rate, the swap is executed immediately.

This reduces wait times and enables one-shot swap execution, improving the user experience. The number of pre-signed market makers can be increased beyond two for additional flexibility.

Last updated