@@ -200,7 +200,7 @@ impl OrderParams {
200
200
if is_oracle_offset_oracle {
201
201
msg ! (
202
202
"Updating oracle limit auction start price to {}" ,
203
- new_auction_start_price
203
+ auction_start_price_offset
204
204
) ;
205
205
self . auction_start_price = Some ( auction_start_price_offset) ;
206
206
} else {
@@ -216,7 +216,7 @@ impl OrderParams {
216
216
if is_oracle_offset_oracle {
217
217
msg ! (
218
218
"Updating oracle limit auction start price to {}" ,
219
- new_auction_start_price
219
+ auction_start_price_offset
220
220
) ;
221
221
self . auction_start_price = Some ( auction_start_price_offset) ;
222
222
} else {
@@ -243,6 +243,28 @@ impl OrderParams {
243
243
}
244
244
}
245
245
246
+ let worst_price = if is_oracle_offset_oracle {
247
+ oracle_price_offset as i64
248
+ } else {
249
+ self . price as i64
250
+ } ;
251
+
252
+ if self . direction == PositionDirection :: Long {
253
+ if let Some ( auction_start_price) = self . auction_start_price {
254
+ self . auction_start_price = Some ( auction_start_price. min ( worst_price) ) ;
255
+ }
256
+ if let Some ( auction_end_price) = self . auction_end_price {
257
+ self . auction_end_price = Some ( auction_end_price. min ( worst_price) ) ;
258
+ }
259
+ } else {
260
+ if let Some ( auction_start_price) = self . auction_start_price {
261
+ self . auction_start_price = Some ( auction_start_price. max ( worst_price) ) ;
262
+ }
263
+ if let Some ( auction_end_price) = self . auction_end_price {
264
+ self . auction_end_price = Some ( auction_end_price. max ( worst_price) ) ;
265
+ }
266
+ }
267
+
246
268
let auction_duration_before = self . auction_duration ;
247
269
let new_auction_duration = get_auction_duration (
248
270
self . auction_end_price
0 commit comments