Add
Once assets are added into a user’s DeGate account, they become available for placing orders and transactions. As illustrated in the figure below, the user initiates a depposit transaction on-chain. After the transaction is included in a block and confirmed after 12 blocks, the DeGate node will credit the deposited amount into the user’s DeGate account balance, so that the user can immediately use these assets. Meanwhile, the Operator will initiate an off-chain transaction to confirm the deposit. The transaction goes through several phases, including block inclusion, block production, proof generation, and updating assets in the Merkle tree, before being rolled up on chain, thereby completing the fund addition.
Advanced and Standard Additions
Advanced add refers to the add process achieved by calling the DeGate smart contract method. All assets can be added in this way, with no special limit on the added amount.
To reduce costs for users, DeGate also offers a standard add option where users can directly transfer their assets to the DeGate contract address to complete the fund addition. However, the standard add method does not guarantee complete trustlessness and users must trust that the DeGate node will accurately credit their assets into their account balance. Therefore, the node operator imposes limits on the amount of funds that can be added and supported tokens using the standard add method to reduce potential losses suffered by users.
Comparison | Advanced Additions | Standard Additions |
---|---|---|
Gas usage of user initated add transaction 1️ | ETH: ~110141 ERC20: ~132605 | ETH: ~21055 ERC20: ~60000 |
Credit Duration | After the add transaction received 12 block confirmations | After the add transaction received 12 block confirmations |
Applicable Asset | All | Selected assets based on the configuration of node operator. |
Trustless | DeGate smart contract will verify the add address and asset amount. If the fund addition is not processed after a period of time, users can call a smart contract function to retrieve their asset | DeGate smart contract can only verify the asset amount and is unable to verify the add address. Technically, it is possible for the DeGate node to amend the add address. If the fund addition is not processed, users cannot retrieve it on their own and they will have to contact the node operator to return the tokens. |
Restrictions | None | There is an add amount limit per fund addition and there is also a limit on the amount for all pending fund additions. |
Note1️: The gas consumption here represents the average value obtained from our testing results. The actual gas consumption for adding ERC20 tokens is related to the contract implementation method, and could exceed the reference value in the table.
Paid Fund Additions
Typically, the DeGate node subsidizes the L1 Gas fees for confirming fund addition requests, and users only need to bear the cost of initiating the add transaction. However, to prevent exploitation of the mechanism, a cap is placed on the number of free fund additions. With each fund addition, the number of free fund additions will decrease. However, this number will recover linearly over time. The parameters for advanced and standard additions differ. Once the number of free fund additions is exhausted, users must pay to have their fund additions credited to their account.
The paid fund addition logic for advanced Addition is controlled by the DeGate smart contract. If the number of free fund additions has been exhausted when a user calls the contract, they will need to add an extra 0.01 ETH to the transaction (this parameter is set by the node operator). Otherwise the add transaction will fail.
The paid fund addition logic for standard addition is controlled by the DeGate node. The difference is that the the DeGate node will only check the number of free fund additions when confirming the add transaction. If the number of free fund additions has been exhausted, users must pay a certain amount of ETH fees (this parameter is set by the node operator) to complete the fund addition. Users can locate the add record in the "Assets Record” section and click “Paid Add" to complete the operation.
Cross-chain Add Feature
For more information, please refer to Cross-chain Add/Send Feature
Last updated