diff --git a/programs/mango-v4/src/instructions/perp_consume_events.rs b/programs/mango-v4/src/instructions/perp_consume_events.rs index bbc2e7ef1..b45ad8043 100644 --- a/programs/mango-v4/src/instructions/perp_consume_events.rs +++ b/programs/mango-v4/src/instructions/perp_consume_events.rs @@ -130,7 +130,6 @@ pub fn perp_consume_events(ctx: Context, limit: usize) -> Res seq_num: fill.seq_num, maker: fill.maker, maker_order_id: fill.maker_order_id, - maker_client_order_id: fill.maker_client_order_id, maker_fee: fill.maker_fee.to_bits(), maker_timestamp: fill.maker_timestamp, taker: fill.taker, diff --git a/programs/mango-v4/src/logs.rs b/programs/mango-v4/src/logs.rs index dff3ae48d..56183a948 100644 --- a/programs/mango-v4/src/logs.rs +++ b/programs/mango-v4/src/logs.rs @@ -100,7 +100,6 @@ pub struct FillLog { pub maker: Pubkey, pub maker_order_id: u128, - pub maker_client_order_id: u64, pub maker_fee: i128, // Timestamp of when the maker order was placed; copied over from the LeafNode diff --git a/programs/mango-v4/src/state/mango_account.rs b/programs/mango-v4/src/state/mango_account.rs index 04472dd4f..2a19e2c72 100644 --- a/programs/mango-v4/src/state/mango_account.rs +++ b/programs/mango-v4/src/state/mango_account.rs @@ -811,6 +811,7 @@ impl< side: Side, order_tree: BookSideOrderTree, order: &LeafNode, + client_order_id: u64, ) -> Result<()> { let mut perp_account = self.perp_position_mut(perp_market_index)?; match side { @@ -827,7 +828,7 @@ impl< oo.market = perp_market_index; oo.side_and_tree = SideAndOrderTree::new(side, order_tree).into(); oo.id = order.key; - oo.client_id = order.client_order_id; + oo.client_id = client_order_id; Ok(()) } diff --git a/programs/mango-v4/src/state/orderbook/book.rs b/programs/mango-v4/src/state/orderbook/book.rs index 723d6dd49..168a6d4dd 100644 --- a/programs/mango-v4/src/state/orderbook/book.rs +++ b/programs/mango-v4/src/state/orderbook/book.rs @@ -180,7 +180,6 @@ impl<'a> Orderbook<'a> { event_queue.header.seq_num, best_opposing.node.owner, best_opposing.node.key, - best_opposing.node.client_order_id, market.maker_fee, best_opposing.node.timestamp, *mango_account_pk, @@ -259,7 +258,6 @@ impl<'a> Orderbook<'a> { order_id, *mango_account_pk, book_base_quantity, - order.client_order_id, now_ts, PostOrderType::Limit, // TODO: Support order types? needed? order.time_in_force, @@ -284,6 +282,7 @@ impl<'a> Orderbook<'a> { side, order_tree_target, &new_order, + order.client_order_id, )?; } diff --git a/programs/mango-v4/src/state/orderbook/bookside.rs b/programs/mango-v4/src/state/orderbook/bookside.rs index f5af2bc82..ac050f7ec 100644 --- a/programs/mango-v4/src/state/orderbook/bookside.rs +++ b/programs/mango-v4/src/state/orderbook/bookside.rs @@ -164,19 +164,8 @@ mod tests { let mut order_tree = new_order_tree(order_tree_type); let mut root_fixed = OrderTreeRoot::zeroed(); let mut root_pegged = OrderTreeRoot::zeroed(); - let new_leaf = |key: u128| { - LeafNode::new( - 0, - key, - Pubkey::default(), - 0, - 0, - 1, - PostOrderType::Limit, - 0, - -1, - ) - }; + let new_leaf = + |key: u128| LeafNode::new(0, key, Pubkey::default(), 0, 1, PostOrderType::Limit, 0, -1); // add 100 leaves to each BookSide, mostly random let mut keys = vec![]; @@ -266,7 +255,6 @@ mod tests { key, Pubkey::default(), 0, - 0, 1000, PostOrderType::Limit, tif, diff --git a/programs/mango-v4/src/state/orderbook/mod.rs b/programs/mango-v4/src/state/orderbook/mod.rs index 15db0b69e..b100075dd 100644 --- a/programs/mango-v4/src/state/orderbook/mod.rs +++ b/programs/mango-v4/src/state/orderbook/mod.rs @@ -383,7 +383,6 @@ mod tests { assert_eq!(fill.quantity, match_quantity); assert_eq!(fill.price, price_lots); assert_eq!(fill.taker_client_order_id, 43); - assert_eq!(fill.maker_client_order_id, 42); assert_eq!(fill.maker, maker_pk); assert_eq!(fill.taker, taker_pk); assert_eq!(fill.maker_fee, market.maker_fee); diff --git a/programs/mango-v4/src/state/orderbook/nodes.rs b/programs/mango-v4/src/state/orderbook/nodes.rs index bb3839744..7dffb2c5a 100644 --- a/programs/mango-v4/src/state/orderbook/nodes.rs +++ b/programs/mango-v4/src/state/orderbook/nodes.rs @@ -140,7 +140,6 @@ pub struct LeafNode { pub owner: Pubkey, pub quantity: i64, - pub client_order_id: u64, // The time the order was placed pub timestamp: u64, @@ -148,11 +147,11 @@ pub struct LeafNode { // Only applicable in the oracle_pegged OrderTree pub peg_limit: i64, - pub reserved: [u8; 32], + pub reserved: [u8; 40], } const_assert_eq!( size_of::(), - 4 + 1 + 1 + 1 + 1 + 16 + 32 + 8 + 8 + 8 + 8 + 32 + 4 + 1 + 1 + 1 + 1 + 16 + 32 + 8 + 8 + 8 + 40 ); const_assert_eq!(size_of::(), NODE_SIZE); const_assert_eq!(size_of::() % 8, 0); @@ -164,7 +163,6 @@ impl LeafNode { key: u128, owner: Pubkey, quantity: i64, - client_order_id: u64, timestamp: u64, order_type: PostOrderType, time_in_force: u16, @@ -180,10 +178,9 @@ impl LeafNode { key, owner, quantity, - client_order_id, timestamp, peg_limit, - reserved: [0; 32], + reserved: [0; 40], } } diff --git a/programs/mango-v4/src/state/orderbook/ordertree.rs b/programs/mango-v4/src/state/orderbook/ordertree.rs index 343ae3491..edd8bc1c8 100644 --- a/programs/mango-v4/src/state/orderbook/ordertree.rs +++ b/programs/mango-v4/src/state/orderbook/ordertree.rs @@ -544,7 +544,6 @@ mod tests { key, Pubkey::default(), 0, - 0, expiry - 1, PostOrderType::Limit, 1, @@ -637,7 +636,6 @@ mod tests { key, Pubkey::default(), 0, - 0, expiry - 1, PostOrderType::Limit, 1, diff --git a/programs/mango-v4/src/state/orderbook/queue.rs b/programs/mango-v4/src/state/orderbook/queue.rs index c8d10f921..63cc77750 100644 --- a/programs/mango-v4/src/state/orderbook/queue.rs +++ b/programs/mango-v4/src/state/orderbook/queue.rs @@ -191,7 +191,6 @@ pub struct FillEvent { pub maker: Pubkey, pub maker_order_id: u128, - pub maker_client_order_id: u64, pub maker_fee: I80F48, // Timestamp of when the maker order was placed; copied over from the LeafNode @@ -204,7 +203,7 @@ pub struct FillEvent { pub price: i64, pub quantity: i64, // number of quote lots - pub reserved: [u8; 16], + pub reserved: [u8; 24], } const_assert_eq!(size_of::() % 8, 0); const_assert_eq!(size_of::(), EVENT_SIZE); @@ -219,7 +218,6 @@ impl FillEvent { seq_num: u64, maker: Pubkey, maker_order_id: u128, - maker_client_order_id: u64, maker_fee: I80F48, maker_timestamp: u64, @@ -241,7 +239,6 @@ impl FillEvent { seq_num, maker, maker_order_id, - maker_client_order_id, maker_fee, maker_timestamp, taker, @@ -250,7 +247,7 @@ impl FillEvent { taker_fee, price, quantity, - reserved: [0; 16], + reserved: [0; 24], } } diff --git a/ts/client/src/accounts/perp.ts b/ts/client/src/accounts/perp.ts index 6c5730c1b..a2ee9f5e2 100644 --- a/ts/client/src/accounts/perp.ts +++ b/ts/client/src/accounts/perp.ts @@ -960,7 +960,6 @@ export interface FillEvent extends Event { seqNum: BN; maker: PublicKey; makerOrderId: BN; - makerClientOrderId: BN; makerFee: I80F48; makerTimestamp: BN; taker: PublicKey; diff --git a/ts/client/src/mango_v4.ts b/ts/client/src/mango_v4.ts index 82f820faa..35026663c 100644 --- a/ts/client/src/mango_v4.ts +++ b/ts/client/src/mango_v4.ts @@ -5442,10 +5442,6 @@ export type MangoV4 = { "name": "quantity", "type": "i64" }, - { - "name": "clientOrderId", - "type": "u64" - }, { "name": "timestamp", "type": "u64" @@ -5459,7 +5455,7 @@ export type MangoV4 = { "type": { "array": [ "u8", - 32 + 40 ] } } @@ -5654,10 +5650,6 @@ export type MangoV4 = { "name": "makerOrderId", "type": "u128" }, - { - "name": "makerClientOrderId", - "type": "u64" - }, { "name": "makerFee", "type": { @@ -5699,7 +5691,7 @@ export type MangoV4 = { "type": { "array": [ "u8", - 16 + 24 ] } } @@ -6506,11 +6498,6 @@ export type MangoV4 = { "type": "u128", "index": false }, - { - "name": "makerClientOrderId", - "type": "u64", - "index": false - }, { "name": "makerFee", "type": "i128", @@ -12799,10 +12786,6 @@ export const IDL: MangoV4 = { "name": "quantity", "type": "i64" }, - { - "name": "clientOrderId", - "type": "u64" - }, { "name": "timestamp", "type": "u64" @@ -12816,7 +12799,7 @@ export const IDL: MangoV4 = { "type": { "array": [ "u8", - 32 + 40 ] } } @@ -13011,10 +12994,6 @@ export const IDL: MangoV4 = { "name": "makerOrderId", "type": "u128" }, - { - "name": "makerClientOrderId", - "type": "u64" - }, { "name": "makerFee", "type": { @@ -13056,7 +13035,7 @@ export const IDL: MangoV4 = { "type": { "array": [ "u8", - 16 + 24 ] } } @@ -13863,11 +13842,6 @@ export const IDL: MangoV4 = { "type": "u128", "index": false }, - { - "name": "makerClientOrderId", - "type": "u64", - "index": false - }, { "name": "makerFee", "type": "i128",