Examples of BitfinexLendDepth


Examples of com.xeiam.xchange.bitfinex.v1.dto.marketdata.BitfinexLendDepth

  @Test
  public void testLendbookMarketData() throws IOException {

    InputStream resourceAsStream = BitfinexMarketDataJSONTest.class.getResourceAsStream("/v1/marketdata/example-marketdepth-lendbook-data.json");
    BitfinexLendDepth lendDepth = new ObjectMapper().readValue(resourceAsStream, BitfinexLendDepth.class);

    assertEquals(lendDepth.getAsks().length, 50);
    assertEquals(lendDepth.getBids().length, 50);
  }
View Full Code Here

Examples of com.xeiam.xchange.bitfinex.v1.dto.marketdata.BitfinexLendDepth

  }

  public BitfinexLendDepth getBitfinexLendBook(String currency, int limitBids, int limitAsks) throws IOException {

    try {
      BitfinexLendDepth bitfinexLendDepth = bitfinex.getLendBook(currency, limitBids, limitAsks);
      return bitfinexLendDepth;
    } catch (BitfinexException e) {
      throw new ExchangeException("Bitfinex returned an error: " + e.getMessage());
    }
  }
View Full Code Here

Examples of com.xeiam.xchange.bitfinex.v1.dto.marketdata.BitfinexLendDepth

      else {
        limitAsks = (Integer) arg1;
      }
    }

    BitfinexLendDepth bitfinexLendDepth = getBitfinexLendBook(currency, limitBids, limitAsks);

    List<FixedRateLoanOrder> fixedRateAsks = BitfinexAdapters.adaptFixedRateLoanOrders(bitfinexLendDepth.getAsks(), currency, "ask", "");
    List<FixedRateLoanOrder> fixedRateBids = BitfinexAdapters.adaptFixedRateLoanOrders(bitfinexLendDepth.getBids(), currency, "bid", "");
    List<FloatingRateLoanOrder> floatingRateAsks = BitfinexAdapters.adaptFloatingRateLoanOrders(bitfinexLendDepth.getAsks(), currency, "ask", "");
    List<FloatingRateLoanOrder> floatingRateBids = BitfinexAdapters.adaptFloatingRateLoanOrders(bitfinexLendDepth.getBids(), currency, "bid", "");

    return new LoanOrderBook(null, fixedRateAsks, fixedRateBids, floatingRateAsks, floatingRateBids);
  }
View Full Code Here

Examples of com.xeiam.xchange.bitfinex.v1.dto.marketdata.BitfinexLendDepth

  }

  private static void raw(BitfinexMarketDataServiceRaw marketDataService) throws IOException {

    // Get the latest order book data for USD swaps
    BitfinexLendDepth bitfinexDepth = marketDataService.getBitfinexLendBook("USD", 50, 50);

    System.out.println("Current Order Book size for USD: " + (bitfinexDepth.getAsks().length + bitfinexDepth.getBids().length));

    System.out.println("First Ask: " + bitfinexDepth.getAsks()[0].toString());

    System.out.println("First Bid: " + bitfinexDepth.getBids()[0].toString());

    System.out.println(bitfinexDepth.toString());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.