Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
microwavedcola1 2022-05-17 17:11:37 +02:00
parent 2de149f74c
commit ab0df0e7f2
1 changed files with 1 additions and 1 deletions

View File

@ -115,7 +115,7 @@ impl PerpMarket {
let diff_price = match (bid, ask) {
(Some(bid), Some(ask)) => {
// calculate mid-market rate
let mid_price = (bid.checked_add(ask)) / 2;
let mid_price = bid.checked_add(ask).unwrap() / 2;
let book_price = self.lot_to_native_price(mid_price);
let diff = cm!(book_price / index_price - I80F48::ONE);
diff.clamp(self.min_funding, self.max_funding)