Skip to content

Commit

Permalink
rename taker_fee to taker_fee_ceil in FillLog
Browse files Browse the repository at this point in the history
  • Loading branch information
Lou-Kamades committed Jan 11, 2024
1 parent 4f527af commit 697967f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion programs/openbook-v2/src/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions programs/openbook-v2/src/state/open_orders_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
});
Expand Down

0 comments on commit 697967f

Please sign in to comment.