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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use saturating sub
  • Loading branch information
ra authored and nope-finance committed Feb 17, 2022
commit 0d962c816c9a111df2a119682da6c43e37c0ecef
3 changes: 1 addition & 2 deletions token-lending/program/src/state/reserve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,7 @@ impl Reserve {
}

let withdraw_amount = withdraw_amount
.checked_sub(protocol_fee_amount)
.unwrap_or(0);
.saturating_sub(protocol_fee_amount);

Ok(CalculateLiquidationResult {
settle_amount,
Expand Down