The core technique of the Ondefy Ramp is the smart contract which verifies / activates the permit, collects the transaction fees and executes the swap.
- Ramp providers only offer a very restricted set of crypto assets.
- USDC is a stablecoin offered by most providers. It supports the EIP 2612 standards (allowing modification of allowance with signed messages).
- Thanks to EIP 2612, the conversion of USDCs to any other token can be carried out in a single transaction. Our on-chain infrastructure consists of a Router contract, which acts as a dispatcher, and adapter contracts that can each interact with a DEX or DEX aggregator. After buying USDCs, the user signs a permit allowing the Router to have these funds available for swapping. Our backend queries multiple DEX aggregators for swap routes and selects the best rate. When the user receives their purchased USDCs and we have found a route, the router verifies the permit and transfers the USDCs directly to the relevant adapter, which can then interact with the swap protocol. Regarding transaction fees, they are paid by us. We take an equivalent amount of USDCs in return.