Skip to content

Commit

Permalink
program: avoid overwriting 0 duration auction (#1097)
Browse files Browse the repository at this point in the history
* program: avoid overwriting 0 duration auction

* CHANGELOG
  • Loading branch information
crispheaney authored Jun 20, 2024
1 parent ff5b573 commit 5d87639
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

- program: avoid overwriting 0 duration auction (https://github.com/drift-labs/protocol-v2/pull/1097)
- program: add pyth pull oracles (https://github.com/drift-labs/protocol-v2/pull/1067)
- ts-sdk: add pyth pull oracle clients

Expand Down
2 changes: 1 addition & 1 deletion programs/drift/src/state/order_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl OrderParams {
OrderParams::get_perp_baseline_start_price_offset(perp_market, self.direction)?;
let new_auction_start_price = oracle_price.safe_add(auction_start_price_offset)?;

if self.auction_duration.is_none() {
if self.auction_duration.unwrap_or(0) == 0 {
match self.direction {
PositionDirection::Long => {
let ask_premium = perp_market.amm.last_ask_premium()?;
Expand Down

0 comments on commit 5d87639

Please sign in to comment.