The protocol includes a flexible fee structure that developers can leverage when creating off-ramp orders. Fees are a crucial part of the transaction process, and this implementation ensures that they are handled transparently and flexibly.Documentation Index
Fetch the complete documentation index at: https://docs.onboard.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Fee Parameters in Trade Creation
The following code snippet illustrates how fee parameters are supplied during the creation of off-ramp orders in theEscrowOfframp contract:
createOfframpOrder function allows users to lock a specified amount of tokens in escrow.
During the creation of the off-ramp order, a _tradeFee parameter is supplied. This fee is recorded and associated with the transaction. There are two versions of this function:
- One that handles native tokens.
- One that deals with ERC20 tokens, ensuring the amount is pre-approved for transfer to the escrow account.
confirmOfframpOrder function ensures the existence of the order for the specified client and executes the transfer of assets to the merchant’s escrow account. The _tradeFee is then transferred to a designated fee recipient address, ensuring that fees are collected appropriately.