Interface TradeService

    • Method Detail

      • createBuyMarketOrder

        OrderCreationResultDTO createBuyMarketOrder​(CurrencyPairDTO currencyPair,
                                                    BigDecimal amount)
        Creates a buy market order.
        Parameters:
        currencyPair - currency pair
        amount - amount
        Returns:
        order result (order id or error)
      • createSellMarketOrder

        OrderCreationResultDTO createSellMarketOrder​(CurrencyPairDTO currencyPair,
                                                     BigDecimal amount)
        Creates a sell market order.
        Parameters:
        currencyPair - currency pair
        amount - amount
        Returns:
        order result (order id or error)
      • createBuyLimitOrder

        OrderCreationResultDTO createBuyLimitOrder​(CurrencyPairDTO currencyPair,
                                                   BigDecimal amount,
                                                   BigDecimal limitPrice)
        Creates a buy limit order.
        Parameters:
        currencyPair - currency pair
        amount - amount
        limitPrice - the highest acceptable price
        Returns:
        order result (order id or error)
      • createSellLimitOrder

        OrderCreationResultDTO createSellLimitOrder​(CurrencyPairDTO currencyPair,
                                                    BigDecimal amount,
                                                    BigDecimal limitPrice)
        Creates a sell limit order.
        Parameters:
        currencyPair - currency pair
        amount - amount
        limitPrice - the lowest acceptable price
        Returns:
        order result (order id or error)
      • getOpenOrderByOrderId

        Optional<OrderDTO> getOpenOrderByOrderId​(String orderId)
        Get an open order by its id.
        Parameters:
        orderId - order id
        Returns:
        order
      • getOpenOrders

        Set<OrderDTO> getOpenOrders()
        Get open orders.
        Returns:
        list of open orders
      • cancelOrder

        boolean cancelOrder​(String orderId)
        Cancel order.
        Parameters:
        orderId - order id
        Returns:
        true if cancelled
      • getTrades

        Set<TradeDTO> getTrades()
        Get last week trades.
        Returns:
        trades