Class TradeDTO


  • public 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 costs 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
    • Constructor Detail

      • TradeDTO

        protected TradeDTO​(TradeDTO.Builder builder)
        Builder constructor.
        Parameters:
        builder - builder
    • Method Detail

      • builder

        public static TradeDTO.Builder builder()
        Returns builder.
        Returns:
        builder
      • getId

        public final String getId()
        Getter for id.
        Returns:
        id
      • getOrderId

        public final String getOrderId()
        Getter for orderId.
        Returns:
        orderId
      • getType

        public final OrderTypeDTO getType()
        Getter for type.
        Returns:
        type
      • getOriginalAmount

        public final BigDecimal getOriginalAmount()
        Getter for originalAmount.
        Returns:
        originalAmount
      • getCurrencyPair

        public final CurrencyPairDTO getCurrencyPair()
        Getter for currencyPair.
        Returns:
        currencyPair
      • getPrice

        public final BigDecimal getPrice()
        Getter for price.
        Returns:
        price
      • getTimestamp

        public final ZonedDateTime getTimestamp()
        Getter for timestamp.
        Returns:
        timestamp
      • hashCode

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