File tree 1 file changed +12
-1
lines changed
programs/drift/src/controller
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -251,7 +251,7 @@ pub fn burn_lp_shares(
251
251
oracle_price : i64 ,
252
252
) -> DriftResult < ( PositionDelta , i64 ) > {
253
253
// settle
254
- let ( position_delta, pnl) = settle_lp_position ( position, market) ?;
254
+ let ( mut position_delta, mut pnl) = settle_lp_position ( position, market) ?;
255
255
256
256
// clean up
257
257
let unsettled_remainder = market
@@ -296,6 +296,17 @@ pub fn burn_lp_shares(
296
296
?;
297
297
298
298
update_quote_asset_amount ( position, market, -dust_base_asset_value. cast ( ) ?) ?;
299
+
300
+ msg ! (
301
+ "perp {} remainder_base_asset_amount burn fee= {}" ,
302
+ position. market_index,
303
+ dust_base_asset_value
304
+ ) ;
305
+
306
+ position_delta. quote_asset_amount = position_delta
307
+ . quote_asset_amount
308
+ . safe_sub ( dust_base_asset_value. cast ( ) ?) ?;
309
+ pnl = pnl. safe_sub ( dust_base_asset_value. cast ( ) ?) ?;
299
310
}
300
311
301
312
// update last_ metrics
You can’t perform that action at this time.
0 commit comments