-
Notifications
You must be signed in to change notification settings - Fork 6
hyh - Subsequent takes increase next kicker reward, allowing total kicker reward to be artificially amplified by splitting take into a batch #69
Comments
We wrote a test for this and determined that rewards do not increase with each subsequent take. As it is written this is an invalid issue. We did however discover an issue: when you take above the TP you move the TP down, this can increase the penalty to the bond holder and the borrower. We will fix this separate issue and will memorialize the TP on kick. |
Escalate This issue is invalid as per sponsor statement and therefore should not be rewarded. |
You've created a valid escalation! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
@dmitriia |
Will get back shortly on this. |
There is one done by Proteek. It shows the increasing reward when auction price is within // Reward is increased with subsequent take just above TP.
assertEq(totalBondAfterFullTake, 296.921313863332593428 * 1e18);
assertEq(totalBondAfterSubsequentTake, 299.032319479303523664 * 1e18);
assertGt(totalBondAfterSubsequentTake, totalBondAfterFullTake); It is practical for kicker/taker to atomically split the take in the series of a smaller ones as this enhances their total reward for the price of a moderate gas cost increase. |
Result: In the future will have another way of dealing with low-effort issues. For now need to reject the escalation. I'm sorry @midori-fuse |
Escalations have been resolved successfully! Escalation status:
|
Code changes related to this issue: |
Fix looks ok, threshold price is now fixed as of time of |
hyh
high
Subsequent takes increase next kicker reward, allowing total kicker reward to be artificially amplified by splitting take into a batch
Summary
Kicker reward is being determined as a proportion of auction price to neutral price (NP) distance to the distance between NP and threshold price (TP). The latter is determined on the fly, with the current debt and collateral, and in the presence of take penalty, actually rises with every take.
This way for any taker it will be profitable to perform many small takes atomically instead of one bigger take, bloating the kicker reward received simply due to rising TP as of time of each subsequent kick.
Vulnerability Detail
Take penalty being imposed on a borrower worsens its TP. This way a take performed on the big enough debt being auctioned increases the kicker rewards produced by the next take.
This way multiple takes done atomically increase cumulative kicker reward, so if kicker and taker are affiliated then the kicker reward can be augmented above one stated in the protocol logic.
Impact
Kicker reward can be made excessive at the expense of the reserves part.
Code Snippet
If
auctionPrice_
is fixed to bemarket_price - required_margin
then the biggerthresholdPrice
the bigger thesign
and resulting_bpf()
returned value:https://github.com/sherlock-audit/2023-09-ajna/blob/main/ajna-core/src/libraries/helpers/PoolHelper.sol#L382-L411
thresholdPrice >= int256(neutralPrice_)
will not happen on initial kick asnpTpRatio
is always above 1, but can happen if TP is raised high enough by a series of smaller takes, i.e. taker in some cases can even force kicker reward to be maximal+1 * bondFactor_
.takePenaltyFactor
is paid by the borrower in addition to auction price:https://github.com/sherlock-audit/2023-09-ajna/blob/main/ajna-core/src/libraries/external/TakerActions.sol#L724-L736
takePenaltyFactor
can be3-3.75%
forvars.bpf > 0
andbondFactor
maximized to be3%
, so if TP is above market price by a lower margin, sayTP = 1.025 * market_price
, then the removal of3-3.75%
part will worsen it off.The opposite will happen when TP is greater than that, but this calls for the singular executions and doesn't look exploitable.
Tool used
Manual Review
Recommendation
Consider limiting the take penalty so it won't worsen the collaterization of the auctioned loan, e.g. limiting
takePenaltyFactor
toTP / market_price - 1
.The text was updated successfully, but these errors were encountered: