Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixes

- program: fix base spread validate for perp market [#2052](https://github.com/drift-labs/protocol-v2/pull/2052)
- sdk: fix for initializing a new user account with a token2022 deposit

### Breaking
Expand Down
4 changes: 2 additions & 2 deletions programs/drift/src/validation/perp_market.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ pub fn validate_perp_market(market: &PerpMarket) -> DriftResult {

if market.amm.amm_spread_adjustment >= 0 && market.amm.amm_inventory_spread_adjustment >= 0 {
validate!(
market.amm.long_spread + market.amm.short_spread >= market.amm.base_spread,
market.amm.long_spread + market.amm.short_spread >= market.amm.base_spread.saturating_sub(2),
ErrorCode::InvalidAmmDetected,
"market {} amm long_spread + short_spread < base_spread: {} + {} < {}",
"market {} amm long_spread + short_spread < base_spread - 2: {} + {} < {}",
market.market_index,
market.amm.long_spread,
market.amm.short_spread,
Expand Down
Loading