Skip to content

Commit 6dd2268

Browse files
committed
clean up
1 parent dbc512a commit 6dd2268

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

programs/drift/src/controller/pnl.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ use crate::math::spot_balance::get_token_amount;
2323
use crate::get_then_update_id;
2424
use crate::math::orders::calculate_existing_position_fields_for_order_action;
2525
use crate::msg;
26-
use crate::state::events::{
27-
LiquidateBorrowForPerpPnlRecord, LiquidatePerpPnlForDepositRecord, LiquidatePerpRecord,
28-
LiquidateSpotRecord, LiquidationRecord, LiquidationType, OrderAction, OrderActionRecord,
29-
OrderRecord, PerpBankruptcyRecord, SpotBankruptcyRecord,
30-
};
26+
use crate::state::events::{OrderAction, OrderActionRecord, OrderRecord};
3127
use crate::state::events::{OrderActionExplanation, SettlePnlExplanation, SettlePnlRecord};
3228
use crate::state::oracle_map::OracleMap;
3329
use crate::state::paused_operations::PerpOperation;
@@ -443,8 +439,10 @@ pub fn settle_expired_position(
443439
let base_asset_amount = user.perp_positions[position_index].base_asset_amount;
444440
let quote_entry_amount = user.perp_positions[position_index].quote_entry_amount;
445441

446-
let user_position_direction_to_close = user.perp_positions[position_index].get_direction_to_close();
447-
let user_existing_position_params_for_order_action = user.perp_positions[position_index].get_existing_position_params_for_order_action(user_position_direction_to_close);
442+
let user_position_direction_to_close =
443+
user.perp_positions[position_index].get_direction_to_close();
444+
let user_existing_position_params_for_order_action = user.perp_positions[position_index]
445+
.get_existing_position_params_for_order_action(user_position_direction_to_close);
448446

449447
let position_delta = PositionDelta {
450448
quote_asset_amount: base_asset_value,
@@ -481,7 +479,7 @@ pub fn settle_expired_position(
481479
if position_delta.base_asset_amount != 0 {
482480
// get ids for order fills
483481
let user_order_id = get_then_update_id!(user, next_order_id);
484-
let fill_record_id = { get_then_update_id!(perp_market, next_fill_record_id) };
482+
let fill_record_id = get_then_update_id!(perp_market, next_fill_record_id);
485483

486484
let base_asset_amount = position_delta.base_asset_amount;
487485
let user_existing_position_direction = user.perp_positions[position_index].get_direction();

programs/drift/src/math/amm_spread.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use crate::math::constants::{
1212
BID_ASK_SPREAD_PRECISION, BID_ASK_SPREAD_PRECISION_I128, DEFAULT_LARGE_BID_ASK_FACTOR,
1313
DEFAULT_REVENUE_SINCE_LAST_FUNDING_SPREAD_RETREAT, FUNDING_RATE_BUFFER,
1414
MAX_BID_ASK_INVENTORY_SKEW_FACTOR, PEG_PRECISION, PERCENTAGE_PRECISION,
15-
PERCENTAGE_PRECISION_I128, PERCENTAGE_PRECISION_I64, PERCENTAGE_PRECISION_U64, PRICE_PRECISION,
16-
PRICE_PRECISION_I128, PRICE_PRECISION_I64,
15+
PERCENTAGE_PRECISION_I128, PERCENTAGE_PRECISION_U64, PRICE_PRECISION, PRICE_PRECISION_I128,
16+
PRICE_PRECISION_I64,
1717
};
1818
use crate::math::safe_math::SafeMath;
1919
use crate::state::perp_market::{ContractType, PerpMarket, AMM};

0 commit comments

Comments
 (0)