@@ -173,10 +173,10 @@ mod update_perp_auction_params {
173173 . update_perp_auction_params ( & perp_market, oracle_price)
174174 . unwrap ( ) ;
175175 assert_ne ! ( order_params_before, order_params_after) ;
176- assert_eq ! ( order_params_after. auction_duration, Some ( 120 ) ) ;
176+ assert_eq ! ( order_params_after. auction_duration, Some ( 114 ) ) ;
177177 assert_eq ! (
178178 order_params_after. auction_start_price,
179- Some ( 100 * PRICE_PRECISION_I64 )
179+ Some ( 100 * PRICE_PRECISION_I64 + 100000 )
180180 ) ;
181181 assert_eq ! (
182182 order_params_after. auction_end_price,
@@ -214,10 +214,10 @@ mod update_perp_auction_params {
214214 . update_perp_auction_params ( & perp_market, oracle_price)
215215 . unwrap ( ) ;
216216 assert_ne ! ( order_params_before, order_params_after) ;
217- assert_eq ! ( order_params_after. auction_duration, Some ( 120 ) ) ;
217+ assert_eq ! ( order_params_after. auction_duration, Some ( 114 ) ) ;
218218 assert_eq ! (
219219 order_params_after. auction_start_price,
220- Some ( 100 * PRICE_PRECISION_I64 )
220+ Some ( 100 * PRICE_PRECISION_I64 - 100000 ) // %1 / 10 = 10 bps aggression
221221 ) ;
222222 assert_eq ! (
223223 order_params_after. auction_end_price,
@@ -265,7 +265,7 @@ mod update_perp_auction_params {
265265 . update_perp_auction_params ( & perp_market, oracle_price)
266266 . unwrap ( ) ;
267267 assert_ne ! ( order_params_before, order_params_after) ;
268- assert_eq ! ( order_params_after. auction_start_price. unwrap( ) , 99117618 ) ;
268+ assert_eq ! ( order_params_after. auction_start_price. unwrap( ) , 99216638 ) ;
269269
270270 let order_params_before = OrderParams {
271271 order_type : OrderType :: Market ,
@@ -282,7 +282,7 @@ mod update_perp_auction_params {
282282 . update_perp_auction_params ( & perp_market, oracle_price)
283283 . unwrap ( ) ;
284284 assert_ne ! ( order_params_before, order_params_after) ;
285- assert_eq ! ( order_params_after. auction_start_price. unwrap( ) , 99117618 ) ;
285+ assert_eq ! ( order_params_after. auction_start_price. unwrap( ) , 98900980 ) ;
286286
287287 let order_params_before = OrderParams {
288288 order_type : OrderType :: Market ,
@@ -351,7 +351,7 @@ mod update_perp_auction_params {
351351 . update_perp_auction_params ( & perp_market, oracle_price)
352352 . unwrap ( ) ;
353353 assert_ne ! ( order_params_before, order_params_after) ;
354- assert_eq ! ( order_params_after. auction_start_price. unwrap( ) , 117618 ) ;
354+ assert_eq ! ( order_params_after. auction_start_price. unwrap( ) , 216638 ) ;
355355
356356 let order_params_before = OrderParams {
357357 order_type : OrderType :: Oracle ,
@@ -471,8 +471,10 @@ mod get_close_perp_params {
471471 let amm = AMM {
472472 last_ask_price_twap : 99 * PRICE_PRECISION_U64 ,
473473 last_bid_price_twap : 97 * PRICE_PRECISION_U64 ,
474+ last_mark_price_twap_5min : 98 * PRICE_PRECISION_U64 ,
474475 historical_oracle_data : HistoricalOracleData {
475476 last_oracle_price_twap : 100 * PRICE_PRECISION_I64 ,
477+ last_oracle_price_twap_5min : 100 * PRICE_PRECISION_I64 ,
476478 ..HistoricalOracleData :: default ( )
477479 } ,
478480 mark_std : PRICE_PRECISION_U64 ,
@@ -541,8 +543,10 @@ mod get_close_perp_params {
541543 let amm = AMM {
542544 last_ask_price_twap : 103 * PRICE_PRECISION_U64 ,
543545 last_bid_price_twap : 101 * PRICE_PRECISION_U64 ,
546+ last_mark_price_twap_5min : 102 * PRICE_PRECISION_U64 ,
544547 historical_oracle_data : HistoricalOracleData {
545548 last_oracle_price_twap : 100 * PRICE_PRECISION_I64 ,
549+ last_oracle_price_twap_5min : 100 * PRICE_PRECISION_I64 ,
546550 ..HistoricalOracleData :: default ( )
547551 } ,
548552 mark_std : PRICE_PRECISION_U64 ,
@@ -630,7 +634,7 @@ mod get_close_perp_params {
630634 let auction_start_price = params. auction_start_price . unwrap ( ) ;
631635 let auction_end_price = params. auction_end_price . unwrap ( ) ;
632636 let oracle_price_offset = params. oracle_price_offset . unwrap ( ) ;
633- assert_eq ! ( auction_start_price, 87705234 ) ;
637+ assert_eq ! ( auction_start_price, 81093372 ) ;
634638 assert_eq ! ( auction_end_price, -251200914 ) ;
635639 assert_eq ! ( oracle_price_offset, -251200914 ) ;
636640
@@ -668,7 +672,7 @@ mod get_close_perp_params {
668672 let auction_start_price = params. auction_start_price . unwrap ( ) ;
669673 let auction_end_price = params. auction_end_price . unwrap ( ) ;
670674 let oracle_price_offset = params. oracle_price_offset . unwrap ( ) ;
671- assert_eq ! ( auction_start_price, 183 ) ;
675+ assert_eq ! ( auction_start_price, 115 ) ;
672676 assert_eq ! ( auction_end_price, -1021 ) ;
673677 assert_eq ! ( oracle_price_offset, -1021 ) ;
674678
0 commit comments