Examples of FixedRateLoanOrder


Examples of com.xeiam.xchange.dto.trade.FixedRateLoanOrder

  public static FixedRateLoanOrder adaptFixedRateLoanOrder(String currency, BigDecimal amount, int dayPeriod, String direction, String id, BigDecimal rate) {

    OrderType orderType = direction.equalsIgnoreCase("loan") ? OrderType.BID : OrderType.ASK;

    return new FixedRateLoanOrder(orderType, currency, amount, dayPeriod, id, null, rate);
  }
View Full Code Here

Examples of com.xeiam.xchange.dto.trade.FixedRateLoanOrder

    switch (updatedLoanOrder.getType()) {
    case ASK:

      it = fixedRateAsks.iterator();
      while (it.hasNext()) {
        FixedRateLoanOrder order = it.next();
        if (order.getRate().equals(updatedLoanOrder.getRate()) && order.getDayPeriod() == updatedLoanOrder.getDayPeriod()) {
          it.remove();
          break;
        }
      }
      fixedRateAsks.add(updatedLoanOrder);
      Collections.sort(fixedRateAsks);
      break;
    case BID:

      it = fixedRateBids.iterator();
      while (it.hasNext()) {
        FixedRateLoanOrder order = it.next();
        if (order.getRate().equals(updatedLoanOrder.getRate()) && order.getDayPeriod() == updatedLoanOrder.getDayPeriod()) {
          it.remove();
          break;
        }
      }
      fixedRateBids.add(updatedLoanOrder);
View Full Code Here

Examples of com.xeiam.xchange.dto.trade.FixedRateLoanOrder

  private static void raw(Exchange bfx) throws IOException {

    BitfinexTradeServiceRaw tradeService = (BitfinexTradeServiceRaw) bfx.getPollingTradeService();

    BitfinexOfferStatusResponse fixedRateResponse =
        tradeService.placeBitfinexFixedRateLoanOrder(new FixedRateLoanOrder(OrderType.BID, "USD", new BigDecimal("0.01"), 2, "", null, new BigDecimal("0.01")), BitfinexOrderType.LIMIT);
    System.out.println("Fixed rate order response: " + fixedRateResponse);

    BitfinexOfferStatusResponse floatingRateResponse =
        tradeService.placeBitfinexFloatingRateLoanOrder(new FloatingRateLoanOrder(OrderType.BID, "USD", new BigDecimal("0.01"), 2, "", null, BigDecimal.ZERO), BitfinexOrderType.MARKET);
    System.out.println("Floating rate order response: " + floatingRateResponse);
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.