Skip to content

Commit

Permalink
Add metaplex manager to Phoenix test, for symbol resolution.
Browse files Browse the repository at this point in the history
  • Loading branch information
skynetcap committed Nov 28, 2023
1 parent 0f30238 commit d6e9f47
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions phoenix/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
<version>1.19.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.mmorrell</groupId>
<artifactId>metaplex</artifactId>
<version>1.19.0</version>
<scope>test</scope>
</dependency>
</dependencies>

</project>
6 changes: 6 additions & 0 deletions phoenix/src/test/java/PhoenixTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.google.common.io.Files;
import com.google.common.io.Resources;
import com.mmorrell.metaplex.manager.MetaplexManager;
import com.mmorrell.phoenix.manager.PhoenixManager;
import com.mmorrell.phoenix.model.LimitOrderPacketRecord;
import com.mmorrell.phoenix.model.PhoenixMarket;
Expand Down Expand Up @@ -72,8 +73,13 @@ public void phoenixGetMarketsTest() throws RpcException {
@Test
public void orderNormalizedTest() {
PhoenixManager phoenixManager = new PhoenixManager(client);
MetaplexManager metaplexManager = new MetaplexManager(client);
phoenixManager.getPhoenixMarkets().forEach(market -> {
log.info("Market: {}", market.getMarketId().toBase58());
metaplexManager.getTokenMetadata(market.getPhoenixMarketHeader().getBaseMintKey()).ifPresent(metadata -> log.info("Base token: {}", metadata.getSymbol()));
metaplexManager.getTokenMetadata(market.getPhoenixMarketHeader().getQuoteMintKey()).ifPresent(metadata -> log.info(
"Quote token: {}", metadata.getSymbol()));

// log.info("Detail: {}", market);
market.getBidListNormalized().forEach(phoenixOrder -> {
log.info(String.format("Bid: %.10f x %.4f, Trader: %s", phoenixOrder.getPrice(),
Expand Down

0 comments on commit d6e9f47

Please sign in to comment.