Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E Tests for Replacement RO Orders, allow all types of RO order replacements #949

Merged
merged 4 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions protocol/testutil/constants/orders.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,20 @@ var (
Subticks: 50,
GoodTilOneof: &clobtypes.Order_GoodTilBlock{GoodTilBlock: 30},
}
Order_Alice_Num1_Id0_Clob0_Sell100_Price50000_GTB20 = clobtypes.Order{
OrderId: clobtypes.OrderId{SubaccountId: Alice_Num1, ClientId: 0, ClobPairId: 0},
Side: clobtypes.Order_SIDE_SELL,
Quantums: 10,
Subticks: 500_000_000_000,
GoodTilOneof: &clobtypes.Order_GoodTilBlock{GoodTilBlock: 20},
}
Order_Alice_Num1_Id0_Clob0_Sell100_Price100000_GTB20 = clobtypes.Order{
OrderId: clobtypes.OrderId{SubaccountId: Alice_Num1, ClientId: 0, ClobPairId: 0},
Side: clobtypes.Order_SIDE_SELL,
Quantums: 10,
Subticks: 1_000_000_000_000,
GoodTilOneof: &clobtypes.Order_GoodTilBlock{GoodTilBlock: 20},
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The declaration for Order_Bob_Num0_Id0_Clob1_Sell10_Price15_GTB20 is incomplete in the provided code snippet. Please provide the full order declaration to ensure all necessary fields are set correctly.

Order_Bob_Num0_Id0_Clob1_Sell10_Price15_GTB20 = clobtypes.Order{
OrderId: clobtypes.OrderId{SubaccountId: Bob_Num0, ClientId: 0, ClobPairId: 1},
Side: clobtypes.Order_SIDE_SELL,
Expand Down Expand Up @@ -617,6 +631,20 @@ var (
Subticks: 500_000_000_000,
GoodTilOneof: &clobtypes.Order_GoodTilBlock{GoodTilBlock: 20},
}
Order_Carl_Num0_Id0_Clob0_Buy10_Price50000_GTB20 = clobtypes.Order{
OrderId: clobtypes.OrderId{SubaccountId: Carl_Num0, ClientId: 0, ClobPairId: 0},
Side: clobtypes.Order_SIDE_BUY,
Quantums: 10,
Subticks: 500_000_000_000,
GoodTilOneof: &clobtypes.Order_GoodTilBlock{GoodTilBlock: 20},
}
Order_Carl_Num0_Id0_Clob0_Buy110_Price50000_GTB20 = clobtypes.Order{
OrderId: clobtypes.OrderId{SubaccountId: Carl_Num0, ClientId: 0, ClobPairId: 0},
Side: clobtypes.Order_SIDE_BUY,
Quantums: 110,
Subticks: 500_000_000_000,
GoodTilOneof: &clobtypes.Order_GoodTilBlock{GoodTilBlock: 20},
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the previous comment for Bob's order, the declaration for Order_Carl_Num0_Id2_Clob0_Sell5_Price10_GTB15 is incomplete. Please ensure that the full order declaration is provided for review.

Comment on lines +669 to +682
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order declarations for Carl's orders continue here, and the structure is consistent with the expected format. However, the declaration for Order_Carl_Num0_Id2_Clob0_Sell5_Price10_GTB15 is incomplete. Please provide the full order declaration to ensure all necessary fields are set correctly.

Order_Carl_Num0_Id2_Clob0_Sell5_Price10_GTB15 = clobtypes.Order{
OrderId: clobtypes.OrderId{SubaccountId: Carl_Num0, ClientId: 2, ClobPairId: 0},
Side: clobtypes.Order_SIDE_SELL,
Expand Down Expand Up @@ -1158,6 +1186,24 @@ var (
TimeInForce: clobtypes.Order_TIME_IN_FORCE_FILL_OR_KILL,
ReduceOnly: true,
}
Order_Alice_Num1_Id0_Clob0_Buy110_Price50000_GTB21_FOK_RO = clobtypes.Order{
OrderId: clobtypes.OrderId{SubaccountId: Alice_Num1, ClientId: 0, ClobPairId: 0},
Side: clobtypes.Order_SIDE_BUY,
Quantums: 110,
Subticks: 500_000_000_000,
GoodTilOneof: &clobtypes.Order_GoodTilBlock{GoodTilBlock: 21},
TimeInForce: clobtypes.Order_TIME_IN_FORCE_FILL_OR_KILL,
ReduceOnly: true,
}
Order_Alice_Num1_Id0_Clob0_Sell110_Price50000_GTB21_FOK_RO = clobtypes.Order{
OrderId: clobtypes.OrderId{SubaccountId: Alice_Num1, ClientId: 0, ClobPairId: 0},
Side: clobtypes.Order_SIDE_SELL,
Quantums: 110,
Subticks: 500_000_000_000,
GoodTilOneof: &clobtypes.Order_GoodTilBlock{GoodTilBlock: 21},
TimeInForce: clobtypes.Order_TIME_IN_FORCE_FILL_OR_KILL,
ReduceOnly: true,
}
// IOC + RO orders.
Order_Alice_Num1_Id1_Clob1_Sell10_Price15_GTB20_IOC_RO = clobtypes.Order{
OrderId: clobtypes.OrderId{SubaccountId: Alice_Num1, ClientId: 1, ClobPairId: 1},
Expand Down Expand Up @@ -1204,6 +1250,15 @@ var (
TimeInForce: clobtypes.Order_TIME_IN_FORCE_IOC,
ReduceOnly: true,
}
Order_Alice_Num1_Id0_Clob0_Sell110_Price50000_GTB21_IOC_RO = clobtypes.Order{
OrderId: clobtypes.OrderId{SubaccountId: Alice_Num1, ClientId: 0, ClobPairId: 0},
Side: clobtypes.Order_SIDE_SELL,
Quantums: 110,
Subticks: 500_000_000_000,
GoodTilOneof: &clobtypes.Order_GoodTilBlock{GoodTilBlock: 21},
TimeInForce: clobtypes.Order_TIME_IN_FORCE_IOC,
ReduceOnly: true,
}

// Reduce-only orders.
Order_Alice_Num1_Id1_Clob0_Sell10_Price15_GTB20_RO = clobtypes.Order{
Expand Down
Loading
Loading