From 697967f3cf6c3e268bae20682b2ebf1f0859219c Mon Sep 17 00:00:00 2001 From: Lou-Kamades Date: Thu, 11 Jan 2024 14:11:51 -0600 Subject: [PATCH] rename taker_fee to taker_fee_ceil in FillLog --- programs/openbook-v2/src/logs.rs | 2 +- programs/openbook-v2/src/state/open_orders_account.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/programs/openbook-v2/src/logs.rs b/programs/openbook-v2/src/logs.rs index f8c9be1dd..98b3868ce 100644 --- a/programs/openbook-v2/src/logs.rs +++ b/programs/openbook-v2/src/logs.rs @@ -27,7 +27,7 @@ pub struct FillLog { pub taker: Pubkey, pub taker_client_order_id: u64, - pub taker_fee: u64, // native quote + pub taker_fee_ceil: u64, // native quote pub price: i64, pub quantity: i64, // number of base lots diff --git a/programs/openbook-v2/src/state/open_orders_account.rs b/programs/openbook-v2/src/state/open_orders_account.rs index 88bc49934..fdd66c904 100644 --- a/programs/openbook-v2/src/state/open_orders_account.rs +++ b/programs/openbook-v2/src/state/open_orders_account.rs @@ -187,8 +187,8 @@ impl OpenOrdersAccount { } } - // calculate taker fee for logging, ignoring self trades - let taker_fees = if quote_native > 0 && fill.maker != fill.taker { + // Calculate taker fee, ignoring self trades + let taker_fee_ceil = if quote_native > 0 && fill.maker != fill.taker { market.taker_fees_ceil(quote_native) } else { 0 @@ -207,7 +207,7 @@ impl OpenOrdersAccount { maker_timestamp: fill.maker_timestamp, taker: fill.taker, taker_client_order_id: fill.taker_client_order_id, - taker_fee: taker_fees, + taker_fee_ceil, price: fill.price, quantity: fill.quantity, });