From 8eab9b779d0a40bda4e0ea7ec321c1e9e2d77af7 Mon Sep 17 00:00:00 2001 From: Chris Heaney Date: Thu, 2 Jan 2025 16:28:30 -0500 Subject: [PATCH] fmt -- --- programs/drift/src/controller/liquidation.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/programs/drift/src/controller/liquidation.rs b/programs/drift/src/controller/liquidation.rs index a2bf341ea..95a24005d 100644 --- a/programs/drift/src/controller/liquidation.rs +++ b/programs/drift/src/controller/liquidation.rs @@ -315,13 +315,16 @@ pub fn liquidate_perp( if perp_market.status != MarketStatus::Settlement { let oracle_price_too_divergent = is_oracle_too_divergent_with_twap_5min( oracle_price, - perp_market.amm.historical_oracle_data.last_oracle_price_twap_5min, + perp_market + .amm + .historical_oracle_data + .last_oracle_price_twap_5min, state .oracle_guard_rails .max_oracle_twap_5min_percent_divergence() .cast()?, )?; - + validate!(!oracle_price_too_divergent, ErrorCode::PriceBandsBreached)?; } }