Class TradeDTO


  • public final class TradeDTO
    extends Object
    DTO representing a trade. A trade is the action of buying and selling goods and services.

    This is how it works : - Received ticker - It means 1 Ether can be bought with 0.034797 Bitcoin currencyPair=ETH/BTC last=0.034797 (Last trade field is the price set during the last trade).

    - Account before buying BTC : 0.99963006 ETH : 10

    - Buying 0.004 Bitcoin (should cost 0.05748 ether). TradeDTO{currencyPair=ETH/BTC, originalAmount=0.004, price=0.034797}

    - Account after buying BTC : 0.99949078 ETH : 10.004 It cost me 0.00013928 BTC (0.99949078 - 0.99963006). price * amount = 0.034797 * 0.004

    • Method Detail

      • getAmountValue

        public BigDecimal getAmountValue()
        Returns amount value.
        Returns:
        amount value
      • getPriceValue

        public BigDecimal getPriceValue()
        Returns price value.
        Returns:
        price value
      • getFeeValue

        public BigDecimal getFeeValue()
        Returns fee value.
        Returns:
        fee value
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • getId

        public Long getId()
        Technical id.
      • getTradeId

        public String getTradeId()
        An identifier set by the exchange that uniquely identifies the trade.
      • getType

        public OrderTypeDTO getType()
        Order type i.e. bid (buy) or ask (sell).
      • getOrderId

        public String getOrderId()
        The order id of the order responsible for this trade.
      • getOrder

        public Order getOrder()
        The order responsible for this trade.
      • getCurrencyPair

        public CurrencyPairDTO getCurrencyPair()
        Currency pair.
      • getFee

        public CurrencyAmountDTO getFee()
        The fee that was charged by the exchange for this order.
      • getUserReference

        public String getUserReference()
        An identifier provided by the user on placement that uniquely identifies the order.
      • getTimestamp

        public ZonedDateTime getTimestamp()
        The timestamp of the trade.