-
Notifications
You must be signed in to change notification settings - Fork 71
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
Liquidation protocol fee #71
Conversation
1915cd3
to
2d0a637
Compare
…ruction, adding 1 missing access check
2d0a637
to
2fd17da
Compare
_padding, | ||
liquidity_accumulated_protocol_fees, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we doing it like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than?
protocol_fee_amount = 1; | ||
} | ||
|
||
let withdraw_amount = withdraw_amount.saturating_sub(protocol_fee_amount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: why redefine withdraw_amount
here?
let mut protocol_fee_amount = bonus_amount.try_mul(protocol_fee_rate)?.try_floor_u64()?; | ||
// minimum protocol fee | ||
if protocol_fee_amount == 0 { | ||
protocol_fee_amount = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't enforcing a minimum protocol fee amount completely disincentive liquidators from liquidating sufficiently small liquidations?
I know they don't really go after the small ones anyway, but it seems like we might not want to have 0 incentivize liquidation opportunities maybe?
idk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the liquidation will fail if withdraw_amount is 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this only affects the smallest of liquidations, which no one is incentivized to do anyway. wont liquidations already fail if withdraw amount is 0? (if you look in processor)
284b309
to
17ac101
Compare
#75 addresses this |
No description provided.