class FtxTradeService extends FtxTradeServiceRaw implements TradeService {

  public FtxTradeService(Exchange exchange) {
    super(exchange);
  }

  @Override
  public String placeMarketOrder(MarketOrder marketOrder) throws IOException {
    return placeMarketOrderForSubaccount(
        exchange.getExchangeSpecification().getUserName(), marketOrder);
  }

  @Override
  public String placeLimitOrder(LimitOrder limitOrder) throws IOException {
    return placeLimitOrderForSubaccount(
        exchange.getExchangeSpecification().getUserName(), limitOrder);
  }

  @Override
  public String placeStopOrder(StopOrder stopOrder) throws IOException {
    return placeStopOrderForSubAccount(
        exchange.getExchangeSpecification().getUserName(), stopOrder);
  }

  @Override
  public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException {
    return getTradeHistoryForSubaccount(exchange.getExchangeSpecification().getUserName(), params);
  }

  @Override
  public Collection<String> cancelAllOrders(CancelAllOrders orderParams) throws IOException {
    if (orderParams instanceof CancelAllFtxOrdersParams) {
      cancelAllFtxOrders(
          exchange.getExchangeSpecification().getUserName(),
          (CancelAllFtxOrdersParams) orderParams);
      return Collections.singletonList("");
    } else {
      throw new IOException(
          "Cancel all orders supports only " + CancelAllFtxOrdersParams.class.getSimpleName());
    }
  }

  @Override
  public boolean cancelOrder(String orderId) throws IOException {
    return cancelOrderForSubaccount(exchange.getExchangeSpecification().getUserName(), orderId);
  }

  @Override
  public boolean cancelOrder(CancelOrderParams orderParams) throws IOException {
    return cancelOrderForSubaccount(exchange.getExchangeSpecification().getUserName(), orderParams);
  }

  @Override
  public Class[] getRequiredCancelOrderParamClasses() {
    return new Class[] {CancelOrderByCurrencyPair.class, CancelOrderByUserReferenceParams.class};
  }

  @Override
  public Collection<Order> getOrder(String... orderIds) throws IOException {
    return getOrderFromSubaccount(exchange.getExchangeSpecification().getUserName(), orderIds);
  }

  @Override
  public Collection<Order> getOrder(OrderQueryParams... orderQueryParams) throws IOException {
    return getOrderFromSubaccount(
        exchange.getExchangeSpecification().getUserName(),
        TradeService.toOrderIds(orderQueryParams));
  }

  @Override
  public OpenOrders getOpenOrders(OpenOrdersParams params) throws IOException {
    return getOpenOrdersForSubaccount(exchange.getExchangeSpecification().getUserName(), params);
  }

  @Override
  public OpenOrders getOpenOrders() throws IOException {
    return getOpenOrdersForSubaccount(exchange.getExchangeSpecification().getUserName());
  }

  @Override
  public OpenPositions getOpenPositions() throws IOException {
    return getOpenPositionsForSubaccount(exchange.getExchangeSpecification().getUserName());
  }

  @Override
  public String changeOrder(LimitOrder limitOrder) throws IOException {<FILL_FUNCTION_BODY>}
}

    if (limitOrder.getUserReference() != null) {
      return modifyFtxOrderByClientId(
              exchange.getExchangeSpecification().getUserName(),
              limitOrder.getId(),
              FtxAdapters.adaptModifyOrderToFtxOrderPayload(limitOrder))
          .getResult()
          .getClientId();
    } else {
      return modifyFtxOrder(
              exchange.getExchangeSpecification().getUserName(),
              limitOrder.getId(),
              FtxAdapters.adaptModifyOrderToFtxOrderPayload(limitOrder))
          .getResult()
          .getId();
    }
  
<methods>public void <init>(org.knowm.xchange.Exchange) ,public boolean cancelAllFtxOrders(java.lang.String, org.knowm.xchange.ftx.dto.trade.CancelAllFtxOrdersParams) throws java.io.IOException,public boolean cancelFtxByClientId(java.lang.String, java.lang.String) throws java.io.IOException,public boolean cancelFtxConditionalOrderForSubAccount(java.lang.String, java.lang.String) throws java.io.IOException,public boolean cancelFtxOrder(java.lang.String, java.lang.String) throws java.io.IOException,public boolean cancelOrderForSubaccount(java.lang.String, java.lang.String) throws java.io.IOException,public boolean cancelOrderForSubaccount(java.lang.String, org.knowm.xchange.service.trade.params.CancelOrderParams) throws java.io.IOException,public boolean cancelStopOrder(java.lang.String) throws java.io.IOException,public java.lang.String changeStopOrder(org.knowm.xchange.dto.trade.StopOrder) throws java.io.IOException,public FtxResponse<List<org.knowm.xchange.ftx.dto.trade.FtxOrderDto>> getFtxAllOpenOrdersForSubaccount(java.lang.String) throws java.io.IOException,public FtxResponse<List<org.knowm.xchange.ftx.dto.trade.FtxConditionalOrderDto>> getFtxConditionalOrderHistory(java.lang.String, java.lang.String) throws java.io.IOException,public FtxResponse<List<org.knowm.xchange.ftx.dto.trade.FtxFillDto>> getFtxFills(java.lang.String, java.lang.String, java.lang.Long, java.lang.Long) throws java.io.IOException,public FtxResponse<List<org.knowm.xchange.ftx.dto.trade.FtxConditionalOrderDto>> getFtxOpenConditionalOrdersForSubAccount(java.lang.String, java.lang.String) throws java.io.IOException,public FtxResponse<List<org.knowm.xchange.ftx.dto.trade.FtxOrderDto>> getFtxOpenOrders(java.lang.String, java.lang.String) throws java.io.IOException,public FtxResponse<List<org.knowm.xchange.ftx.dto.trade.FtxOrderDto>> getFtxOrderHistory(java.lang.String, java.lang.String, java.lang.Long, java.lang.Long) throws java.io.IOException,public FtxResponse<org.knowm.xchange.ftx.dto.trade.FtxOrderDto> getFtxOrderStatus(java.lang.String, java.lang.String) throws java.io.IOException,public FtxResponse<List<org.knowm.xchange.ftx.dto.account.FtxPositionDto>> getFtxPositions(java.lang.String) throws java.io.IOException,public List<org.knowm.xchange.ftx.dto.trade.FtxTriggerDto> getFtxTriggers(java.lang.String) throws java.io.IOException,public FtxResponse<List<org.knowm.xchange.ftx.dto.trade.FtxTriggerDto>> getFtxTriggersForSubAccount(java.lang.String, java.lang.String) throws java.io.IOException,public org.knowm.xchange.dto.trade.OpenOrders getOpenOrdersForSubaccount(java.lang.String) throws java.io.IOException,public org.knowm.xchange.dto.trade.OpenOrders getOpenOrdersForSubaccount(java.lang.String, org.knowm.xchange.service.trade.params.orders.OpenOrdersParams) throws java.io.IOException,public org.knowm.xchange.dto.account.OpenPositions getOpenPositionsForSubaccount(java.lang.String) throws java.io.IOException,public transient Collection<org.knowm.xchange.dto.Order> getOrderFromSubaccount(java.lang.String, java.lang.String[]) throws java.io.IOException,public org.knowm.xchange.dto.trade.OpenOrders getOrderHistoryForSubaccount(java.lang.String, org.knowm.xchange.service.trade.params.TradeHistoryParams) throws java.io.IOException,public org.knowm.xchange.dto.trade.UserTrades getTradeHistoryForSubaccount(java.lang.String, org.knowm.xchange.service.trade.params.TradeHistoryParams) throws java.io.IOException,public FtxResponse<org.knowm.xchange.ftx.dto.trade.FtxConditionalOrderDto> modifyFtxConditionalOrderForSubAccount(java.lang.String, java.lang.String, org.knowm.xchange.ftx.dto.trade.FtxModifyConditionalOrderRequestPayload) throws java.io.IOException,public FtxResponse<org.knowm.xchange.ftx.dto.trade.FtxOrderDto> modifyFtxOrder(java.lang.String, java.lang.String, org.knowm.xchange.ftx.dto.trade.FtxModifyOrderRequestPayload) throws java.io.IOException,public FtxResponse<org.knowm.xchange.ftx.dto.trade.FtxOrderDto> modifyFtxOrderByClientId(java.lang.String, java.lang.String, org.knowm.xchange.ftx.dto.trade.FtxModifyOrderRequestPayload) throws java.io.IOException,public java.lang.String placeLimitOrderForSubaccount(java.lang.String, org.knowm.xchange.dto.trade.LimitOrder) throws java.io.IOException,public java.lang.String placeMarketOrderForSubaccount(java.lang.String, org.knowm.xchange.dto.trade.MarketOrder) throws java.io.IOException,public FtxResponse<org.knowm.xchange.ftx.dto.trade.FtxConditionalOrderDto> placeNewFtxConditionalOrderForSubAccount(java.lang.String, org.knowm.xchange.ftx.dto.trade.FtxConditionalOrderRequestPayload) throws java.io.IOException,public FtxResponse<org.knowm.xchange.ftx.dto.trade.FtxOrderDto> placeNewFtxOrder(java.lang.String, org.knowm.xchange.ftx.dto.trade.FtxOrderRequestPayload) throws java.io.IOException,public java.lang.String placeStopOrderForSubAccount(java.lang.String, org.knowm.xchange.dto.trade.StopOrder) throws java.io.IOException<variables>