-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relative daily limits for the erc20-family bridges #287
Comments
Thanks @k1rill-fedoseev, it is better to use |
Hi @k1rill-fedoseev and @akolotov |
@k1rill-fedoseev Please make an example with the explicit numbers for all of the variables in your pseudocode shown above and please recheck the formulas. |
Hi, @maxaleks, @varasev We have a Let's now evaluate relative limit that corresponds to bridge balance of
So |
@k1rill-fedoseev thanks for the clarification |
@k1rill-fedoseev thanks But I think that the final limit should be maximum at point @akolotov what do you think? |
what do you mean under "final limit"? |
Tokens amount. |
The logic how the limits for the generic bridge contracts work is covered in https://docs.tokenbridge.net/about-tokenbridge/transfer-limits. |
It is necessary to note the following requirements for this feature:
Bridge balance is 10'000 tokens. The relative daily limit is 6%.
Later, the approach can be changed to the approach Limit is increased by deposits Bridge balance is 10'000 tokens. The relative daily limit is 6%.
|
All three bridge mode (
native-to-erc20
,erc20-to-erc20
anderc20-to-native
) operates with absolute daily limits. For example, if the limit for the xDai bridge is equal100000
xDai it means that if daily value of tokens sent through the bridge in one direction exceeds this limit, bridge operation to transfer tokens in this direction will be restricted till the end of this day.But it is not correct from security point of view for the cases when the bridge balance is less than the limit. It will allow to dry out the bridge balance in one transfer request.
In order to support relative daily limits instead of current absolute limits it is suggested to introduce two additional parameters:
The relative limit threshold defines a minimal bridge balance when the relative limit is not applied.
The relative limit defines a part of the bridge balance that is allowed to be transferred through the bridge per one day.
The logic can be described in the following pseudocode:
The text was updated successfully, but these errors were encountered: