You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to the risk of frontrunning, integrators should make sure to consider the following points when writing off-chain infrastructure:
The function CollateralRegistry.redeemCollateral calculates the redemption fee based on the user-provided maximum redeemed amount, rather than the actual amount. If the user sets a _maxIterationsPerCollateral, they may not receive the maximum amount. This will result in receiving less collateral than expected, while still paying the same percentage fee. Similarily, if all but one branch is backed, a redemption could redeem all collateral on a branch and then escape.
The user can also set a _maxFeePercentage, which will revert the transaction if the actual fee percentage is higher than expected. If the user is frontrun, the prior redemption will increase the basefee and reduce the total BOLD supply, so the fee will increase. This can cause their redemption to revert, as the user's specified _boldAmount would push the fee above the specified maximum. The user may want to write a wrapper contract that calculates the _boldAmount that can be redeemed without going above the _maxFeePercentage.
The execution order of liquidations can influence subsequent liquidations through redistributions. A profitable redistribution could restore a previously liquidatable trove, while an unprofitable redistribution might cause a previously healthy trove to become liquidatable.
The text was updated successfully, but these errors were encountered:
Due to the risk of frontrunning, integrators should make sure to consider the following points when writing off-chain infrastructure:
CollateralRegistry.redeemCollateral
calculates the redemption fee based on the user-provided maximum redeemed amount, rather than the actual amount. If the user sets a_maxIterationsPerCollateral
, they may not receive the maximum amount. This will result in receiving less collateral than expected, while still paying the same percentage fee. Similarily, if all but one branch is backed, a redemption could redeem all collateral on a branch and then escape._maxFeePercentage
, which will revert the transaction if the actual fee percentage is higher than expected. If the user is frontrun, the prior redemption will increase thebasefee
and reduce the total BOLD supply, so the fee will increase. This can cause their redemption to revert, as the user's specified_boldAmount
would push the fee above the specified maximum. The user may want to write a wrapper contract that calculates the_boldAmount
that can be redeemed without going above the_maxFeePercentage
.The text was updated successfully, but these errors were encountered: