Skip to content

Commit

Permalink
remove event heap fee
Browse files Browse the repository at this point in the history
  • Loading branch information
binyebarwe committed Dec 26, 2023
1 parent b728fe2 commit 32b14c6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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,
Expand Down
5 changes: 0 additions & 5 deletions programs/openbook-v2/src/instructions/place_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ pub fn place_order(ctx: Context<PlaceOrder>, 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();

Expand Down Expand Up @@ -100,10 +99,6 @@ pub fn place_order(ctx: Context<PlaceOrder>, 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,
Expand Down
10 changes: 0 additions & 10 deletions programs/openbook-v2/src/instructions/place_take_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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 => (
Expand Down

0 comments on commit 32b14c6

Please sign in to comment.