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 f187648 commit fa938e0
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions phoenix/src/test/java/PhoenixTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.Collections;
Expand Down Expand Up @@ -96,18 +97,22 @@ public void placeMultiplePostOnlyOrdersTest() throws IOException, RpcException {
log.error("Unable to get market for test.");
return;
}

PhoenixMarket market = marketOptional.get();

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

MultipleOrderPacketRecord multipleOrderPacketRecord = MultipleOrderPacketRecord.builder()
.asks(Collections.emptyList())
.bids(
List.of(
CondensedPhoenixOrder.builder()
.sizeInBaseLots(market.convertSizeToNumBaseLots(0.001))
.priceInTicks(market.convertPriceToPriceInTicks(13.37))
.build()
)
)
.bids(bidsToPlace)
.build();

Transaction orderTx = new Transaction();
Expand Down

0 comments on commit fa938e0

Please sign in to comment.