Skip to content

Commit

Permalink
bigz/add-validate_perp_market-in-update-max-imbalances (#667)
Browse files Browse the repository at this point in the history
* bigz/add-validate_perp_market-in-update-max-imbalances

* update changelog
  • Loading branch information
0xbigz authored Oct 26, 2023
1 parent a899ac7 commit a7f352b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- program: add positive perp funding rate offset ([#576](https://github.com/drift-labs/protocol-v2/pull/576/files))

### Fixes
- program: add validation check in update max imbalances ([#667](https://github.com/drift-labs/protocol-v2/pull/667))

### Breaking

Expand Down
3 changes: 3 additions & 0 deletions programs/drift/src/instructions/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,9 @@ pub fn handle_update_perp_market_max_imbalances(
perp_market.unrealized_pnl_max_imbalance = unrealized_max_imbalance;
perp_market.insurance_claim.quote_max_insurance = quote_max_insurance;

// ensure altered max_revenue_withdraw_per_period doesn't break invariant check
crate::validation::perp_market::validate_perp_market(perp_market)?;

Ok(())
}

Expand Down

0 comments on commit a7f352b

Please sign in to comment.