Deposits
The Omni application uses EIP-712/EIP-2612 to offer gasless deposits of USDC.
Instead of requiring users to pay gas to deposit funds into the platform, Omni simply has users sign a message to allowing the platform to withdraw a specific amount of tokens from the user's account. This architecture allows Omni to cover the gas needed to move tokens into the platform.
Deposit Flow
The flow of deposits is as follows:
User determines how many tokens that they want to deposit by interacting with the Omni frontend.
The Omni frontend relays this information to the Omni backend, which verifies that the user's authentication token is valid then creates a message for the user to sign.
Once the user signs the gasless message permitting the platform to withdraw the specified number of tokens from their account, the Omni backend relays this signed permit to the Variational protocol's on-chain transaction handler.
The transactor within the on-chain transaction handler creates a new settlement pool for the user, and deposits the user's funds into that settlement pool.
Once the watcher within the on-chain transaction handler has confirmed that the transaction has landed and funds have moved to the settlement pool smart contract, it informs the Omni backend of the updated user account balance.
The Omni frontend reflects the updated state of the Omni backend, crediting the user's account with funds.
Last updated