From 32b14c63e0acabdb0f55d18ec677437e2da9f42d Mon Sep 17 00:00:00 2001 From: Binye Barwe Date: Tue, 26 Dec 2023 23:49:25 +0100 Subject: [PATCH] remove event heap fee --- .../src/instructions/cancel_all_and_place_orders.rs | 5 ----- programs/openbook-v2/src/instructions/place_order.rs | 5 ----- .../openbook-v2/src/instructions/place_take_order.rs | 10 ---------- 3 files changed, 20 deletions(-) diff --git a/programs/openbook-v2/src/instructions/cancel_all_and_place_orders.rs b/programs/openbook-v2/src/instructions/cancel_all_and_place_orders.rs index ed256a760..5da945d35 100644 --- a/programs/openbook-v2/src/instructions/cancel_all_and_place_orders.rs +++ b/programs/openbook-v2/src/instructions/cancel_all_and_place_orders.rs @@ -29,7 +29,6 @@ pub fn cancel_all_and_place_orders( asks: ctx.accounts.asks.load_mut()?, }; let mut event_heap = ctx.accounts.event_heap.load_mut()?; - let event_heap_size_before = event_heap.len(); let now_ts: u64 = clock.unix_timestamp.try_into().unwrap(); @@ -126,10 +125,6 @@ pub fn cancel_all_and_place_orders( market.base_deposit_total += deposit_base_amount; market.quote_deposit_total += deposit_quote_amount; - if event_heap.len() > event_heap_size_before { - position.penalty_heap_count += 1; - } - token_transfer( deposit_quote_amount, &ctx.accounts.token_program, diff --git a/programs/openbook-v2/src/instructions/place_order.rs b/programs/openbook-v2/src/instructions/place_order.rs index 15428c5aa..52cfad407 100644 --- a/programs/openbook-v2/src/instructions/place_order.rs +++ b/programs/openbook-v2/src/instructions/place_order.rs @@ -37,7 +37,6 @@ pub fn place_order(ctx: Context, order: Order, limit: u8) -> Result< asks: ctx.accounts.asks.load_mut()?, }; let mut event_heap = ctx.accounts.event_heap.load_mut()?; - let event_heap_size_before = event_heap.len(); let now_ts: u64 = clock.unix_timestamp.try_into().unwrap(); @@ -100,10 +99,6 @@ pub fn place_order(ctx: Context, order: Order, limit: u8) -> Result< } }; - if event_heap.len() > event_heap_size_before { - position.penalty_heap_count += 1; - } - token_transfer( deposit_amount, &ctx.accounts.token_program, diff --git a/programs/openbook-v2/src/instructions/place_take_order.rs b/programs/openbook-v2/src/instructions/place_take_order.rs index 2e80b98d7..ab7be9d27 100644 --- a/programs/openbook-v2/src/instructions/place_take_order.rs +++ b/programs/openbook-v2/src/instructions/place_take_order.rs @@ -33,7 +33,6 @@ pub fn place_take_order<'info>( }; let mut event_heap = ctx.accounts.event_heap.load_mut()?; - let event_heap_size_before = event_heap.len(); let now_ts: u64 = clock.unix_timestamp.try_into().unwrap(); @@ -89,15 +88,6 @@ pub fn place_take_order<'info>( drop(market); - if event_heap.len() > event_heap_size_before { - system_program_transfer( - PENALTY_EVENT_HEAP, - &ctx.accounts.system_program, - &ctx.accounts.penalty_payer, - &ctx.accounts.market, - )?; - } - let (user_deposit_acc, user_withdraw_acc, market_deposit_acc, market_withdraw_acc) = match side { Side::Bid => (