Skip to content

Commit

Permalink
Phoenix: add PhoenixMarket
Browse files Browse the repository at this point in the history
  • Loading branch information
skynetcap committed Nov 19, 2023
1 parent e395937 commit a3280bb
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,23 @@
@Builder
public class PhoenixMarket {

// B trees start at offset 880
private static final int START_OFFSET = 832;
private long baseLotsPerBaseUnit;
private long tickSizeInQuoteLotsPerBaseUnit;
private long orderSequenceNumber;
private long takerFeeBps;
private long collectedQuoteLotFees;
private long unclaimedQuoteLotFees;

public static PhoenixMarket readPhoenixMarket(byte[] data) {
PhoenixMarket phoenixMarket = PhoenixMarket.builder()
.baseLotsPerBaseUnit(Utils.readInt64(data, START_OFFSET))
.tickSizeInQuoteLotsPerBaseUnit(Utils.readInt64(data, START_OFFSET + 8))
.orderSequenceNumber(Utils.readInt64(data, START_OFFSET + 16))
.takerFeeBps(Utils.readInt64(data, START_OFFSET + 24))
.collectedQuoteLotFees(Utils.readInt64(data, START_OFFSET + 32))
.unclaimedQuoteLotFees(Utils.readInt64(data, START_OFFSET + 40))
.build();

return phoenixMarket;
Expand Down

0 comments on commit a3280bb

Please sign in to comment.