public static FloatingRateLoanOrder adaptFloatingRateLoanOrder( String currency, BigDecimal amount, int dayPeriod, String direction, String id, BigDecimal rate) { OrderType orderType = direction.equalsIgnoreCase("loan") ? OrderType.BID : OrderType.ASK; return new FloatingRateLoanOrder(orderType, currency, amount, dayPeriod, id, null, rate); }
boolean rateChanged = false; switch (updatedLoanOrder.getType()) { case ASK: it = floatingRateAsks.iterator(); while (it.hasNext()) { FloatingRateLoanOrder order = it.next(); if (order.getDayPeriod() == updatedLoanOrder.getDayPeriod()) { it.remove(); if (!order.getRate().equals(updatedLoanOrder.getRate()) && !rateChanged) { rateChanged = true; while (it.hasNext()) { FloatingRateLoanOrder order = it.next(); if (order.getDayPeriod() == updatedLoanOrder.getDayPeriod()) { it.remove(); if (!order.getRate().equals(updatedLoanOrder.getRate()) && !rateChanged) { rateChanged = true; order.setRate(updatedLoanOrder.getRate()); order.setRate(updatedLoanOrder.getRate()); updateTimestamp(updatedLoanOrder.getTimestamp());
public BitfinexOfferStatusResponse placeBitfinexFloatingRateLoanOrder( FloatingRateLoanOrder loanOrder, BitfinexOrderType orderType) throws IOException { String direction = loanOrder.getType() == OrderType.BID ? "loan" : "lend"; BitfinexOfferStatusResponse newOrderResponse = bitfinex.newOffer( apiKey, payloadCreator, signatureCreator, new BitfinexNewOfferRequest( String.valueOf(exchange.getNonceFactory().createValue()), loanOrder.getCurrency(), loanOrder.getOriginalAmount(), new BigDecimal("0.0"), loanOrder.getDayPeriod(), direction)); return newOrderResponse; }
@Override public int compareTo(FloatingRateLoanOrder order) { return this.getDayPeriod() - order.getDayPeriod(); } }
@Override public int compareTo(FloatingRateLoanOrder order) { return this.getDayPeriod() - order.getDayPeriod(); } }
boolean rateChanged = false; switch (updatedLoanOrder.getType()) { case ASK: it = floatingRateAsks.iterator(); while (it.hasNext()) { FloatingRateLoanOrder order = it.next(); if (order.getDayPeriod() == updatedLoanOrder.getDayPeriod()) { it.remove(); if (!order.getRate().equals(updatedLoanOrder.getRate()) && !rateChanged) { rateChanged = true; while (it.hasNext()) { FloatingRateLoanOrder order = it.next(); if (order.getDayPeriod() == updatedLoanOrder.getDayPeriod()) { it.remove(); if (!order.getRate().equals(updatedLoanOrder.getRate()) && !rateChanged) { rateChanged = true; order.setRate(updatedLoanOrder.getRate()); order.setRate(updatedLoanOrder.getRate()); updateTimestamp(updatedLoanOrder.getTimestamp());
public BitfinexOfferStatusResponse placeBitfinexFloatingRateLoanOrder( FloatingRateLoanOrder loanOrder, BitfinexOrderType orderType) throws IOException { String direction = loanOrder.getType() == OrderType.BID ? "loan" : "lend"; BitfinexOfferStatusResponse newOrderResponse = bitfinex.newOffer( apiKey, payloadCreator, signatureCreator, new BitfinexNewOfferRequest( String.valueOf(exchange.getNonceFactory().createValue()), loanOrder.getCurrency(), loanOrder.getOriginalAmount(), new BigDecimal("0.0"), loanOrder.getDayPeriod(), direction)); return newOrderResponse; }
public static FloatingRateLoanOrder adaptFloatingRateLoanOrder( String currency, BigDecimal amount, int dayPeriod, String direction, String id, BigDecimal rate) { OrderType orderType = direction.equalsIgnoreCase("loan") ? OrderType.BID : OrderType.ASK; return new FloatingRateLoanOrder(orderType, currency, amount, dayPeriod, id, null, rate); }
new FloatingRateLoanOrder( OrderType.BID, "USD", new BigDecimal("0.01"), 2, "", null, BigDecimal.ZERO), BitfinexOrderType.MARKET);
public static FloatingRateLoanOrder adaptFloatingRateLoanOrder( String currency, BigDecimal amount, int dayPeriod, String direction, String id, BigDecimal rate) { OrderType orderType = direction.equalsIgnoreCase("loan") ? OrderType.BID : OrderType.ASK; return new FloatingRateLoanOrder(orderType, currency, amount, dayPeriod, id, null, rate); }
public static FloatingRateLoanOrder adaptFloatingRateLoanOrder( String currency, BigDecimal amount, int dayPeriod, String direction, String id, BigDecimal rate) { OrderType orderType = direction.equalsIgnoreCase("loan") ? OrderType.BID : OrderType.ASK; return new FloatingRateLoanOrder(orderType, currency, amount, dayPeriod, id, null, rate); }