Skip to content

Commit

Permalink
Phoenix: Add placeMultiplePostOnlyOrders
Browse files Browse the repository at this point in the history
  • Loading branch information
skynetcap committed Nov 29, 2023
1 parent fa938e0 commit 781dc91
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions phoenix/src/test/java/PhoenixTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public void placeMultiplePostOnlyOrdersTest() throws IOException, RpcException {
PhoenixMarket market = marketOptional.get();

List<CondensedPhoenixOrder> bidsToPlace = new ArrayList<>();
for (int i = 0; i < 8; i++) {
double price = 13.37 + (i * 0.01);
for (int i = 0; i < 20; i++) {
double price = 59.00 + (i * 0.01);
bidsToPlace.add(
CondensedPhoenixOrder.builder()
.sizeInBaseLots(market.convertSizeToNumBaseLots(0.001))
Expand All @@ -110,8 +110,19 @@ public void placeMultiplePostOnlyOrdersTest() throws IOException, RpcException {
);
}

List<CondensedPhoenixOrder> asksToPlace = new ArrayList<>();
for (int i = 0; i < 20; i++) {
double price = 60 + (i * 0.01);
asksToPlace.add(
CondensedPhoenixOrder.builder()
.sizeInBaseLots(market.convertSizeToNumBaseLots(0.001))
.priceInTicks(market.convertPriceToPriceInTicks(price))
.build()
);
}

MultipleOrderPacketRecord multipleOrderPacketRecord = MultipleOrderPacketRecord.builder()
.asks(Collections.emptyList())
.asks(asksToPlace)
.bids(bidsToPlace)
.build();

Expand All @@ -124,7 +135,7 @@ public void placeMultiplePostOnlyOrdersTest() throws IOException, RpcException {

orderTx.addInstruction(
ComputeBudgetProgram.setComputeUnitLimit(
130_000
530_000
)
);

Expand Down

0 comments on commit 781dc91

Please sign in to comment.