use of org.knowm.xchange.lgo.dto.product.LgoProductCurrency in project XChange by knowm.
the class LgoTradeService method verifyOrder.
@Override
public void verifyOrder(MarketOrder marketOrder) {
LgoProduct product = getProduct(marketOrder.getCurrencyPair());
LgoProductCurrency currencyToCheck = OrderType.BID.equals(marketOrder.getType()) ? product.getQuote() : product.getBase();
if (currencyToCheck.getLimits().getMin().compareTo(marketOrder.getRemainingAmount()) > 0) {
throw new IllegalArgumentException("Quantity to low");
}
if (currencyToCheck.getLimits().getMax().compareTo(marketOrder.getRemainingAmount()) < 0) {
throw new IllegalArgumentException("Quantity to high");
}
}
Aggregations