@@ -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 } ;
@@ -996,23 +994,12 @@ pub fn fill_perp_order(
996994 . position ( |order| order. order_id == order_id && order. status == OrderStatus :: Open )
997995 . ok_or_else ( print_error ! ( ErrorCode :: OrderDoesNotExist ) ) ?;
998996
999- let (
1000- order_status,
1001- market_index,
1002- order_market_type,
1003- order_price,
1004- order_oracle_price_offset,
1005- order_direction,
1006- order_auction_duration,
1007- ) = get_struct_values ! (
997+ let ( order_status, market_index, order_market_type, order_direction) = get_struct_values ! (
1008998 user. orders[ order_index] ,
1009999 status,
10101000 market_index,
10111001 market_type,
1012- price,
1013- oracle_price_offset,
1014- direction,
1015- auction_duration
1002+ direction
10161003 ) ;
10171004
10181005 validate ! (
@@ -2287,7 +2274,7 @@ pub fn fulfill_perp_order_with_amm(
22872274 filler_reward,
22882275 referee_discount,
22892276 referrer_reward,
2290- fee_to_market_for_lp,
2277+ fee_to_market_for_lp : _fee_to_market_for_lp ,
22912278 maker_rebate,
22922279 } = fees:: calculate_fee_for_fulfillment_with_amm (
22932280 user_stats,
@@ -2304,9 +2291,6 @@ pub fn fulfill_perp_order_with_amm(
23042291 user. is_high_leverage_mode ( MarginRequirementType :: Initial ) ,
23052292 ) ?;
23062293
2307- let user_position_delta =
2308- get_position_delta_for_fill ( base_asset_amount, quote_asset_amount, order_direction) ?;
2309-
23102294 // Increment the protocol's total fee variables
23112295 market. amm . total_fee = market. amm . total_fee . safe_add ( fee_to_market. cast ( ) ?) ?;
23122296 market. amm . total_exchange_fee = market. amm . total_exchange_fee . safe_add ( user_fee. cast ( ) ?) ?;
0 commit comments