@@ -48,9 +48,7 @@ use crate::math::spot_balance::{get_signed_token_amount, get_token_amount};
4848use crate :: math:: spot_swap:: select_margin_type_for_swap;
4949use crate :: math:: { amm, fees, margin:: * , orders:: * } ;
5050use crate :: print_error;
51- use crate :: state:: events:: {
52- emit_stack, get_order_action_record, LPAction , LPRecord , OrderActionRecord , OrderRecord ,
53- } ;
51+ use crate :: state:: events:: { emit_stack, get_order_action_record, OrderActionRecord , OrderRecord } ;
5452use crate :: state:: events:: { OrderAction , OrderActionExplanation } ;
5553use crate :: state:: fill_mode:: FillMode ;
5654use crate :: state:: fulfillment:: { PerpFulfillmentMethod , SpotFulfillmentMethod } ;
@@ -985,23 +983,12 @@ pub fn fill_perp_order(
985983 . position ( |order| order. order_id == order_id && order. status == OrderStatus :: Open )
986984 . ok_or_else ( print_error ! ( ErrorCode :: OrderDoesNotExist ) ) ?;
987985
988- let (
989- order_status,
990- market_index,
991- order_market_type,
992- order_price,
993- order_oracle_price_offset,
994- order_direction,
995- order_auction_duration,
996- ) = get_struct_values ! (
986+ let ( order_status, market_index, order_market_type, order_direction) = get_struct_values ! (
997987 user. orders[ order_index] ,
998988 status,
999989 market_index,
1000990 market_type,
1001- price,
1002- oracle_price_offset,
1003- direction,
1004- auction_duration
991+ direction
1005992 ) ;
1006993
1007994 validate ! (
@@ -2246,7 +2233,7 @@ pub fn fulfill_perp_order_with_amm(
22462233 filler_reward,
22472234 referee_discount,
22482235 referrer_reward,
2249- fee_to_market_for_lp,
2236+ fee_to_market_for_lp : _fee_to_market_for_lp ,
22502237 maker_rebate,
22512238 } = fees:: calculate_fee_for_fulfillment_with_amm (
22522239 user_stats,
@@ -2263,9 +2250,6 @@ pub fn fulfill_perp_order_with_amm(
22632250 user. is_high_leverage_mode ( MarginRequirementType :: Initial ) ,
22642251 ) ?;
22652252
2266- let user_position_delta =
2267- get_position_delta_for_fill ( base_asset_amount, quote_asset_amount, order_direction) ?;
2268-
22692253 // Increment the protocol's total fee variables
22702254 market. amm . total_fee = market. amm . total_fee . safe_add ( fee_to_market. cast ( ) ?) ?;
22712255 market. amm . total_exchange_fee = market. amm . total_exchange_fee . safe_add ( user_fee. cast ( ) ?) ?;
0 commit comments