Class SerumAdapters

java.lang.Object
com.knowm.xchange.serum.SerumAdapters

public class SerumAdapters
extends Object
  • Constructor Details

    • SerumAdapters

      public SerumAdapters()
  • Method Details

    • loadMarkets

      public static void loadMarkets​(SerumMarketDataServiceRaw raw) throws Exception
      Serum represents markets as individual Solana addresses. As part of starting up the the scaffold for Serum we load all the "markets" from the REST api and associate currency pairs to their addresses and metadata.

      The markets file maintained in XChange should mirror the one found: https://github.com/project-serum/serum-ts/blob/master/packages/serum/src/markets.json

      Parameters:
      raw - service to use to query for data
      Throws:
      Exception
    • toSolanaAddress

      public static String toSolanaAddress​(CurrencyPair pair)
      Extracts the address associated to a currency pair
      Parameters:
      pair - to query address for
      Returns:
      address as string
    • getSolanaDataTypeAddress

      public static String getSolanaDataTypeAddress​(CurrencyPair pair, String dataType)
      Extracts the address associated to a currency pair's specific data type. Serum manages the different parts of an order's lifecycle by using different addresses. e.g.

      request queue (submitted orders) event queue (fills) bids (orderbook bids) asks (orderbook asks)

      Parameters:
      pair - to query address for
      Returns:
      address as string
    • getMarket

      public static Market getMarket​(CurrencyPair pair)