Withdrawals

Omni covers any gas fees associated with withdrawals, ensuring users receive the full balance of funds they withdraw. Withdrawals are processed in a largely similar manner to deposits, through the on-chain transaction handler.

Withdrawal Flow

The flow of withdrawals is as follows:

  1. User determines how many tokens they want to withdraw by interacting with the Omni frontend.

  2. That information, along with the user's authentication token, is passed to the Omni backend, which verifies the user's requested withdraw is less than their unused collateral.

  3. After the authentication token and withdraw size is verified as legitimate, the Omni backend passes this information to the on-chain transaction handler, and debits the user's account on the Omni frontend.

  4. The transactor within the on-chain transaction handler submits a transaction to remove funds from the user's settlement pool and return them to the user's wallet.

  5. The watcher within the on-chain transaction handler waits for transaction confirmation. If the transaction fails for any reason, the watcher will interface with the Omni backend to credit funds back to the user's trading balance.

Last updated