Skip to content
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

Closed
wants to merge 22 commits into from
Closed

Conversation

nope-finance
Copy link
Member

No description provided.

@nope-finance nope-finance changed the title Liquidation protocol fee2 Liquidation protocol fee Feb 17, 2022
@nope-finance nope-finance force-pushed the liquidation-protocol-fee2 branch 2 times, most recently from 1915cd3 to 2d0a637 Compare February 17, 2022 12:20
@nope-finance nope-finance force-pushed the liquidation-protocol-fee2 branch from 2d0a637 to 2fd17da Compare February 17, 2022 12:24
_padding,
liquidity_accumulated_protocol_fees,

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?

Copy link
Member Author

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);

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;

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

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

Copy link
Member Author

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)

@nope-finance nope-finance force-pushed the liquidation-protocol-fee2 branch from 284b309 to 17ac101 Compare February 17, 2022 23:35
@nope-finance
Copy link
Member Author

#75 addresses this

@0xripleys 0xripleys deleted the liquidation-protocol-fee2 branch January 25, 2023 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants