Skip to content

Commit

Permalink
program: extend time before limit order is considered resting (#349)
Browse files Browse the repository at this point in the history
* program: dont let perp order be maker if it cross vamm

* tweaks

* fix isRestingLimitOrder is DLOB
  • Loading branch information
crispheaney committed Feb 6, 2023
1 parent b1ff36f commit f34496d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion programs/drift/src/state/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ impl Order {
}

pub fn is_resting_limit_order(&self, slot: u64) -> DriftResult<bool> {
Ok(self.is_limit_order() && (self.post_only || slot.safe_sub(self.slot)? >= 15))
Ok(self.is_limit_order() && (self.post_only || slot.safe_sub(self.slot)? >= 45))
}
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/src/dlob/DLOB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ export class DLOB {
}

isRestingLimitOrder(order: Order, slot: number): boolean {
return order.postOnly || new BN(slot).sub(order.slot).gte(new BN(15));
return order.postOnly || new BN(slot).sub(order.slot).gte(new BN(45));
}

*getLimitBids(
Expand Down

0 comments on commit f34496d

Please sign in to comment.