diff --git a/pom.xml b/pom.xml
index b588f7180f0..b39a16debb3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,7 +84,6 @@
xchange-enigma
xchange-examples
xchange-exmo
- xchange-ftx
xchange-gateio
xchange-gateio-v4
xchange-gemini
@@ -133,7 +132,6 @@
xchange-stream-coinmate
xchange-stream-core
xchange-stream-dydx
- xchange-stream-ftx
xchange-stream-gateio
xchange-stream-gemini
xchange-stream-gemini-v2
diff --git a/xchange-ftx/pom.xml b/xchange-ftx/pom.xml
deleted file mode 100644
index 9a547a6c290..00000000000
--- a/xchange-ftx/pom.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
- 4.0.0
-
-
- org.knowm.xchange
- xchange-parent
- 5.2.1-SNAPSHOT
-
-
- xchange-ftx
-
- XChange Ftx
- XChange implementation for the Ftx Exchange
-
-
-
-
-
-
- org.knowm.xchange
- xchange-core
- ${project.version}
-
-
-
-
-
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/Ftx.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/Ftx.java
deleted file mode 100644
index 9374d3bad17..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/Ftx.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.knowm.xchange.ftx;
-
-import jakarta.ws.rs.Consumes;
-import jakarta.ws.rs.GET;
-import jakarta.ws.rs.Path;
-import jakarta.ws.rs.PathParam;
-import jakarta.ws.rs.Produces;
-import jakarta.ws.rs.QueryParam;
-import jakarta.ws.rs.core.MediaType;
-import java.io.IOException;
-import java.util.List;
-import org.knowm.xchange.ftx.dto.FtxResponse;
-import org.knowm.xchange.ftx.dto.marketdata.FtxCandleDto;
-import org.knowm.xchange.ftx.dto.marketdata.FtxMarketDto;
-import org.knowm.xchange.ftx.dto.marketdata.FtxMarketsDto;
-import org.knowm.xchange.ftx.dto.marketdata.FtxOrderbookDto;
-import org.knowm.xchange.ftx.dto.marketdata.FtxTradeDto;
-
-@Path("/api")
-@Produces(MediaType.APPLICATION_JSON)
-public interface Ftx {
-
- @GET
- @Path("/markets")
- @Consumes(MediaType.APPLICATION_JSON)
- FtxResponse getMarkets() throws IOException, FtxException;
-
- @GET
- @Path("/markets/{market_name}")
- @Consumes(MediaType.APPLICATION_JSON)
- FtxResponse getMarket(@PathParam("market_name") String market)
- throws IOException, FtxException;
-
- @GET
- @Path("/markets/{market_name}/trades")
- @Consumes(MediaType.APPLICATION_JSON)
- FtxResponse> getTrades(
- @PathParam("market_name") String market, @QueryParam("limit") int limit)
- throws IOException, FtxException;
-
- @GET
- @Path("/markets/{market_name}/candles")
- @Consumes(MediaType.APPLICATION_JSON)
- FtxResponse> getCandles(
- @PathParam("market_name") String market,
- @QueryParam("resolution") String resolution,
- @QueryParam("start_time") String startTime,
- @QueryParam("end_time") String endTime,
- @QueryParam("limit") Integer limit)
- throws IOException, FtxException;
-
- @GET
- @Path("/markets/{market_name}/orderbook")
- FtxResponse getOrderbook(
- @PathParam("market_name") String market, @QueryParam("depth") int depth)
- throws IOException, FtxException;
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/FtxAdapters.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/FtxAdapters.java
deleted file mode 100644
index e147d713395..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/FtxAdapters.java
+++ /dev/null
@@ -1,486 +0,0 @@
-package org.knowm.xchange.ftx;
-
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-import java.time.Instant;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-import java.util.regex.Pattern;
-import org.knowm.xchange.currency.Currency;
-import org.knowm.xchange.currency.CurrencyPair;
-import org.knowm.xchange.dto.Order;
-import org.knowm.xchange.dto.Order.OrderStatus;
-import org.knowm.xchange.dto.account.AccountInfo;
-import org.knowm.xchange.dto.account.Balance;
-import org.knowm.xchange.dto.account.OpenPosition;
-import org.knowm.xchange.dto.account.OpenPositions;
-import org.knowm.xchange.dto.account.Wallet;
-import org.knowm.xchange.dto.marketdata.OrderBook;
-import org.knowm.xchange.dto.marketdata.Ticker;
-import org.knowm.xchange.dto.marketdata.Trade;
-import org.knowm.xchange.dto.marketdata.Trades;
-import org.knowm.xchange.dto.meta.CurrencyMetaData;
-import org.knowm.xchange.dto.meta.ExchangeMetaData;
-import org.knowm.xchange.dto.meta.InstrumentMetaData;
-import org.knowm.xchange.dto.meta.RateLimit;
-import org.knowm.xchange.dto.trade.LimitOrder;
-import org.knowm.xchange.dto.trade.MarketOrder;
-import org.knowm.xchange.dto.trade.OpenOrders;
-import org.knowm.xchange.dto.trade.StopOrder;
-import org.knowm.xchange.dto.trade.UserTrade;
-import org.knowm.xchange.dto.trade.UserTrades;
-import org.knowm.xchange.ftx.dto.FtxResponse;
-import org.knowm.xchange.ftx.dto.account.FtxAccountDto;
-import org.knowm.xchange.ftx.dto.account.FtxPositionDto;
-import org.knowm.xchange.ftx.dto.account.FtxWalletBalanceDto;
-import org.knowm.xchange.ftx.dto.marketdata.FtxCandleDto;
-import org.knowm.xchange.ftx.dto.marketdata.FtxMarketDto;
-import org.knowm.xchange.ftx.dto.marketdata.FtxMarketsDto;
-import org.knowm.xchange.ftx.dto.marketdata.FtxOrderbookDto;
-import org.knowm.xchange.ftx.dto.marketdata.FtxTradeDto;
-import org.knowm.xchange.ftx.dto.trade.*;
-import org.knowm.xchange.instrument.Instrument;
-import org.knowm.xchange.utils.jackson.CurrencyPairDeserializer;
-
-public class FtxAdapters {
-
- public static OrderBook adaptOrderBook(
- FtxResponse ftxOrderbookDto, CurrencyPair currencyPair) {
-
- List asks = new ArrayList<>();
- List bids = new ArrayList<>();
-
- ftxOrderbookDto
- .getResult()
- .getAsks()
- .forEach(
- ftxAsk ->
- asks.add(
- adaptOrderbookOrder(
- ftxAsk.getVolume(), ftxAsk.getPrice(), currencyPair, Order.OrderType.ASK)));
-
- ftxOrderbookDto
- .getResult()
- .getBids()
- .forEach(
- ftxBid ->
- bids.add(
- adaptOrderbookOrder(
- ftxBid.getVolume(), ftxBid.getPrice(), currencyPair, Order.OrderType.BID)));
-
- return new OrderBook(Date.from(Instant.now()), asks, bids);
- }
-
- public static LimitOrder adaptOrderbookOrder(
- BigDecimal amount, BigDecimal price, CurrencyPair currencyPair, Order.OrderType orderType) {
-
- return new LimitOrder(orderType, amount, currencyPair, "", null, price);
- }
-
- public static AccountInfo adaptAccountInfo(
- FtxResponse ftxAccountDto,
- FtxResponse> ftxBalancesDto) {
-
- List ftxAccountInfo = new ArrayList<>();
- List ftxSpotBalances = new ArrayList<>();
-
- FtxAccountDto result = ftxAccountDto.getResult();
- ftxAccountInfo.add(
- new Balance(Currency.USD, result.getCollateral(), result.getFreeCollateral()));
-
- ftxBalancesDto
- .getResult()
- .forEach(
- ftxWalletBalanceDto ->
- ftxSpotBalances.add(
- new Balance(
- ftxWalletBalanceDto.getCoin(),
- ftxWalletBalanceDto.getTotal(),
- ftxWalletBalanceDto.getFree())));
-
- BigDecimal totalPositionSize = result.getTotalPositionSize();
- BigDecimal totalAccountValue = result.getTotalAccountValue();
-
- BigDecimal currentLeverage =
- totalPositionSize.compareTo(BigDecimal.ZERO) == 0
- ? BigDecimal.ZERO
- : totalPositionSize.divide(totalAccountValue, 3, RoundingMode.HALF_EVEN);
- Wallet accountWallet =
- Wallet.Builder.from(ftxAccountInfo)
- .features(
- Collections.unmodifiableSet(
- new HashSet<>(
- Arrays.asList(
- Wallet.WalletFeature.MARGIN_TRADING,
- Wallet.WalletFeature.MARGIN_FUNDING))))
- .maxLeverage(result.getLeverage())
- .currentLeverage(currentLeverage)
- .id("margin")
- .build();
-
- Wallet spotWallet =
- Wallet.Builder.from(ftxSpotBalances)
- .features(
- Collections.unmodifiableSet(
- new HashSet<>(
- Arrays.asList(Wallet.WalletFeature.FUNDING, Wallet.WalletFeature.TRADING))))
- .id("spot")
- .build();
-
- return new AccountInfo(
- result.getUsername(),
- result.getTakerFee(),
- Collections.unmodifiableList(Arrays.asList(accountWallet, spotWallet)),
- Date.from(Instant.now()));
- }
-
- public static ExchangeMetaData adaptExchangeMetaData(FtxMarketsDto marketsDto) {
-
- Map currencyPairs = new HashMap<>();
- Map currency = new HashMap<>();
-
- marketsDto
- .getMarketList()
- .forEach(
- ftxMarketDto -> {
- InstrumentMetaData currencyPairMetaData =
- new InstrumentMetaData.Builder()
- .amountStepSize(ftxMarketDto.getSizeIncrement())
- .minimumAmount(ftxMarketDto.getSizeIncrement())
- .priceScale(ftxMarketDto.getPriceIncrement().scale())
- .volumeScale(
- Math.max(0, ftxMarketDto.getSizeIncrement().stripTrailingZeros().scale()))
- .build();
-
- if ("spot".equals(ftxMarketDto.getType())) {
- CurrencyPair currencyPair =
- new CurrencyPair(
- ftxMarketDto.getBaseCurrency(), ftxMarketDto.getQuoteCurrency());
- currencyPairs.put(currencyPair, currencyPairMetaData);
- if (!currency.containsKey(currencyPair.base)) {
- currency.put(
- currencyPair.base,
- new CurrencyMetaData(
- ftxMarketDto.getSizeIncrement().scale(), BigDecimal.ZERO));
- }
- if (!currency.containsKey(currencyPair.counter)) {
- currency.put(
- currencyPair.counter,
- new CurrencyMetaData(
- ftxMarketDto.getPriceIncrement().scale(), BigDecimal.ZERO));
- }
- } else if ("future".equals(ftxMarketDto.getType())
- && ftxMarketDto.getName().contains("-")) {
- CurrencyPair futuresContract = new CurrencyPair(ftxMarketDto.getName());
- currencyPairs.put(futuresContract, currencyPairMetaData);
- }
- });
-
- RateLimit[] rateLimits = {new RateLimit(30, 1, TimeUnit.SECONDS)};
-
- return new ExchangeMetaData(currencyPairs, currency, rateLimits, rateLimits, true);
- }
-
- public static FtxOrderRequestPayload adaptMarketOrderToFtxOrderPayload(MarketOrder marketOrder) {
- return adaptOrderToFtxOrderPayload(FtxOrderType.market, marketOrder, null);
- }
-
- public static FtxOrderRequestPayload adaptLimitOrderToFtxOrderPayload(LimitOrder limitOrder) {
- return adaptOrderToFtxOrderPayload(FtxOrderType.limit, limitOrder, limitOrder.getLimitPrice());
- }
-
- public static FtxModifyOrderRequestPayload adaptModifyOrderToFtxOrderPayload(
- LimitOrder limitOrder) {
- return new FtxModifyOrderRequestPayload(
- limitOrder.getLimitPrice(), limitOrder.getOriginalAmount(), limitOrder.getUserReference());
- }
-
- private static FtxOrderRequestPayload adaptOrderToFtxOrderPayload(
- FtxOrderType type, Order order, BigDecimal price) {
- return new FtxOrderRequestPayload(
- adaptCurrencyPairToFtxMarket(order.getCurrencyPair()),
- adaptOrderTypeToFtxOrderSide(order.getType()),
- price,
- type,
- order.getOriginalAmount(),
- order.hasFlag(FtxOrderFlags.REDUCE_ONLY),
- order.hasFlag(FtxOrderFlags.IOC),
- order.hasFlag(FtxOrderFlags.POST_ONLY),
- order.getUserReference());
- }
-
- public static Trades adaptTrades(List ftxTradeDtos, CurrencyPair currencyPair) {
- List trades = new ArrayList<>();
-
- ftxTradeDtos.forEach(
- ftxTradeDto ->
- trades.add(
- new Trade.Builder()
- .id(ftxTradeDto.getId())
- .instrument(currencyPair)
- .originalAmount(ftxTradeDto.getSize())
- .price(ftxTradeDto.getPrice())
- .timestamp(ftxTradeDto.getTime())
- .type(adaptFtxOrderSideToOrderType(ftxTradeDto.getSide()))
- .build()));
-
- return new Trades(trades);
- }
-
- public static UserTrades adaptUserTrades(List ftxUserTrades) {
- List userTrades = new ArrayList<>();
-
- ftxUserTrades.forEach(
- ftxFillDto -> {
- if (ftxFillDto.getSize().compareTo(BigDecimal.ZERO) != 0) {
- userTrades.add(
- UserTrade.builder()
- .instrument(
- CurrencyPairDeserializer.getCurrencyPairFromString(ftxFillDto.getMarket()))
- .currencyPair(
- CurrencyPairDeserializer.getCurrencyPairFromString(ftxFillDto.getMarket()))
- .timestamp(ftxFillDto.getTime())
- .id(ftxFillDto.getId())
- .orderId(ftxFillDto.getOrderId())
- .originalAmount(ftxFillDto.getSize())
- .type(adaptFtxOrderSideToOrderType(ftxFillDto.getSide()))
- .feeAmount(ftxFillDto.getFee())
- .feeCurrency(Currency.getInstance(ftxFillDto.getFeeCurrency()))
- .price(ftxFillDto.getPrice())
- .build());
- }
- });
-
- return new UserTrades(userTrades, Trades.TradeSortType.SortByTimestamp);
- }
-
- public static LimitOrder adaptLimitOrder(FtxOrderDto ftxOrderDto) {
-
- return new LimitOrder.Builder(
- adaptFtxOrderSideToOrderType(ftxOrderDto.getSide()),
- CurrencyPairDeserializer.getCurrencyPairFromString(ftxOrderDto.getMarket()))
- .originalAmount(ftxOrderDto.getSize())
- .limitPrice(ftxOrderDto.getPrice())
- .averagePrice(ftxOrderDto.getAvgFillPrice())
- .userReference(ftxOrderDto.getClientId())
- .timestamp(ftxOrderDto.getCreatedAt())
- .flags(
- Collections.unmodifiableSet(
- new HashSet<>(
- Arrays.asList(
- (ftxOrderDto.isIoc() ? FtxOrderFlags.IOC : null),
- (ftxOrderDto.isPostOnly() ? FtxOrderFlags.POST_ONLY : null),
- (ftxOrderDto.isReduceOnly() ? FtxOrderFlags.REDUCE_ONLY : null)))))
- .cumulativeAmount(ftxOrderDto.getFilledSize())
- .remainingAmount(ftxOrderDto.getRemainingSize())
- .orderStatus(adaptFtxOrderStatusToOrderStatus(ftxOrderDto.getStatus()))
- .id(ftxOrderDto.getId())
- .build();
- }
-
- public static LimitOrder adaptConditionalLimitOrder(FtxConditionalOrderDto ftxOrderDto) {
-
- return new LimitOrder.Builder(
- adaptFtxOrderSideToOrderType(ftxOrderDto.getSide()),
- CurrencyPairDeserializer.getCurrencyPairFromString(ftxOrderDto.getMarket()))
- .originalAmount(ftxOrderDto.getSize())
- .limitPrice(ftxOrderDto.getTriggerPrice())
- .averagePrice(ftxOrderDto.getAvgFillPrice())
- .timestamp(ftxOrderDto.getCreatedAt())
- .flags(
- Collections.unmodifiableSet(
- new HashSet<>(
- Arrays.asList(
- (ftxOrderDto.isRetryUntilFilled()
- ? FtxOrderFlags.RETRY_UNTIL_FILLED
- : null),
- (ftxOrderDto.isReduceOnly() ? FtxOrderFlags.REDUCE_ONLY : null)))))
- .cumulativeAmount(ftxOrderDto.getFilledSize())
- .orderStatus(adaptFtxOrderStatusToOrderStatus(ftxOrderDto.getStatus()))
- .id(ftxOrderDto.getId())
- .build();
- }
-
- public static OpenOrders adaptOpenOrders(FtxResponse> ftxOpenOrdersResponse) {
- List openOrders = new ArrayList<>();
-
- ftxOpenOrdersResponse
- .getResult()
- .forEach(ftxOrderDto -> openOrders.add(adaptLimitOrder(ftxOrderDto)));
-
- return new OpenOrders(openOrders);
- }
-
- public static OpenOrders adaptTriggerOpenOrders(
- FtxResponse> ftxOpenOrdersResponse) {
- List openOrders = new ArrayList<>();
-
- ftxOpenOrdersResponse
- .getResult()
- .forEach(ftxOrderDto -> openOrders.add(adaptConditionalLimitOrder(ftxOrderDto)));
-
- return new OpenOrders(openOrders);
- }
-
- public static FtxOrderSide adaptOrderTypeToFtxOrderSide(Order.OrderType orderType) {
-
- switch (orderType) {
- case ASK:
- return FtxOrderSide.sell;
- case BID:
- return FtxOrderSide.buy;
- case EXIT_ASK:
- return FtxOrderSide.buy;
- case EXIT_BID:
- return FtxOrderSide.sell;
- default:
- return null;
- }
- }
-
- public static Order.OrderType adaptFtxOrderSideToOrderType(FtxOrderSide ftxOrderSide) {
-
- return ftxOrderSide == FtxOrderSide.buy ? Order.OrderType.BID : Order.OrderType.ASK;
- }
-
- public static OrderStatus adaptFtxOrderStatusToOrderStatus(FtxOrderStatus ftxOrderStatus) {
-
- switch (ftxOrderStatus) {
- case NEW:
- case TRIGGERED:
- return OrderStatus.NEW;
- case CLOSED:
- return OrderStatus.CLOSED;
- case CANCELLED:
- return OrderStatus.CANCELED;
- case OPEN:
- return OrderStatus.OPEN;
- default:
- return OrderStatus.UNKNOWN;
- }
- }
-
- private static final Pattern FUTURES_PATTERN = Pattern.compile("PERP|[0-9]+");
-
- public static String adaptCurrencyPairToFtxMarket(CurrencyPair currencyPair) {
- if (FUTURES_PATTERN.matcher(currencyPair.counter.getCurrencyCode()).matches()) {
- return currencyPair.base + "-" + currencyPair.counter;
- } else {
- return currencyPair.toString();
- }
- }
-
- public static OpenPositions adaptOpenPositions(List ftxPositionDtos) {
- List openPositionList = new ArrayList<>();
-
- ftxPositionDtos.forEach(
- ftxPositionDto -> {
- if (ftxPositionDto.getSize().compareTo(BigDecimal.ZERO) > 0) {
- openPositionList.add(
- new OpenPosition.Builder()
- .instrument(new CurrencyPair(ftxPositionDto.getFuture()))
- .price(ftxPositionDto.getRecentBreakEvenPrice())
- .size(ftxPositionDto.getSize())
- .type(
- ftxPositionDto.getSide() == FtxOrderSide.buy
- ? OpenPosition.Type.LONG
- : OpenPosition.Type.SHORT)
- .liquidationPrice(ftxPositionDto.getEstimatedLiquidationPrice())
- .unRealisedPnl(ftxPositionDto.getRecentPnl())
- .build());
- }
- });
-
- return new OpenPositions(openPositionList);
- }
-
- public static BigDecimal lendingRounding(BigDecimal value) {
- return value.setScale(4, RoundingMode.DOWN);
- }
-
- public static Ticker adaptTicker(
- FtxResponse ftxMarketResp,
- FtxResponse> ftxCandlesResp,
- CurrencyPair currencyPair) {
-
- FtxCandleDto lastCandle = ftxCandlesResp.getResult().get(ftxCandlesResp.getResult().size() - 1);
-
- BigDecimal open = lastCandle.getOpen();
- BigDecimal last = ftxMarketResp.getResult().getLast();
- BigDecimal bid = ftxMarketResp.getResult().getBid();
- BigDecimal ask = ftxMarketResp.getResult().getAsk();
- BigDecimal high = lastCandle.getHigh();
- BigDecimal low = lastCandle.getLow();
- BigDecimal volume = lastCandle.getVolume();
- Date timestamp = lastCandle.getStartTime();
-
- return new Ticker.Builder()
- .instrument(currencyPair)
- .open(open)
- .last(last)
- .bid(bid)
- .ask(ask)
- .high(high)
- .low(low)
- .volume(volume)
- .timestamp(timestamp)
- .build();
- }
-
- public static FtxConditionalOrderRequestPayload adaptStopOrderToFtxOrderPayload(
- StopOrder stopOrder) throws IOException {
- return adaptConditionalOrderToFtxOrderPayload(
- adaptTriggerOrderIntention(
- (stopOrder.getIntention() == null)
- ? StopOrder.Intention.STOP_LOSS
- : stopOrder.getIntention()),
- stopOrder,
- stopOrder.getLimitPrice(),
- stopOrder.getStopPrice(),
- null);
- }
-
- public static FtxConditionalOrderType adaptTriggerOrderIntention(
- StopOrder.Intention stopOrderIntention) throws IOException {
- switch (stopOrderIntention) {
- case STOP_LOSS:
- return FtxConditionalOrderType.stop;
- case TAKE_PROFIT:
- return FtxConditionalOrderType.take_profit;
- default:
- throw new IOException("StopOrder Intention is not supported.");
- }
- }
-
- public static FtxModifyConditionalOrderRequestPayload
- adaptModifyConditionalOrderToFtxOrderPayload(StopOrder stopOrder) {
- return new FtxModifyConditionalOrderRequestPayload(
- stopOrder.getLimitPrice(), stopOrder.getStopPrice(), null, stopOrder.getOriginalAmount());
- }
-
- private static FtxConditionalOrderRequestPayload adaptConditionalOrderToFtxOrderPayload(
- FtxConditionalOrderType type,
- Order order,
- BigDecimal price,
- BigDecimal triggerPrice,
- BigDecimal trailValue) {
- return new FtxConditionalOrderRequestPayload(
- adaptCurrencyPairToFtxMarket(order.getCurrencyPair()),
- adaptOrderTypeToFtxOrderSide(order.getType()),
- order.getOriginalAmount(),
- type,
- order.hasFlag(FtxOrderFlags.REDUCE_ONLY),
- order.hasFlag(FtxOrderFlags.RETRY_UNTIL_FILLED),
- price,
- triggerPrice,
- trailValue);
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/FtxAuthenticated.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/FtxAuthenticated.java
deleted file mode 100644
index e6b460eab89..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/FtxAuthenticated.java
+++ /dev/null
@@ -1,423 +0,0 @@
-package org.knowm.xchange.ftx;
-
-import jakarta.ws.rs.Consumes;
-import jakarta.ws.rs.DELETE;
-import jakarta.ws.rs.GET;
-import jakarta.ws.rs.HeaderParam;
-import jakarta.ws.rs.POST;
-import jakarta.ws.rs.Path;
-import jakarta.ws.rs.PathParam;
-import jakarta.ws.rs.Produces;
-import jakarta.ws.rs.QueryParam;
-import jakarta.ws.rs.core.MediaType;
-import java.io.IOException;
-import java.util.List;
-import org.knowm.xchange.ftx.dto.FtxResponse;
-import org.knowm.xchange.ftx.dto.account.FtxAccountDto;
-import org.knowm.xchange.ftx.dto.account.FtxBorrowingHistoryDto;
-import org.knowm.xchange.ftx.dto.account.FtxBorrowingInfoDto;
-import org.knowm.xchange.ftx.dto.account.FtxBorrowingRatesDto;
-import org.knowm.xchange.ftx.dto.account.FtxChangeSubAccountNamePOJO;
-import org.knowm.xchange.ftx.dto.account.FtxConvertAcceptPayloadRequestDto;
-import org.knowm.xchange.ftx.dto.account.FtxConvertAcceptRequestDto;
-import org.knowm.xchange.ftx.dto.account.FtxConvertDto;
-import org.knowm.xchange.ftx.dto.account.FtxConvertSimulatePayloadRequestDto;
-import org.knowm.xchange.ftx.dto.account.FtxConvertSimulatetDto;
-import org.knowm.xchange.ftx.dto.account.FtxFundingPaymentsDto;
-import org.knowm.xchange.ftx.dto.account.FtxLendingHistoryDto;
-import org.knowm.xchange.ftx.dto.account.FtxLendingInfoDto;
-import org.knowm.xchange.ftx.dto.account.FtxLendingRatesDto;
-import org.knowm.xchange.ftx.dto.account.FtxLeverageDto;
-import org.knowm.xchange.ftx.dto.account.FtxPositionDto;
-import org.knowm.xchange.ftx.dto.account.FtxSubAccountBalanceDto;
-import org.knowm.xchange.ftx.dto.account.FtxSubAccountDto;
-import org.knowm.xchange.ftx.dto.account.FtxSubAccountRequestPOJO;
-import org.knowm.xchange.ftx.dto.account.FtxSubAccountTranferDto;
-import org.knowm.xchange.ftx.dto.account.FtxSubAccountTransferPOJO;
-import org.knowm.xchange.ftx.dto.account.FtxSubmitLendingOfferParams;
-import org.knowm.xchange.ftx.dto.account.FtxWalletBalanceDto;
-import org.knowm.xchange.ftx.dto.trade.*;
-import si.mazi.rescu.ParamsDigest;
-
-@Path("/api")
-@Produces(MediaType.APPLICATION_JSON)
-@Consumes(MediaType.APPLICATION_JSON)
-public interface FtxAuthenticated extends Ftx {
-
- @GET
- @Path("/account")
- FtxResponse getAccountInformation(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount)
- throws IOException, FtxException;
-
- @GET
- @Path("/wallet/balances")
- FtxResponse> getWalletBalances(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount)
- throws IOException, FtxException;
-
- @GET
- @Path("/positions")
- FtxResponse> getFtxPositions(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @QueryParam("showAvgPrice") boolean showAvgPrice)
- throws IOException, FtxException;
-
- @DELETE
- @Path("/subaccounts")
- FtxResponse deleteSubAccounts(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- FtxSubAccountRequestPOJO payload)
- throws IOException, FtxException;
-
- @GET
- @Path("/subaccounts")
- FtxResponse> getAllSubAccounts(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature)
- throws IOException, FtxException;
-
- @POST
- @Path("/subaccounts")
- FtxResponse createSubAccount(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- FtxSubAccountRequestPOJO payload)
- throws IOException, FtxException;
-
- @POST
- @Path("/subaccounts/update_name")
- FtxResponse changeSubAccountName(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- FtxChangeSubAccountNamePOJO payload)
- throws IOException, FtxException;
-
- @GET
- @Path("/subaccounts/{nickname}/balances")
- FtxResponse getSubAccountBalances(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @PathParam("nickname") String nickname)
- throws IOException, FtxException;
-
- @POST
- @Path("/subaccounts/transfer")
- FtxResponse transferBetweenSubAccounts(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- FtxSubAccountTransferPOJO payload)
- throws IOException, FtxException;
-
- @POST
- @Path("/otc/quotes")
- FtxResponse simulateConvert(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- FtxConvertSimulatePayloadRequestDto payload)
- throws IOException, FtxException;
-
- @GET
- @Path("/otc/quotes/{quoteId}")
- FtxResponse getConvertStatus(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @PathParam("quoteId") String quoteId)
- throws IOException, FtxException;
-
- @POST
- @Path("/otc/quotes/{quoteId}/accept")
- FtxResponse acceptConvert(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @PathParam("quoteId") String quoteId,
- FtxConvertAcceptPayloadRequestDto payload)
- throws IOException, FtxException;
-
- @POST
- @Path("/orders")
- FtxResponse placeOrder(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- FtxOrderRequestPayload payload)
- throws IOException, FtxException;
-
- @POST
- @Path("/orders/{order_id}/modify")
- FtxResponse modifyOrder(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @PathParam("order_id") String orderId,
- FtxModifyOrderRequestPayload payload)
- throws IOException, FtxException;
-
- @POST
- @Path("/orders/by_client_id/{client_order_id}/modify")
- FtxResponse modifyOrderByClientId(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @PathParam("client_order_id") String clientId,
- FtxModifyOrderRequestPayload payload)
- throws IOException, FtxException;
-
- @GET
- @Path("/orders/{order_id}")
- FtxResponse getOrderStatus(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @PathParam("order_id") String orderId)
- throws IOException, FtxException;
-
- @GET
- @Path("/orders?market={market}")
- FtxResponse> openOrders(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @PathParam("market") String market)
- throws IOException, FtxException;
-
- @GET
- @Path("/orders")
- FtxResponse> openOrdersWithoutMarket(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount)
- throws IOException, FtxException;
-
- @DELETE
- @Path("/orders/{orderId}")
- FtxResponse cancelOrder(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @PathParam("orderId") String orderId)
- throws IOException, FtxException;
-
- @DELETE
- @Path("/orders")
- FtxResponse cancelAllOrders(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- CancelAllFtxOrdersParams payLoad)
- throws IOException, FtxException;
-
- @GET
- @Path("/orders/history")
- FtxResponse> orderHistory(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @QueryParam("market") String market,
- @QueryParam("start_time") Long startTime,
- @QueryParam("end_time") Long endTime)
- throws IOException, FtxException;
-
- @DELETE
- @Path("/orders/by_client_id/{client_order_id}")
- FtxResponse cancelOrderByClientId(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @PathParam("client_order_id") String clientOrderId)
- throws IOException, FtxException;
-
- @GET
- @Path("/fills")
- FtxResponse> fills(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @QueryParam("market") String market,
- @QueryParam("start_time") Long startTime,
- @QueryParam("end_time") Long endTime)
- throws IOException, FtxException;
-
- @POST
- @Path("/account/leverage")
- FtxResponse changeLeverage(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- FtxLeverageDto leverage)
- throws IOException, FtxException;
-
- @GET
- @Path("/spot_margin/borrow_history")
- FtxResponse> getBorrowHistory(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @QueryParam("start_time") Long start_time,
- @QueryParam("end_time") Long end_time)
- throws IOException, FtxException;
-
- @GET
- @Path("/funding_payments")
- FtxResponse> getFundingPayments(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @QueryParam("start_time") Long startTime,
- @QueryParam("end_time") Long endTime,
- @QueryParam("future") String future)
- throws IOException, FtxException;
-
- @GET
- @Path("/spot_margin/lending_info")
- FtxResponse> getLendingInfos(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount)
- throws IOException, FtxException;
-
- @GET
- @Path("/spot_margin/lending_rates")
- FtxResponse> getLendingRates(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature)
- throws IOException, FtxException;
-
- @GET
- @Path("/spot_margin/lending_history")
- FtxResponse> getlendingHistories(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount)
- throws IOException, FtxException;
-
- @POST
- @Path("/spot_margin/offers")
- FtxResponse submitLendingOffer(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- FtxSubmitLendingOfferParams payload)
- throws IOException, FtxException;
-
- @GET
- @Path("/spot_margin/borrow_rates")
- FtxResponse> getBorrowRates(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature)
- throws IOException, FtxException;
-
- @GET
- @Path("/spot_margin/borrow_info")
- FtxResponse> getBorrowingInfos(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount)
- throws IOException, FtxException;
-
- @POST
- @Path("/conditional_orders")
- FtxResponse placeConditionalOrder(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- FtxConditionalOrderRequestPayload payload)
- throws IOException, FtxException;
-
- @POST
- @Path("/conditional_orders/{order_id}/modify")
- FtxResponse modifyConditionalOrder(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @PathParam("order_id") String orderId,
- FtxModifyConditionalOrderRequestPayload payload)
- throws IOException, FtxException;
-
- @DELETE
- @Path("/conditional_orders/{orderId}")
- FtxResponse cancelConditionalOrder(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @PathParam("orderId") String orderId)
- throws IOException, FtxException;
-
- @GET
- @Path("/conditional_orders/history?market={market}")
- FtxResponse> conditionalOrderHistory(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @PathParam("market") String market)
- throws IOException, FtxException;
-
- @GET
- @Path("/conditional_orders?market={market}")
- FtxResponse> openConditionalOrders(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @PathParam("market") String market)
- throws IOException, FtxException;
-
- @GET
- @Path("/conditional_orders/{id}/triggers")
- FtxResponse> getTriggers(
- @HeaderParam("FTX-KEY") String apiKey,
- @HeaderParam("FTX-TS") Long nonce,
- @HeaderParam("FTX-SIGN") ParamsDigest signature,
- @HeaderParam("FTX-SUBACCOUNT") String subaccount,
- @PathParam("id") String id)
- throws IOException, FtxException;
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/FtxException.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/FtxException.java
deleted file mode 100644
index 447db3b661b..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/FtxException.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.knowm.xchange.ftx;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import si.mazi.rescu.HttpStatusExceptionSupport;
-
-public class FtxException extends HttpStatusExceptionSupport {
-
- public FtxException(@JsonProperty("error") String message) {
- super(message);
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/FtxExchange.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/FtxExchange.java
deleted file mode 100644
index 9431ea0d5db..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/FtxExchange.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.knowm.xchange.ftx;
-
-import java.io.IOException;
-import org.knowm.xchange.BaseExchange;
-import org.knowm.xchange.Exchange;
-import org.knowm.xchange.ExchangeSpecification;
-import org.knowm.xchange.exceptions.ExchangeException;
-import org.knowm.xchange.ftx.dto.marketdata.FtxMarketsDto;
-import org.knowm.xchange.ftx.service.FtxAccountService;
-import org.knowm.xchange.ftx.service.FtxBorrowingServiceRaw;
-import org.knowm.xchange.ftx.service.FtxLendingServiceRaw;
-import org.knowm.xchange.ftx.service.FtxMarketDataService;
-import org.knowm.xchange.ftx.service.FtxMarketDataServiceRaw;
-import org.knowm.xchange.ftx.service.FtxTradeService;
-import org.knowm.xchange.service.account.AccountService;
-import org.knowm.xchange.service.marketdata.MarketDataService;
-import org.knowm.xchange.service.trade.TradeService;
-
-public class FtxExchange extends BaseExchange implements Exchange {
-
- private FtxLendingServiceRaw lendingService;
- private FtxBorrowingServiceRaw borrowingService;
-
- @Override
- protected void initServices() {
- this.marketDataService = new FtxMarketDataService(this);
- this.accountService = new FtxAccountService(this);
- this.tradeService = new FtxTradeService(this);
- this.lendingService = new FtxLendingServiceRaw(this);
- this.borrowingService = new FtxBorrowingServiceRaw(this);
- }
-
- @Override
- public ExchangeSpecification getDefaultExchangeSpecification() {
- ExchangeSpecification exchangeSpecification = new ExchangeSpecification(this.getClass());
-
- exchangeSpecification.setSslUri("https://ftx.com");
- exchangeSpecification.setHost("ftx.com");
- exchangeSpecification.setPort(80);
- exchangeSpecification.setExchangeName("Ftx");
- exchangeSpecification.setExchangeDescription("Ftx is a spot and derivatives exchange.");
-
- return exchangeSpecification;
- }
-
- @Override
- public void remoteInit() throws IOException, ExchangeException {
- FtxMarketsDto marketsDto =
- ((FtxMarketDataServiceRaw) marketDataService).getFtxMarkets().getResult();
-
- exchangeMetaData = FtxAdapters.adaptExchangeMetaData(marketsDto);
- }
-
- @Override
- public MarketDataService getMarketDataService() {
- return this.marketDataService;
- }
-
- @Override
- public AccountService getAccountService() {
- return this.accountService;
- }
-
- @Override
- public TradeService getTradeService() {
- return this.tradeService;
- }
-
- public FtxLendingServiceRaw getLendingService() {
- return lendingService;
- }
-
- public FtxBorrowingServiceRaw getBorrowingService() {
- return borrowingService;
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/FtxResponse.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/FtxResponse.java
deleted file mode 100644
index 2b4c88ae10e..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/FtxResponse.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.knowm.xchange.ftx.dto;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class FtxResponse {
-
- private final boolean success;
- private final V result;
-
- @JsonIgnore private final boolean hasMoreData;
-
- public FtxResponse(
- @JsonProperty("success") boolean success,
- @JsonProperty("result") V result,
- @JsonProperty("hasMoreData") boolean hasMoreData) {
- this.success = success;
- this.result = result;
- this.hasMoreData = hasMoreData;
- }
-
- public boolean isSuccess() {
- return success;
- }
-
- public V getResult() {
- return result;
- }
-
- public boolean isHasMoreData() {
- return hasMoreData;
- }
-
- @Override
- public String toString() {
- return "FtxResponse{"
- + "success="
- + success
- + ", result="
- + result
- + ", hasMoreData="
- + hasMoreData
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxAccountDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxAccountDto.java
deleted file mode 100644
index 7ba7638eb36..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxAccountDto.java
+++ /dev/null
@@ -1,183 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-import java.util.List;
-
-public class FtxAccountDto {
-
- @JsonProperty("backstopProvider")
- private final boolean backstopProvider;
-
- @JsonProperty("collateral")
- private final BigDecimal collateral;
-
- @JsonProperty("freeCollateral")
- private final BigDecimal freeCollateral;
-
- @JsonProperty("initialMarginRequirement")
- private final BigDecimal initialMarginRequirement;
-
- @JsonProperty("leverage")
- private final BigDecimal leverage;
-
- @JsonProperty("liquidating")
- private final boolean liquidating;
-
- @JsonProperty("maintenanceMarginRequirement")
- private final BigDecimal maintenanceMarginRequirement;
-
- @JsonProperty("makerFee")
- private final BigDecimal makerFee;
-
- @JsonProperty("marginFraction")
- private final BigDecimal marginFraction;
-
- @JsonProperty("openMarginFraction")
- private final BigDecimal openMarginFraction;
-
- @JsonProperty("takerFee")
- private final BigDecimal takerFee;
-
- @JsonProperty("totalAccountValue")
- private final BigDecimal totalAccountValue;
-
- @JsonProperty("totalPositionSize")
- private final BigDecimal totalPositionSize;
-
- @JsonProperty("username")
- private final String username;
-
- @JsonProperty("positions")
- private final List positions;
-
- public FtxAccountDto(
- @JsonProperty("backstopProvider") boolean backstopProvider,
- @JsonProperty("collateral") BigDecimal collateral,
- @JsonProperty("freeCollateral") BigDecimal freeCollateral,
- @JsonProperty("initialMarginRequirement") BigDecimal initialMarginRequirement,
- @JsonProperty("leverage") BigDecimal leverage,
- @JsonProperty("liquidating") boolean liquidating,
- @JsonProperty("maintenanceMarginRequirement") BigDecimal maintenanceMarginRequirement,
- @JsonProperty("makerFee") BigDecimal makerFee,
- @JsonProperty("marginFraction") BigDecimal marginFraction,
- @JsonProperty("openMarginFraction") BigDecimal openMarginFraction,
- @JsonProperty("takerFee") BigDecimal takerFee,
- @JsonProperty("totalAccountValue") BigDecimal totalAccountValue,
- @JsonProperty("totalPositionSize") BigDecimal totalPositionSize,
- @JsonProperty("username") String username,
- @JsonProperty("positions") List positions) {
- this.backstopProvider = backstopProvider;
- this.collateral = collateral;
- this.freeCollateral = freeCollateral;
- this.initialMarginRequirement = initialMarginRequirement;
- this.leverage = leverage;
- this.liquidating = liquidating;
- this.maintenanceMarginRequirement = maintenanceMarginRequirement;
- this.makerFee = makerFee;
- this.marginFraction = marginFraction;
- this.openMarginFraction = openMarginFraction;
- this.takerFee = takerFee;
- this.totalAccountValue = totalAccountValue;
- this.totalPositionSize = totalPositionSize;
- this.username = username;
- this.positions = positions;
- }
-
- public boolean getBackstopProvider() {
- return backstopProvider;
- }
-
- public BigDecimal getCollateral() {
- return collateral;
- }
-
- public BigDecimal getFreeCollateral() {
- return freeCollateral;
- }
-
- public BigDecimal getInitialMarginRequirement() {
- return initialMarginRequirement;
- }
-
- public BigDecimal getLeverage() {
- return leverage;
- }
-
- public boolean getLiquidating() {
- return liquidating;
- }
-
- public BigDecimal getMaintenanceMarginRequirement() {
- return maintenanceMarginRequirement;
- }
-
- public BigDecimal getMakerFee() {
- return makerFee;
- }
-
- public BigDecimal getMarginFraction() {
- return marginFraction;
- }
-
- public BigDecimal getOpenMarginFraction() {
- return openMarginFraction;
- }
-
- public BigDecimal getTakerFee() {
- return takerFee;
- }
-
- public BigDecimal getTotalAccountValue() {
- return totalAccountValue;
- }
-
- public BigDecimal getTotalPositionSize() {
- return totalPositionSize;
- }
-
- public String getUsername() {
- return username;
- }
-
- public List getPositions() {
- return positions;
- }
-
- @Override
- public String toString() {
- return "FtxAccountDto{"
- + "backstopProvider="
- + backstopProvider
- + ", collateral="
- + collateral
- + ", freeCollateral="
- + freeCollateral
- + ", initialMarginRequirement="
- + initialMarginRequirement
- + ", leverage="
- + leverage
- + ", liquidating="
- + liquidating
- + ", maintenanceMarginRequirement="
- + maintenanceMarginRequirement
- + ", makerFee="
- + makerFee
- + ", marginFraction="
- + marginFraction
- + ", openMarginFraction="
- + openMarginFraction
- + ", takerFee="
- + takerFee
- + ", totalAccountValue="
- + totalAccountValue
- + ", totalPositionSize="
- + totalPositionSize
- + ", username='"
- + username
- + '\''
- + ", positions="
- + positions
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxBorrowingHistoryDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxBorrowingHistoryDto.java
deleted file mode 100644
index b292b323d87..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxBorrowingHistoryDto.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-import java.util.Date;
-
-public class FtxBorrowingHistoryDto {
-
- @JsonProperty("coin")
- private final String coin;
-
- @JsonProperty("cost")
- private final BigDecimal cost;
-
- @JsonProperty("rate")
- private final BigDecimal rate;
-
- @JsonProperty("size")
- private final BigDecimal size;
-
- @JsonProperty("time")
- private final Date time;
-
- @JsonProperty("feeUsd")
- private final BigDecimal feeUsd;
-
- public FtxBorrowingHistoryDto(
- @JsonProperty("coin") String coin,
- @JsonProperty("cost") BigDecimal cost,
- @JsonProperty("rate") BigDecimal rate,
- @JsonProperty("size") BigDecimal size,
- @JsonProperty("time") Date time,
- @JsonProperty("feeUsd") BigDecimal feeUsd) {
- this.coin = coin;
- this.cost = cost;
- this.rate = rate;
- this.size = size;
- this.time = time;
- this.feeUsd = feeUsd;
- }
-
- public String getCoin() {
- return coin;
- }
-
- public BigDecimal getCost() {
- return cost;
- }
-
- public BigDecimal getRate() {
- return rate;
- }
-
- public BigDecimal getSize() {
- return size;
- }
-
- public Date getTime() {
- return time;
- }
-
- public BigDecimal getFeeUsd() {
- return feeUsd;
- }
-
- @Override
- public String toString() {
- return "FtxBorrowingHistoryDto{"
- + "coin='"
- + coin
- + '\''
- + ", cost="
- + cost
- + ", rate="
- + rate
- + ", size="
- + size
- + ", time="
- + time
- + ", feeUsd="
- + feeUsd
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxBorrowingInfoDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxBorrowingInfoDto.java
deleted file mode 100644
index b8b2b0042b2..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxBorrowingInfoDto.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-
-public class FtxBorrowingInfoDto {
-
- @JsonProperty("coin")
- private final String coin;
-
- @JsonProperty("lendable")
- private final BigDecimal lendable;
-
- @JsonProperty("locked")
- private final BigDecimal locked;
-
- @JsonProperty("minRate")
- private final BigDecimal minRate;
-
- @JsonProperty("offered")
- private final BigDecimal offered;
-
- @JsonCreator
- public FtxBorrowingInfoDto(
- @JsonProperty("coin") String coin,
- @JsonProperty("lendable") BigDecimal lendable,
- @JsonProperty("locked") BigDecimal locked,
- @JsonProperty("minRate") BigDecimal minRate,
- @JsonProperty("offered") BigDecimal offered) {
- this.coin = coin;
- this.lendable = lendable;
- this.locked = locked;
- this.minRate = minRate;
- this.offered = offered;
- }
-
- public String getCoin() {
- return coin;
- }
-
- public BigDecimal getLendable() {
- return lendable;
- }
-
- public BigDecimal getLocked() {
- return locked;
- }
-
- public BigDecimal getMinRate() {
- return minRate;
- }
-
- public BigDecimal getOffered() {
- return offered;
- }
-
- @Override
- public String toString() {
- return "FtxBorrowingInfoDto{"
- + "coin='"
- + coin
- + '\''
- + ", lendable="
- + lendable
- + ", locked="
- + locked
- + ", minRate="
- + minRate
- + ", offered="
- + offered
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxBorrowingRatesDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxBorrowingRatesDto.java
deleted file mode 100644
index 26caaf63e97..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxBorrowingRatesDto.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class FtxBorrowingRatesDto {
-
- @JsonProperty("coin")
- private final String coin;
-
- @JsonProperty("previous")
- private final double previous;
-
- @JsonProperty("estimate")
- private final double estimate;
-
- @JsonCreator
- public FtxBorrowingRatesDto(
- @JsonProperty("coin") String coin,
- @JsonProperty("previous") double previous,
- @JsonProperty("estimate") double estimate) {
- this.coin = coin;
- this.previous = previous;
- this.estimate = estimate;
- }
-
- public String getCoin() {
- return coin;
- }
-
- public double getPrevious() {
- return previous;
- }
-
- public double getEstimate() {
- return estimate;
- }
-
- @Override
- public String toString() {
- return "FtxBorrowingRatesDto{"
- + "coin='"
- + coin
- + '\''
- + ", previous="
- + previous
- + ", estimate="
- + estimate
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxChangeSubAccountNamePOJO.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxChangeSubAccountNamePOJO.java
deleted file mode 100644
index 9c997d2c6cc..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxChangeSubAccountNamePOJO.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-public class FtxChangeSubAccountNamePOJO {
-
- private String nickname;
- private String newNickname;
-
- public FtxChangeSubAccountNamePOJO(String nickname, String newNickname) {
- this.nickname = nickname;
- this.newNickname = newNickname;
- }
-
- public String getNickname() {
- return nickname;
- }
-
- public String getNewNickname() {
- return newNickname;
- }
-
- public void setNickname(String nickname) {
- this.nickname = nickname;
- }
-
- public void setNewNickname(String newNickname) {
- this.newNickname = newNickname;
- }
-
- @Override
- public String toString() {
- return "FtxChangeSubAccountNamePOJO{"
- + "nickname='"
- + nickname
- + '\''
- + ", newNickname='"
- + newNickname
- + '\''
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxConvertAcceptPayloadRequestDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxConvertAcceptPayloadRequestDto.java
deleted file mode 100644
index 31eb8828e8f..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxConvertAcceptPayloadRequestDto.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class FtxConvertAcceptPayloadRequestDto {
-
- @JsonProperty("quoteId")
- private final int quoteId;
-
- @JsonCreator
- public FtxConvertAcceptPayloadRequestDto(@JsonProperty("quoteId") int quoteId) {
- this.quoteId = quoteId;
- }
-
- public int getQuoteId() {
- return quoteId;
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxConvertAcceptRequestDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxConvertAcceptRequestDto.java
deleted file mode 100644
index 77a8ded0420..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxConvertAcceptRequestDto.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-
-public class FtxConvertAcceptRequestDto {
-
- @JsonCreator
- public FtxConvertAcceptRequestDto() {}
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxConvertDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxConvertDto.java
deleted file mode 100644
index f45ee651053..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxConvertDto.java
+++ /dev/null
@@ -1,140 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class FtxConvertDto {
-
- @JsonProperty("baseCoin")
- private final String baseCoin;
-
- @JsonProperty("cost")
- private final double cost;
-
- @JsonProperty("expired")
- private final boolean expired;
-
- // @JsonProperty("expiry")
- // private final Date expiry;
-
- @JsonProperty("filled")
- private final boolean filled;
-
- @JsonProperty("fromCoin")
- private final String fromCoin;
-
- @JsonProperty("id")
- private final int id;
-
- @JsonProperty("price")
- private final double price;
-
- @JsonProperty("proceeds")
- private final double proceeds;
-
- @JsonProperty("quoteCoin")
- private final String quoteCoin;
-
- @JsonProperty("side")
- private final String side;
-
- @JsonProperty("toCoin")
- private final String toCoin;
-
- @JsonCreator
- public FtxConvertDto(
- @JsonProperty(value = "baseCoin", required = false) String baseCoin,
- @JsonProperty(value = "cost", required = false) double cost,
- @JsonProperty(value = "expired", required = false) boolean expired,
- @JsonProperty(value = "filled", required = false) boolean filled,
- @JsonProperty(value = "fromCoin", required = false) String fromCoin,
- @JsonProperty(value = "id", required = false) int id,
- @JsonProperty(value = "price", required = false) double price,
- @JsonProperty(value = "proceeds", required = false) double proceeds,
- @JsonProperty(value = "quoteCoin", required = false) String quoteCoin,
- @JsonProperty(value = "side", required = false) String side,
- @JsonProperty(value = "toCoin", required = false) String toCoin) {
- this.baseCoin = baseCoin;
- this.cost = cost;
- this.expired = expired;
- this.filled = filled;
- this.fromCoin = fromCoin;
- this.id = id;
- this.price = price;
- this.proceeds = proceeds;
- this.quoteCoin = quoteCoin;
- this.side = side;
- this.toCoin = toCoin;
- }
-
- public String getBaseCoin() {
- return baseCoin;
- }
-
- public double getCost() {
- return cost;
- }
-
- public boolean isExpired() {
- return expired;
- }
-
- public boolean isFilled() {
- return filled;
- }
-
- public String getFromCoin() {
- return fromCoin;
- }
-
- public int getId() {
- return id;
- }
-
- public double getPrice() {
- return price;
- }
-
- public double getProceeds() {
- return proceeds;
- }
-
- public String getQuoteCoin() {
- return quoteCoin;
- }
-
- public String getSide() {
- return side;
- }
-
- public String getToCoin() {
- return toCoin;
- }
-
- @Override
- public String toString() {
- return "FtxConvertDto [baseCoin="
- + baseCoin
- + ", cost="
- + cost
- + ", expired="
- + expired
- + ", filled="
- + filled
- + ", fromCoin="
- + fromCoin
- + ", id="
- + id
- + ", price="
- + price
- + ", proceeds="
- + proceeds
- + ", quoteCoin="
- + quoteCoin
- + ", side="
- + side
- + ", toCoin="
- + toCoin
- + "]";
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxConvertSimulatePayloadRequestDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxConvertSimulatePayloadRequestDto.java
deleted file mode 100644
index cb2bd64ca31..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxConvertSimulatePayloadRequestDto.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class FtxConvertSimulatePayloadRequestDto {
-
- @JsonProperty("fromCoin")
- private final String fromCoin;
-
- @JsonProperty("toCoin")
- private final String toCoin;
-
- @JsonProperty("size")
- private final double size;
-
- @JsonCreator
- public FtxConvertSimulatePayloadRequestDto(
- @JsonProperty("fromCoin") String fromCoin,
- @JsonProperty("toCoin") String toCoin,
- @JsonProperty("size") double size) {
- this.fromCoin = fromCoin;
- this.toCoin = toCoin;
- this.size = size;
- }
-
- public String getFromCoin() {
- return fromCoin;
- }
-
- public String getToCoin() {
- return toCoin;
- }
-
- public double getSize() {
- return size;
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxConvertSimulatetDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxConvertSimulatetDto.java
deleted file mode 100644
index f0d606dc6f8..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxConvertSimulatetDto.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class FtxConvertSimulatetDto {
-
- @JsonProperty("quoteId")
- private final int quoteId;
-
- @JsonCreator
- public FtxConvertSimulatetDto(@JsonProperty("quoteId") int quoteId) {
- this.quoteId = quoteId;
- }
-
- public int getQuoteId() {
- return quoteId;
- }
-
- @Override
- public String toString() {
- return "FtxConvertSimulatetDto [quoteId=" + quoteId + "]";
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxFundingPaymentsDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxFundingPaymentsDto.java
deleted file mode 100644
index 49b415f79b5..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxFundingPaymentsDto.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-import java.util.Date;
-
-public class FtxFundingPaymentsDto {
-
- @JsonProperty("future")
- private final String future;
-
- @JsonProperty("id")
- private final String id;
-
- @JsonProperty("payment")
- private final BigDecimal payment;
-
- @JsonProperty("time")
- private final Date time;
-
- @JsonProperty("rate")
- private final BigDecimal rate;
-
- public FtxFundingPaymentsDto(
- @JsonProperty("future") String future,
- @JsonProperty("id") String id,
- @JsonProperty("payment") BigDecimal payment,
- @JsonProperty("time") Date time,
- @JsonProperty("rate") BigDecimal rate) {
- this.future = future;
- this.id = id;
- this.payment = payment;
- this.time = time;
- this.rate = rate;
- }
-
- public String getFuture() {
- return future;
- }
-
- public String getId() {
- return id;
- }
-
- public BigDecimal getPayment() {
- return payment;
- }
-
- public Date getTime() {
- return time;
- }
-
- public BigDecimal getRate() {
- return rate;
- }
-
- @Override
- public String toString() {
- return "FtxFundingPaymentsDto{"
- + "future='"
- + future
- + '\''
- + ", id='"
- + id
- + '\''
- + ", payment="
- + payment
- + ", time="
- + time
- + ", rate="
- + rate
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxFundingRatePayload.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxFundingRatePayload.java
deleted file mode 100644
index 0665687c23f..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxFundingRatePayload.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class FtxFundingRatePayload {
-
- @JsonProperty("start_time")
- private final Long start_time;
-
- @JsonProperty("end_time")
- private final Long end_time;
-
- @JsonProperty("future")
- private final String future;
-
- public FtxFundingRatePayload(
- @JsonProperty("start_time") Long start_time,
- @JsonProperty("end_time") Long end_time,
- @JsonProperty("future") String future) {
- this.start_time = start_time;
- this.end_time = end_time;
- this.future = future;
- }
-
- public Long getStart_time() {
- return start_time;
- }
-
- public Long getEnd_time() {
- return end_time;
- }
-
- public String getFuture() {
- return future;
- }
-
- @Override
- public String toString() {
- return "FtxFundingRatePayload{"
- + "start_time="
- + start_time
- + ", end_time="
- + end_time
- + ", future='"
- + future
- + '\''
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxLendDataDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxLendDataDto.java
deleted file mode 100644
index 085a2c3f913..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxLendDataDto.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class FtxLendDataDto {
-
- @JsonProperty("coin")
- private final String coin;
-
- @JsonProperty("locked")
- private final double locked;
-
- @JsonProperty("currentOffered")
- private final double currentOffered;
-
- @JsonProperty("newOffered")
- private final double newOffered;
-
- @JsonProperty("rate")
- private final double rate;
-
- public FtxLendDataDto(
- @JsonProperty("coin") String coin,
- @JsonProperty("locked") double locked,
- @JsonProperty("currentOffered") double currentOffered,
- @JsonProperty("newOffered") double newOffered,
- @JsonProperty("rate") double rate) {
- this.coin = coin;
- this.locked = locked;
- this.currentOffered = currentOffered;
- this.newOffered = newOffered;
- this.rate = rate;
- }
-
- public String getCoin() {
- return coin;
- }
-
- public double getLocked() {
- return locked;
- }
-
- public double getCurrentOffered() {
- return currentOffered;
- }
-
- public double getNewOffered() {
- return newOffered;
- }
-
- public double getRate() {
- return rate;
- }
-
- @Override
- public String toString() {
- return "FtxLendDataDto{"
- + "coin='"
- + coin
- + '\''
- + ", locked="
- + locked
- + ", currentOffered="
- + currentOffered
- + ", newOffered="
- + newOffered
- + ", rate="
- + rate
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxLendingHistoryDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxLendingHistoryDto.java
deleted file mode 100644
index ca726ca25ab..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxLendingHistoryDto.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.util.Date;
-
-public class FtxLendingHistoryDto {
-
- @JsonProperty("coin")
- private final String coin;
-
- @JsonProperty("cost")
- private final double cost;
-
- @JsonProperty("rate")
- private final double rate;
-
- @JsonProperty("size")
- private final double size;
-
- @JsonProperty("time")
- private final Date time;
-
- public FtxLendingHistoryDto(
- @JsonProperty("coin") String coin,
- @JsonProperty("cost") double cost,
- @JsonProperty("rate") double rate,
- @JsonProperty("size") double size,
- @JsonProperty("time") Date time) {
- this.coin = coin;
- this.cost = cost;
- this.rate = rate;
- this.size = size;
- this.time = time;
- }
-
- public String getCoin() {
- return coin;
- }
-
- public double getCost() {
- return cost;
- }
-
- public double getRate() {
- return rate;
- }
-
- public double getSize() {
- return size;
- }
-
- public Date getTime() {
- return time;
- }
-
- @Override
- public String toString() {
- return "FtxLendingHistoriesDto{"
- + "coin='"
- + coin
- + '\''
- + ", cost="
- + cost
- + ", rate="
- + rate
- + ", size="
- + size
- + ", time='"
- + time
- + '\''
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxLendingInfoDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxLendingInfoDto.java
deleted file mode 100644
index 714887acb44..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxLendingInfoDto.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class FtxLendingInfoDto {
-
- @JsonProperty("coin")
- private final String coin;
-
- @JsonProperty("lendable")
- private final double lendable;
-
- @JsonProperty("locked")
- private final double locked;
-
- @JsonProperty("minRate")
- private final double minRate;
-
- @JsonProperty("offered")
- private final double offered;
-
- @JsonCreator
- public FtxLendingInfoDto(
- @JsonProperty("coin") String coin,
- @JsonProperty("lendable") double lendable,
- @JsonProperty("locked") double locked,
- @JsonProperty("minRate") double minRate,
- @JsonProperty("offered") double offered) {
- this.coin = coin;
- this.lendable = lendable;
- this.locked = locked;
- this.minRate = minRate;
- this.offered = offered;
- }
-
- public String getCoin() {
- return coin;
- }
-
- public double getLendable() {
- return lendable;
- }
-
- public double getLocked() {
- return locked;
- }
-
- public double getMinRate() {
- return minRate;
- }
-
- public double getOffered() {
- return offered;
- }
-
- @Override
- public String toString() {
- return "FtxLendingInfoDto{"
- + "coin='"
- + coin
- + '\''
- + ", lendable="
- + lendable
- + ", locked="
- + locked
- + ", minRate="
- + minRate
- + ", offered="
- + offered
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxLendingRatesDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxLendingRatesDto.java
deleted file mode 100644
index 1ef62176d2e..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxLendingRatesDto.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class FtxLendingRatesDto {
-
- @JsonProperty("coin")
- private final String coin;
-
- @JsonProperty("previous")
- private final double previous;
-
- @JsonProperty("estimate")
- private final double estimate;
-
- @JsonCreator
- public FtxLendingRatesDto(
- @JsonProperty("coin") String coin,
- @JsonProperty("previous") double previous,
- @JsonProperty("estimate") double estimate) {
- this.coin = coin;
- this.previous = previous;
- this.estimate = estimate;
- }
-
- public String getCoin() {
- return coin;
- }
-
- public double getPrevious() {
- return previous;
- }
-
- public double getEstimate() {
- return estimate;
- }
-
- @Override
- public String toString() {
- return "FtxLendingRatesDto{"
- + "coin='"
- + coin
- + '\''
- + ", previous="
- + previous
- + ", estimate="
- + estimate
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxLeverageDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxLeverageDto.java
deleted file mode 100644
index f0f11542645..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxLeverageDto.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class FtxLeverageDto {
-
- private final int leverage;
-
- public FtxLeverageDto(@JsonProperty("leverage") int leverage) {
- this.leverage = leverage;
- }
-
- public int getLeverage() {
- return leverage;
- }
-
- @Override
- public String toString() {
- return "FtxLeverageDto{" + "leverage=" + leverage + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxPositionDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxPositionDto.java
deleted file mode 100644
index b7e948c9d18..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxPositionDto.java
+++ /dev/null
@@ -1,240 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-import org.knowm.xchange.ftx.dto.trade.FtxOrderSide;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class FtxPositionDto {
-
- @JsonProperty("cost")
- private final BigDecimal cost;
-
- @JsonProperty("entryPrice")
- private final BigDecimal entryPrice;
-
- @JsonProperty("estimatedLiquidationPrice")
- private final BigDecimal estimatedLiquidationPrice;
-
- @JsonProperty("future")
- private final String future;
-
- @JsonProperty("initialMarginRequirement")
- private final BigDecimal initialMarginRequirement;
-
- @JsonProperty("longOrderSize")
- private final BigDecimal longOrderSize;
-
- @JsonProperty("maintenanceMarginRequirement")
- private final BigDecimal maintenanceMarginRequirement;
-
- @JsonProperty("netSize")
- private final BigDecimal netSize;
-
- @JsonProperty("openSize")
- private final BigDecimal openSize;
-
- @JsonProperty("realizedPnl")
- private final BigDecimal realizedPnl;
-
- @JsonProperty("shortOrderSize")
- private final BigDecimal shortOrderSize;
-
- @JsonProperty("side")
- private final FtxOrderSide side;
-
- @JsonProperty("size")
- private final BigDecimal size;
-
- @JsonProperty("unrealizedPnl")
- private final BigDecimal unrealizedPnl;
-
- @JsonProperty("collateralUsed")
- private final BigDecimal collateralUsed;
-
- @JsonProperty("recentBreakEvenPrice")
- private final BigDecimal recentBreakEvenPrice;
-
- @JsonProperty("recentAverageOpenPrice")
- private final BigDecimal recentAverageOpenPrice;
-
- @JsonProperty("recentPnl")
- private final BigDecimal recentPnl;
-
- @JsonProperty("cumulativeBuySize")
- private final BigDecimal cumulativeBuySize;
-
- @JsonProperty("cumulativeSellSize")
- private final BigDecimal cumulativeSellSize;
-
- public FtxPositionDto(
- @JsonProperty("cost") BigDecimal cost,
- @JsonProperty("entryPrice") BigDecimal entryPrice,
- @JsonProperty("estimatedLiquidationPrice") BigDecimal estimatedLiquidationPrice,
- @JsonProperty("future") String future,
- @JsonProperty("initialMarginRequirement") BigDecimal initialMarginRequirement,
- @JsonProperty("longOrderSize") BigDecimal longOrderSize,
- @JsonProperty("maintenanceMarginRequirement") BigDecimal maintenanceMarginRequirement,
- @JsonProperty("netSize") BigDecimal netSize,
- @JsonProperty("openSize") BigDecimal openSize,
- @JsonProperty("realizedPnl") BigDecimal realizedPnl,
- @JsonProperty("shortOrderSize") BigDecimal shortOrderSize,
- @JsonProperty("side") FtxOrderSide side,
- @JsonProperty("size") BigDecimal size,
- @JsonProperty("unrealizedPnl") BigDecimal unrealizedPnl,
- @JsonProperty("collateralUsed") BigDecimal collateralUsed,
- @JsonProperty("recentBreakEvenPrice") BigDecimal recentBreakEvenPrice,
- @JsonProperty("recentAverageOpenPrice") BigDecimal recentAverageOpenPrice,
- @JsonProperty("recentPnl") BigDecimal recentPnl,
- @JsonProperty("cumulativeBuySize") BigDecimal cumulativeBuySize,
- @JsonProperty("cumulativeSellSize") BigDecimal cumulativeSellSize) {
- this.cost = cost;
- this.entryPrice = entryPrice;
- this.estimatedLiquidationPrice = estimatedLiquidationPrice;
- this.future = future;
- this.initialMarginRequirement = initialMarginRequirement;
- this.longOrderSize = longOrderSize;
- this.maintenanceMarginRequirement = maintenanceMarginRequirement;
- this.netSize = netSize;
- this.openSize = openSize;
- this.realizedPnl = realizedPnl;
- this.shortOrderSize = shortOrderSize;
- this.side = side;
- this.size = size;
- this.unrealizedPnl = unrealizedPnl;
- this.collateralUsed = collateralUsed;
- this.recentBreakEvenPrice = recentBreakEvenPrice;
- this.recentAverageOpenPrice = recentAverageOpenPrice;
- this.recentPnl = recentPnl;
- this.cumulativeBuySize = cumulativeBuySize;
- this.cumulativeSellSize = cumulativeSellSize;
- }
-
- public BigDecimal getCost() {
- return cost;
- }
-
- public BigDecimal getEntryPrice() {
- return entryPrice;
- }
-
- public BigDecimal getEstimatedLiquidationPrice() {
- return estimatedLiquidationPrice;
- }
-
- public String getFuture() {
- return future;
- }
-
- public BigDecimal getInitialMarginRequirement() {
- return initialMarginRequirement;
- }
-
- public BigDecimal getLongOrderSize() {
- return longOrderSize;
- }
-
- public BigDecimal getMaintenanceMarginRequirement() {
- return maintenanceMarginRequirement;
- }
-
- public BigDecimal getNetSize() {
- return netSize;
- }
-
- public BigDecimal getOpenSize() {
- return openSize;
- }
-
- public BigDecimal getRealizedPnl() {
- return realizedPnl;
- }
-
- public BigDecimal getShortOrderSize() {
- return shortOrderSize;
- }
-
- public FtxOrderSide getSide() {
- return side;
- }
-
- public BigDecimal getSize() {
- return size;
- }
-
- public BigDecimal getUnrealizedPnl() {
- return unrealizedPnl;
- }
-
- public BigDecimal getCollateralUsed() {
- return collateralUsed;
- }
-
- public BigDecimal getRecentBreakEvenPrice() {
- return recentBreakEvenPrice;
- }
-
- public BigDecimal getRecentAverageOpenPrice() {
- return recentAverageOpenPrice;
- }
-
- public BigDecimal getRecentPnl() {
- return recentPnl;
- }
-
- public BigDecimal getCumulativeBuySize() {
- return cumulativeBuySize;
- }
-
- public BigDecimal getCumulativeSellSize() {
- return cumulativeSellSize;
- }
-
- @Override
- public String toString() {
- return "FtxPositionDto{"
- + "cost="
- + cost
- + ", entryPrice="
- + entryPrice
- + ", estimatedLiquidationPrice="
- + estimatedLiquidationPrice
- + ", future='"
- + future
- + '\''
- + ", initialMarginRequirement="
- + initialMarginRequirement
- + ", longOrderSize="
- + longOrderSize
- + ", maintenanceMarginRequirement="
- + maintenanceMarginRequirement
- + ", netSize="
- + netSize
- + ", openSize="
- + openSize
- + ", realizedPnl="
- + realizedPnl
- + ", shortOrderSize="
- + shortOrderSize
- + ", side="
- + side
- + ", size="
- + size
- + ", unrealizedPnl="
- + unrealizedPnl
- + ", collateralUsed="
- + collateralUsed
- + ", recentBreakEvenPrice="
- + recentBreakEvenPrice
- + ", recentAverageOpenPrice="
- + recentAverageOpenPrice
- + ", recentPnl="
- + recentPnl
- + ", cumulativeBuySize="
- + cumulativeBuySize
- + ", cumulativeSellSize="
- + cumulativeSellSize
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountBalanceDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountBalanceDto.java
deleted file mode 100644
index bf902266656..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountBalanceDto.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-
-public class FtxSubAccountBalanceDto {
-
- private final String coin;
-
- private final BigDecimal free;
-
- private final BigDecimal total;
-
- public FtxSubAccountBalanceDto(
- @JsonProperty("coin") String coin,
- @JsonProperty("free") BigDecimal free,
- @JsonProperty("total") BigDecimal total) {
- this.coin = coin;
- this.free = free;
- this.total = total;
- }
-
- public String getCoin() {
- return coin;
- }
-
- public BigDecimal getFree() {
- return free;
- }
-
- public BigDecimal getTotal() {
- return total;
- }
-
- @Override
- public String toString() {
- return "FtxSubAccountBalanceDto{"
- + "coin='"
- + coin
- + '\''
- + ", free="
- + free
- + ", total="
- + total
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountBalancesDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountBalancesDto.java
deleted file mode 100644
index b3afbc75e8b..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountBalancesDto.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class FtxSubAccountBalancesDto {
-
- private final Map balances = new HashMap<>();
-
- @JsonCreator
- public FtxSubAccountBalancesDto(List listOfBalances) {
- listOfBalances.forEach(
- ftxSubAccountBalanceDto -> {
- balances.put(ftxSubAccountBalanceDto.getCoin(), ftxSubAccountBalanceDto);
- });
- }
-
- public Map getBalances() {
- return balances;
- }
-
- @Override
- public String toString() {
- return "FtxSubAccountBalancesDto{" + "mapBalances=" + balances + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountDto.java
deleted file mode 100644
index 349fffd3fbc..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountDto.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class FtxSubAccountDto {
-
- private final String nickname;
-
- private final String deletable;
-
- private final String editable;
-
- @JsonCreator
- public FtxSubAccountDto(
- @JsonProperty("nickname") String nickname,
- @JsonProperty("deletable") String deletable,
- @JsonProperty("editable") String editable) {
- this.nickname = nickname;
- this.deletable = deletable;
- this.editable = editable;
- }
-
- public String getNickname() {
- return nickname;
- }
-
- public String getDeletable() {
- return deletable;
- }
-
- public String getEditable() {
- return editable;
- }
-
- @Override
- public String toString() {
- return "FtxSubAccountDto{"
- + "nickname='"
- + nickname
- + '\''
- + ", deletable='"
- + deletable
- + '\''
- + ", editable='"
- + editable
- + '\''
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountRequestPOJO.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountRequestPOJO.java
deleted file mode 100644
index 021870799bf..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountRequestPOJO.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-public class FtxSubAccountRequestPOJO {
-
- private String nickname;
-
- public FtxSubAccountRequestPOJO(String nickname) {
- this.nickname = nickname;
- }
-
- public String getNickname() {
- return nickname;
- }
-
- public void setNickname(String nickname) {
- this.nickname = nickname;
- }
-
- @Override
- public String toString() {
- return "FtxSubAccountPOJO{" + "nickname='" + nickname + '\'' + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountTranferDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountTranferDto.java
deleted file mode 100644
index 1000a601c9e..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountTranferDto.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-import java.util.Date;
-
-public class FtxSubAccountTranferDto {
-
- private final String id;
-
- private final String coin;
-
- private final BigDecimal size;
-
- private final Date time;
-
- private final String notes;
-
- private final String status;
-
- public FtxSubAccountTranferDto(
- @JsonProperty("id") String id,
- @JsonProperty("coin") String coin,
- @JsonProperty("size") BigDecimal size,
- @JsonProperty("time") Date time,
- @JsonProperty("notes") String notes,
- @JsonProperty("status") String status) {
- this.id = id;
- this.coin = coin;
- this.size = size;
- this.time = time;
- this.notes = notes;
- this.status = status;
- }
-
- public String getId() {
- return id;
- }
-
- public String getCoin() {
- return coin;
- }
-
- public BigDecimal getSize() {
- return size;
- }
-
- public Date getTime() {
- return time;
- }
-
- public String getNotes() {
- return notes;
- }
-
- public String getStatus() {
- return status;
- }
-
- @Override
- public String toString() {
- return "FtxSubAccountTranferDto{"
- + "id='"
- + id
- + '\''
- + ", coin='"
- + coin
- + '\''
- + ", size="
- + size
- + ", time="
- + time
- + ", notes='"
- + notes
- + '\''
- + ", status='"
- + status
- + '\''
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountTransferPOJO.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountTransferPOJO.java
deleted file mode 100644
index 95ff3be923a..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubAccountTransferPOJO.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import java.math.BigDecimal;
-
-public class FtxSubAccountTransferPOJO {
-
- private String coin;
-
- private BigDecimal size;
-
- private String source;
-
- private String destination;
-
- public FtxSubAccountTransferPOJO(
- String coin, BigDecimal size, String source, String destination) {
- this.coin = coin;
- this.size = size;
- this.source = source;
- this.destination = destination;
- }
-
- public String getCoin() {
- return coin;
- }
-
- public void setCoin(String coin) {
- this.coin = coin;
- }
-
- public BigDecimal getSize() {
- return size;
- }
-
- public void setSize(BigDecimal size) {
- this.size = size;
- }
-
- public String getSource() {
- return source;
- }
-
- public void setSource(String source) {
- this.source = source;
- }
-
- public String getDestination() {
- return destination;
- }
-
- public void setDestination(String destination) {
- this.destination = destination;
- }
-
- @Override
- public String toString() {
- return "FtxSubAccountTransferPOJO{"
- + "coin='"
- + coin
- + '\''
- + ", size="
- + size
- + ", source='"
- + source
- + '\''
- + ", destination='"
- + destination
- + '\''
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubmitLendingOfferParams.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubmitLendingOfferParams.java
deleted file mode 100644
index e6e7367532d..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxSubmitLendingOfferParams.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class FtxSubmitLendingOfferParams {
-
- @JsonProperty("coin")
- private final String coin;
-
- @JsonProperty("size")
- private final double size;
-
- @JsonProperty("rate")
- private final double rate;
-
- public FtxSubmitLendingOfferParams(
- @JsonProperty("coin") String coin,
- @JsonProperty("size") double size,
- @JsonProperty("rate") double rate) {
- this.coin = coin;
- this.size = size;
- this.rate = rate;
- }
-
- public String getCoin() {
- return coin;
- }
-
- public double getSize() {
- return size;
- }
-
- public double getRate() {
- return rate;
- }
-
- @Override
- public String toString() {
- return "FtxSubmitLendingOfferParams{"
- + "coin='"
- + coin
- + '\''
- + ", size="
- + size
- + ", rate="
- + rate
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxWalletBalanceDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxWalletBalanceDto.java
deleted file mode 100644
index 3f0eab095f9..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/account/FtxWalletBalanceDto.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-import org.knowm.xchange.currency.Currency;
-
-public class FtxWalletBalanceDto {
-
- @JsonProperty("coin")
- private Currency coin;
-
- @JsonProperty("free")
- private BigDecimal free;
-
- @JsonProperty("total")
- private BigDecimal total;
-
- public FtxWalletBalanceDto(
- @JsonProperty("coin") Currency coin,
- @JsonProperty("free") BigDecimal free,
- @JsonProperty("total") BigDecimal total) {
- this.coin = coin;
- this.free = free;
- this.total = total;
- }
-
- public Currency getCoin() {
- return coin;
- }
-
- public BigDecimal getFree() {
- return free;
- }
-
- public BigDecimal getTotal() {
- return total;
- }
-
- @Override
- public String toString() {
- return "FtxWalletBalanceDto{" + "coin=" + coin + ", free=" + free + ", total=" + total + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxCandleDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxCandleDto.java
deleted file mode 100644
index 527d922c0de..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxCandleDto.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.knowm.xchange.ftx.dto.marketdata;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-import java.util.Date;
-
-public class FtxCandleDto {
-
- @JsonProperty("open")
- private final BigDecimal open;
-
- @JsonProperty("close")
- private final BigDecimal close;
-
- @JsonProperty("high")
- private final BigDecimal high;
-
- @JsonProperty("low")
- private final BigDecimal low;
-
- @JsonProperty("volume")
- private final BigDecimal volume;
-
- @JsonProperty("startTime")
- private final Date startTime;
-
- @JsonCreator
- public FtxCandleDto(
- @JsonProperty("close") BigDecimal close,
- @JsonProperty("open") BigDecimal open,
- @JsonProperty("high") BigDecimal high,
- @JsonProperty("low") BigDecimal low,
- @JsonProperty("volume") BigDecimal volume,
- @JsonProperty("startTime") Date startTime) {
-
- this.close = close;
- this.open = open;
- this.high = high;
- this.low = low;
- this.volume = volume;
- this.startTime = startTime;
- }
-
- public BigDecimal getOpen() {
- return this.open;
- }
-
- public BigDecimal getHigh() {
- return this.high;
- }
-
- public BigDecimal getLow() {
- return this.low;
- }
-
- public BigDecimal getClose() {
- return this.close;
- }
-
- public BigDecimal getVolume() {
- return this.volume;
- }
-
- public Date getStartTime() {
- return this.startTime;
- }
-
- @Override
- public String toString() {
- return "FtxCandleDto{"
- + "startTime="
- + startTime.toString()
- + "open="
- + open
- + ", high="
- + high
- + ", low="
- + low
- + ", close="
- + close
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxMarketDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxMarketDto.java
deleted file mode 100644
index 45fcf446bbc..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxMarketDto.java
+++ /dev/null
@@ -1,266 +0,0 @@
-package org.knowm.xchange.ftx.dto.marketdata;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-
-public class FtxMarketDto {
-
- @JsonProperty("ask")
- private final BigDecimal ask;
-
- @JsonProperty("baseCurrency")
- private final String baseCurrency;
-
- @JsonProperty("bid")
- private final BigDecimal bid;
-
- @JsonProperty("change1h")
- private final BigDecimal change1h;
-
- @JsonProperty("change24h")
- private final BigDecimal change24h;
-
- @JsonProperty("changeBod")
- private final BigDecimal changeBod;
-
- @JsonProperty("enabled")
- private final boolean enabled;
-
- @JsonProperty("highLeverageFeeExempt")
- private final boolean highLeverageFeeExempt;
-
- @JsonProperty("last")
- private final BigDecimal last;
-
- @JsonProperty("minProvideSize")
- private final BigDecimal minProvideSize;
-
- @JsonProperty("name")
- private final String name;
-
- @JsonProperty("postOnly")
- private final boolean postOnly;
-
- @JsonProperty("price")
- private final BigDecimal price;
-
- @JsonProperty("priceIncrement")
- private final BigDecimal priceIncrement;
-
- @JsonProperty("quoteCurrency")
- private final String quoteCurrency;
-
- @JsonProperty("quoteVolume24h")
- private final BigDecimal quoteVolume24h;
-
- @JsonProperty("restricted")
- private final boolean restricted;
-
- @JsonProperty("sizeIncrement")
- private final BigDecimal sizeIncrement;
-
- @JsonProperty("tokenizedEquity")
- private final boolean tokenizedEquity;
-
- @JsonProperty("type")
- private final String type;
-
- @JsonProperty("underlying")
- private final String underlying;
-
- @JsonProperty("volumeUsd24h")
- private final BigDecimal volumeUsd24h;
-
- @JsonCreator
- public FtxMarketDto(
- @JsonProperty("ask") BigDecimal ask,
- @JsonProperty("baseCurrency") String baseCurrency,
- @JsonProperty("bid") BigDecimal bid,
- @JsonProperty("change1h") BigDecimal change1h,
- @JsonProperty("change24h") BigDecimal change24h,
- @JsonProperty("changeBod") BigDecimal changeBod,
- @JsonProperty("enabled") boolean enabled,
- @JsonProperty("highLeverageFeeExempt") boolean highLeverageFeeExempt,
- @JsonProperty("last") BigDecimal last,
- @JsonProperty("minProvideSize") BigDecimal minProvideSize,
- @JsonProperty("name") String name,
- @JsonProperty("postOnly") boolean postOnly,
- @JsonProperty("price") BigDecimal price,
- @JsonProperty("priceIncrement") BigDecimal priceIncrement,
- @JsonProperty("quoteCurrency") String quoteCurrency,
- @JsonProperty("quoteVolume24h") BigDecimal quoteVolume24h,
- @JsonProperty("restricted") boolean restricted,
- @JsonProperty("sizeIncrement") BigDecimal sizeIncrement,
- @JsonProperty("tokenizedEquity") boolean tokenizedEquity,
- @JsonProperty("type") String type,
- @JsonProperty("underlying") String underlying,
- @JsonProperty("volumeUsd24h") BigDecimal volumeUsd24h) {
-
- this.ask = ask;
- this.baseCurrency = baseCurrency;
- this.bid = bid;
- this.change1h = change1h;
- this.change24h = change24h;
- this.changeBod = changeBod;
- this.enabled = enabled;
- this.highLeverageFeeExempt = highLeverageFeeExempt;
- this.last = last;
- this.minProvideSize = minProvideSize;
- this.name = name;
- this.postOnly = postOnly;
- this.price = price;
- this.priceIncrement = priceIncrement;
- this.quoteCurrency = quoteCurrency;
- this.quoteVolume24h = quoteVolume24h;
- this.restricted = restricted;
- this.sizeIncrement = sizeIncrement;
- this.tokenizedEquity = tokenizedEquity;
- this.type = type;
- this.underlying = underlying;
- this.volumeUsd24h = volumeUsd24h;
- }
-
- public BigDecimal getAsk() {
- return ask;
- }
-
- public String getBaseCurrency() {
- return baseCurrency;
- }
-
- public BigDecimal getBid() {
- return bid;
- }
-
- public BigDecimal getChange1h() {
- return change1h;
- }
-
- public BigDecimal getChange24h() {
- return change24h;
- }
-
- public BigDecimal getChangeBod() {
- return changeBod;
- }
-
- public boolean isEnabled() {
- return enabled;
- }
-
- public boolean isHighLeverageFeeExempt() {
- return highLeverageFeeExempt;
- }
-
- public BigDecimal getLast() {
- return last;
- }
-
- public BigDecimal getMinProvideSize() {
- return minProvideSize;
- }
-
- public String getName() {
- return name;
- }
-
- public boolean isPostOnly() {
- return postOnly;
- }
-
- public BigDecimal getPrice() {
- return price;
- }
-
- public BigDecimal getPriceIncrement() {
- return priceIncrement;
- }
-
- public String getQuoteCurrency() {
- return quoteCurrency;
- }
-
- public BigDecimal getQuoteVolume24h() {
- return quoteVolume24h;
- }
-
- public boolean isRestricted() {
- return restricted;
- }
-
- public BigDecimal getSizeIncrement() {
- return sizeIncrement;
- }
-
- public boolean isTokenizedEquity() {
- return tokenizedEquity;
- }
-
- public String getType() {
- return type;
- }
-
- public String getUnderlying() {
- return underlying;
- }
-
- public BigDecimal getVolumeUsd24h() {
- return volumeUsd24h;
- }
-
- @Override
- public String toString() {
- return "FtxMarketDto{"
- + "ask="
- + ask
- + ", baseCurrency='"
- + baseCurrency
- + '\''
- + ", bid="
- + bid
- + ", change1h="
- + change1h
- + ", change24h="
- + change24h
- + ", changeBod="
- + changeBod
- + ", enabled="
- + enabled
- + ", highLeverageFeeExempt="
- + highLeverageFeeExempt
- + ", last="
- + last
- + ", minProvideSize="
- + minProvideSize
- + ", name='"
- + name
- + '\''
- + ", postOnly="
- + postOnly
- + ", price="
- + price
- + ", priceIncrement="
- + priceIncrement
- + ", quoteCurrency='"
- + quoteCurrency
- + '\''
- + ", quoteVolume24h="
- + quoteVolume24h
- + ", restricted="
- + restricted
- + ", sizeIncrement="
- + sizeIncrement
- + ", tokenizedEquity="
- + tokenizedEquity
- + ", type='"
- + type
- + '\''
- + ", underlying='"
- + underlying
- + '\''
- + ", volumeUsd24h="
- + volumeUsd24h
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxMarketsDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxMarketsDto.java
deleted file mode 100644
index 5a5040b050b..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxMarketsDto.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.knowm.xchange.ftx.dto.marketdata;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import java.util.List;
-
-public class FtxMarketsDto {
-
- private final List marketList;
-
- @JsonCreator
- public FtxMarketsDto(List marketList) {
- this.marketList = marketList;
- }
-
- public List getMarketList() {
- return marketList;
- }
-
- @Override
- public String toString() {
- return "FtxMarketsDto{" + "marketList=" + marketList + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxOrderbookDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxOrderbookDto.java
deleted file mode 100644
index b58eaaa0cd0..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxOrderbookDto.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.knowm.xchange.ftx.dto.marketdata;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.util.List;
-
-public class FtxOrderbookDto {
-
- private final List asks;
-
- private final List bids;
-
- @JsonCreator
- public FtxOrderbookDto(
- @JsonProperty("asks") List asks,
- @JsonProperty("bids") List bids) {
- this.asks = asks;
- this.bids = bids;
- }
-
- public List getAsks() {
- return asks;
- }
-
- public List getBids() {
- return bids;
- }
-
- @Override
- public String toString() {
- return "FtxOrderbookResponse{" + "asks=" + asks + ", bids=" + bids + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxPublicOrder.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxPublicOrder.java
deleted file mode 100644
index 30c6b1e36cd..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxPublicOrder.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.knowm.xchange.ftx.dto.marketdata;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.io.IOException;
-import java.math.BigDecimal;
-
-@JsonDeserialize(using = FtxPublicOrder.FtxOrderDeserializer.class)
-public class FtxPublicOrder {
-
- private final BigDecimal price;
- private final BigDecimal volume;
-
- public FtxPublicOrder(BigDecimal price, BigDecimal volume) {
-
- this.price = price;
- this.volume = volume;
- }
-
- public BigDecimal getPrice() {
-
- return price;
- }
-
- public BigDecimal getVolume() {
-
- return volume;
- }
-
- @Override
- public String toString() {
- return "FtxPublicOrder{" + "price=" + price + ", volume=" + volume + '}';
- }
-
- static class FtxOrderDeserializer extends JsonDeserializer {
-
- @Override
- public FtxPublicOrder deserialize(JsonParser jsonParser, DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- ObjectCodec oc = jsonParser.getCodec();
- JsonNode node = oc.readTree(jsonParser);
- if (node.isArray()) {
- BigDecimal price = new BigDecimal(node.path(0).asText());
- BigDecimal volume = new BigDecimal(node.path(1).asText());
-
- return new FtxPublicOrder(price, volume);
- }
-
- return null;
- }
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxTradeDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxTradeDto.java
deleted file mode 100644
index 216ba0932fb..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/marketdata/FtxTradeDto.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.knowm.xchange.ftx.dto.marketdata;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-import java.util.Date;
-import org.knowm.xchange.ftx.dto.trade.FtxOrderSide;
-
-public class FtxTradeDto {
-
- private final String id;
-
- private final boolean liquidation;
-
- private final BigDecimal price;
-
- private final FtxOrderSide side;
-
- private final BigDecimal size;
-
- private final Date time;
-
- public FtxTradeDto(
- @JsonProperty("id") String id,
- @JsonProperty("liquidation") boolean liquidation,
- @JsonProperty("price") BigDecimal price,
- @JsonProperty("side") FtxOrderSide side,
- @JsonProperty("size") BigDecimal size,
- @JsonProperty("time") Date time) {
- this.id = id;
- this.liquidation = liquidation;
- this.price = price;
- this.side = side;
- this.size = size;
- this.time = time;
- }
-
- public String getId() {
- return id;
- }
-
- public boolean isLiquidation() {
- return liquidation;
- }
-
- public BigDecimal getPrice() {
- return price;
- }
-
- public FtxOrderSide getSide() {
- return side;
- }
-
- public BigDecimal getSize() {
- return size;
- }
-
- public Date getTime() {
- return time;
- }
-
- @Override
- public String toString() {
- return "FtxTradeDto{"
- + "id='"
- + id
- + '\''
- + ", liquidation="
- + liquidation
- + ", price="
- + price
- + ", side="
- + side
- + ", size="
- + size
- + ", time="
- + time
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/CancelAllFtxOrdersParams.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/CancelAllFtxOrdersParams.java
deleted file mode 100644
index a8eac80a7ab..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/CancelAllFtxOrdersParams.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.knowm.xchange.service.trade.params.CancelOrderParams;
-
-public class CancelAllFtxOrdersParams implements CancelOrderParams {
-
- private final String market;
-
- private final boolean conditionalOrdersOnly;
-
- public CancelAllFtxOrdersParams(@JsonProperty("market") String market) {
- this.market = market;
- this.conditionalOrdersOnly = false;
- }
-
- public CancelAllFtxOrdersParams(
- @JsonProperty("market") String market,
- @JsonProperty("conditionalOrdersOnly") boolean conditionalOrdersOnly) {
- this.market = market;
- this.conditionalOrdersOnly = conditionalOrdersOnly;
- }
-
- public String getMarket() {
- return market;
- }
-
- public boolean isConditionalOrdersOnly() {
- return conditionalOrdersOnly;
- }
-
- @Override
- public String toString() {
- return "CancelAllFtxOrdersParams{"
- + "market='"
- + market
- + '\''
- + ", conditionalOrdersOnly="
- + conditionalOrdersOnly
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/CancelConditionalOrderFtxParams.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/CancelConditionalOrderFtxParams.java
deleted file mode 100644
index 5072eecd6a4..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/CancelConditionalOrderFtxParams.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-import org.knowm.xchange.service.trade.params.CancelOrderParams;
-
-public class CancelConditionalOrderFtxParams implements CancelOrderParams {
-
- private final String orderId;
-
- public CancelConditionalOrderFtxParams(String orderId) {
- this.orderId = orderId;
- }
-
- public String getOrderId() {
- return orderId;
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxConditionalOrderDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxConditionalOrderDto.java
deleted file mode 100644
index ac0f403f15b..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxConditionalOrderDto.java
+++ /dev/null
@@ -1,185 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-import java.util.Date;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class FtxConditionalOrderDto {
-
- private final Date createdAt;
-
- private final String future;
- private final String id;
- private final String market;
- private final BigDecimal orderPrice;
- private final boolean reduceOnly;
- private final FtxOrderSide side;
- private final BigDecimal size;
- private final FtxOrderStatus status;
- private final BigDecimal trailStart;
- private final BigDecimal trailValue;
- private final BigDecimal triggerPrice;
- private final Date triggeredAt;
- private final FtxConditionalOrderType type;
- private final FtxOrderType orderType;
- private final BigDecimal filledSize;
- private final BigDecimal avgFillPrice;
- private final boolean retryUntilFilled;
-
- @JsonCreator
- public FtxConditionalOrderDto(
- @JsonProperty("createdAt") Date createdAt,
- @JsonProperty("future") String future,
- @JsonProperty("id") String id,
- @JsonProperty("market") String market,
- @JsonProperty("orderPrice") BigDecimal orderPrice,
- @JsonProperty("reduceOnly") boolean reduceOnly,
- @JsonProperty("side") FtxOrderSide side,
- @JsonProperty("size") BigDecimal size,
- @JsonProperty("status") FtxOrderStatus status,
- @JsonProperty("trailStart") BigDecimal trailStart,
- @JsonProperty("trailValue") BigDecimal trailValue,
- @JsonProperty("triggerPrice") BigDecimal triggerPrice,
- @JsonProperty("triggeredAt") Date triggeredAt,
- @JsonProperty("type") FtxConditionalOrderType type,
- @JsonProperty("orderType") FtxOrderType orderType,
- @JsonProperty("filledSize") BigDecimal filledSize,
- @JsonProperty("avgFillPrice") BigDecimal avgFillPrice,
- @JsonProperty("retryUntilFilled") boolean retryUntilFilled) {
- this.createdAt = createdAt;
- this.future = future;
- this.id = id;
- this.market = market;
- this.orderPrice = orderPrice;
- this.reduceOnly = reduceOnly;
- this.side = side;
- this.size = size;
- this.status = status;
- this.trailStart = trailStart;
- this.trailValue = trailValue;
- this.triggerPrice = triggerPrice;
- this.triggeredAt = triggeredAt;
- this.type = type;
- this.orderType = orderType;
- this.filledSize = filledSize;
- this.avgFillPrice = avgFillPrice;
- this.retryUntilFilled = retryUntilFilled;
- }
-
- public Date getCreatedAt() {
- return createdAt;
- }
-
- public String getFuture() {
- return future;
- }
-
- public String getId() {
- return id;
- }
-
- public String getMarket() {
- return market;
- }
-
- public BigDecimal getOrderPrice() {
- return orderPrice;
- }
-
- public boolean isReduceOnly() {
- return reduceOnly;
- }
-
- public FtxOrderSide getSide() {
- return side;
- }
-
- public BigDecimal getSize() {
- return size;
- }
-
- public FtxOrderStatus getStatus() {
- return status;
- }
-
- public BigDecimal getTrailStart() {
- return trailStart;
- }
-
- public BigDecimal getTrailValue() {
- return trailValue;
- }
-
- public BigDecimal getTriggerPrice() {
- return triggerPrice;
- }
-
- public Date getTriggeredAt() {
- return triggeredAt;
- }
-
- public FtxConditionalOrderType getType() {
- return type;
- }
-
- public FtxOrderType getOrderType() {
- return orderType;
- }
-
- public BigDecimal getFilledSize() {
- return filledSize;
- }
-
- public BigDecimal getAvgFillPrice() {
- return avgFillPrice;
- }
-
- public boolean isRetryUntilFilled() {
- return retryUntilFilled;
- }
-
- @Override
- public String toString() {
- return "FtxOrderDto{"
- + "createdAt="
- + createdAt
- + "future="
- + future
- + "id="
- + id
- + "market="
- + market
- + "orderPrice="
- + orderPrice
- + "reduceOnly="
- + reduceOnly
- + "side="
- + side
- + "size="
- + size
- + "status="
- + status
- + "trailStart="
- + trailStart
- + "trailValue="
- + trailValue
- + "triggerPrice="
- + triggerPrice
- + "triggeredAt="
- + triggeredAt
- + "type="
- + type
- + "orderType="
- + orderType
- + "filledSize="
- + filledSize
- + "avgFillPrice="
- + avgFillPrice
- + "retryUntilFilled="
- + retryUntilFilled
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxConditionalOrderRequestPayload.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxConditionalOrderRequestPayload.java
deleted file mode 100644
index 77d0d68fd01..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxConditionalOrderRequestPayload.java
+++ /dev/null
@@ -1,134 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-import java.math.BigDecimal;
-
-public class FtxConditionalOrderRequestPayload {
-
- private String market;
- private FtxOrderSide side;
- private BigDecimal size;
- private FtxConditionalOrderType type;
- private boolean reduceOnly;
- private boolean retryUntilFilled;
- private BigDecimal orderPrice;
- private BigDecimal triggerPrice;
- private BigDecimal trailValue;
-
- public FtxConditionalOrderRequestPayload(
- String market,
- FtxOrderSide side,
- BigDecimal size,
- FtxConditionalOrderType type,
- boolean reduceOnly,
- boolean retryUntilFilled,
- BigDecimal orderPrice,
- BigDecimal triggerPrice,
- BigDecimal trailValue) {
- this.market = market;
- this.side = side;
- this.size = size;
- this.type = type;
- this.reduceOnly = reduceOnly;
- this.retryUntilFilled = retryUntilFilled;
- this.orderPrice = orderPrice;
- this.triggerPrice = triggerPrice;
- this.trailValue = trailValue;
- }
-
- public String getMarket() {
- return market;
- }
-
- public void setMarket(String market) {
- this.market = market;
- }
-
- public FtxOrderSide getSide() {
- return side;
- }
-
- public void setSide(FtxOrderSide side) {
- this.side = side;
- }
-
- public BigDecimal getSize() {
- return size;
- }
-
- public void setSize(BigDecimal size) {
- this.size = size;
- }
-
- public FtxConditionalOrderType getType() {
- return type;
- }
-
- public void setType(FtxConditionalOrderType type) {
- this.type = type;
- }
-
- public boolean isReduceOnly() {
- return reduceOnly;
- }
-
- public void setReduceOnly(boolean reduceOnly) {
- this.reduceOnly = reduceOnly;
- }
-
- public boolean isRetryUntilFilled() {
- return retryUntilFilled;
- }
-
- public void setRetryUntilFilled(boolean retryUntilFilled) {
- this.retryUntilFilled = retryUntilFilled;
- }
-
- public BigDecimal getOrderPrice() {
- return orderPrice;
- }
-
- public void setOrderPrice(BigDecimal orderPrice) {
- this.orderPrice = orderPrice;
- }
-
- public BigDecimal getTriggerPrice() {
- return triggerPrice;
- }
-
- public void setTriggerPrice(BigDecimal triggerPrice) {
- this.triggerPrice = triggerPrice;
- }
-
- public BigDecimal getTrailValue() {
- return trailValue;
- }
-
- public void setTrailValue(BigDecimal trailValue) {
- this.trailValue = trailValue;
- }
-
- @Override
- public String toString() {
- return "FtxConditionalOrderRequestPayload{"
- + "market='"
- + market
- + '\''
- + ", side="
- + side
- + ", size="
- + size
- + ", type="
- + type
- + ", reduceOnly="
- + reduceOnly
- + ", retryUntilFilled="
- + retryUntilFilled
- + ", orderPrice="
- + orderPrice
- + ", triggerPrice="
- + triggerPrice
- + ", trailValue="
- + trailValue
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxConditionalOrderType.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxConditionalOrderType.java
deleted file mode 100644
index 9c285c78075..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxConditionalOrderType.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-public enum FtxConditionalOrderType {
- stop,
- trailing_stop,
- take_profit
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxFillDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxFillDto.java
deleted file mode 100644
index bc13fa73673..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxFillDto.java
+++ /dev/null
@@ -1,134 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-import java.util.Date;
-
-public class FtxFillDto {
-
- private final Date time;
-
- private final String id;
-
- private final String market;
-
- private final BigDecimal price;
-
- private final FtxOrderSide side;
-
- private final BigDecimal size;
-
- private final String orderId;
-
- private final String tradeId;
-
- private final BigDecimal fee;
-
- private final String feeCurrency;
-
- private final BigDecimal feeRate;
-
- @JsonCreator
- public FtxFillDto(
- @JsonProperty("time") Date time,
- @JsonProperty("id") String id,
- @JsonProperty("market") String market,
- @JsonProperty("price") BigDecimal price,
- @JsonProperty("side") FtxOrderSide side,
- @JsonProperty("size") BigDecimal size,
- @JsonProperty("orderId") String orderId,
- @JsonProperty("tradeId") String tradeId,
- @JsonProperty("fee") BigDecimal fee,
- @JsonProperty("feeCurrency") String feeCurrency,
- @JsonProperty("feeRate") BigDecimal feeRate) {
- this.time = time;
- this.id = id;
- this.market = market;
- this.price = price;
- this.side = side;
- this.size = size;
- this.orderId = orderId;
- this.tradeId = tradeId;
- this.fee = fee;
- this.feeCurrency = feeCurrency;
- this.feeRate = feeRate;
- }
-
- public Date getTime() {
- return time;
- }
-
- public String getId() {
- return id;
- }
-
- public String getMarket() {
- return market;
- }
-
- public BigDecimal getPrice() {
- return price;
- }
-
- public FtxOrderSide getSide() {
- return side;
- }
-
- public BigDecimal getSize() {
- return size;
- }
-
- public String getOrderId() {
- return orderId;
- }
-
- public String getTradeId() {
- return tradeId;
- }
-
- public BigDecimal getFee() {
- return fee;
- }
-
- public String getFeeCurrency() {
- return feeCurrency;
- }
-
- public BigDecimal getFeeRate() {
- return feeRate;
- }
-
- @Override
- public String toString() {
- return "FtxFillDto{"
- + "time="
- + time
- + ", id='"
- + id
- + '\''
- + ", market='"
- + market
- + '\''
- + ", price="
- + price
- + ", side="
- + side
- + ", size="
- + size
- + ", orderId='"
- + orderId
- + '\''
- + ", tradeId='"
- + tradeId
- + '\''
- + ", fee="
- + fee
- + ", feeCurrency='"
- + feeCurrency
- + '\''
- + ", feeRate="
- + feeRate
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxModifyConditionalOrderRequestPayload.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxModifyConditionalOrderRequestPayload.java
deleted file mode 100644
index 85383afec1f..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxModifyConditionalOrderRequestPayload.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-
-public class FtxModifyConditionalOrderRequestPayload {
-
- private final BigDecimal orderPrice;
-
- private final BigDecimal triggerPrice;
-
- private final BigDecimal trailValue;
-
- private final BigDecimal size;
-
- public FtxModifyConditionalOrderRequestPayload(
- @JsonProperty("orderPrice") BigDecimal orderPrice,
- @JsonProperty("triggerPrice") BigDecimal triggerPrice,
- @JsonProperty("trailValue") BigDecimal trailValue,
- @JsonProperty("size") BigDecimal size) {
- this.orderPrice = orderPrice;
- this.triggerPrice = triggerPrice;
- this.trailValue = trailValue;
- this.size = size;
- }
-
- public BigDecimal getOrderPrice() {
- return orderPrice;
- }
-
- public BigDecimal getTriggerPrice() {
- return triggerPrice;
- }
-
- public BigDecimal getTrailValue() {
- return trailValue;
- }
-
- public BigDecimal getSize() {
- return size;
- }
-
- @Override
- public String toString() {
- return "FtxModifyOrderRequestPayload{"
- + "orderPrice="
- + orderPrice
- + "triggerPrice="
- + triggerPrice
- + ", trailValue="
- + trailValue
- + ", size="
- + size
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxModifyOrderRequestPayload.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxModifyOrderRequestPayload.java
deleted file mode 100644
index 735c1476262..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxModifyOrderRequestPayload.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-
-public class FtxModifyOrderRequestPayload {
-
- private final BigDecimal price;
-
- private final BigDecimal size;
-
- private final String clientId;
-
- public FtxModifyOrderRequestPayload(
- @JsonProperty("price") BigDecimal price,
- @JsonProperty("size") BigDecimal size,
- @JsonProperty("clientId") String clientId) {
- this.price = price;
- this.size = size;
- this.clientId = clientId;
- }
-
- public BigDecimal getPrice() {
- return price;
- }
-
- public BigDecimal getSize() {
- return size;
- }
-
- public String getClientId() {
- return clientId;
- }
-
- @Override
- public String toString() {
- return "FtxModifyOrderRequestPayload{"
- + "price="
- + price
- + ", size="
- + size
- + ", clientId='"
- + clientId
- + '\''
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderDto.java
deleted file mode 100644
index e6c70304fb8..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderDto.java
+++ /dev/null
@@ -1,194 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-import java.util.Date;
-
-public class FtxOrderDto {
-
- private final Date createdAt;
-
- private final BigDecimal filledSize;
-
- private final String future;
-
- private final String id;
-
- private final String market;
-
- private final BigDecimal price;
-
- private final BigDecimal avgFillPrice;
-
- private final BigDecimal remainingSize;
-
- private final FtxOrderSide side;
-
- private final BigDecimal size;
-
- private final FtxOrderStatus status;
-
- private final FtxOrderType type;
-
- private final boolean reduceOnly;
-
- private final boolean ioc;
-
- private final boolean postOnly;
-
- private final String clientId;
-
- @JsonIgnore private final boolean liquidation;
-
- @JsonCreator
- public FtxOrderDto(
- @JsonProperty("createdAt") Date createdAt,
- @JsonProperty("filledSize") BigDecimal filledSize,
- @JsonProperty("future") String future,
- @JsonProperty("id") String id,
- @JsonProperty("market") String market,
- @JsonProperty("price") BigDecimal price,
- @JsonProperty("remainingSize") BigDecimal remainingSize,
- @JsonProperty("avgFillPrice") BigDecimal avgFillPrice,
- @JsonProperty("side") FtxOrderSide side,
- @JsonProperty("size") BigDecimal size,
- @JsonProperty("status") FtxOrderStatus status,
- @JsonProperty("type") FtxOrderType type,
- @JsonProperty("reduceOnly") boolean reduceOnly,
- @JsonProperty("ioc") boolean ioc,
- @JsonProperty("postOnly") boolean postOnly,
- @JsonProperty("liquidation") boolean liquidation,
- @JsonProperty("clientId") String clientId) {
- this.createdAt = createdAt;
- this.filledSize = filledSize;
- this.future = future;
- this.id = id;
- this.market = market;
- this.price = price;
- this.remainingSize = remainingSize;
- this.avgFillPrice = avgFillPrice;
- this.side = side;
- this.size = size;
- this.status = status;
- this.type = type;
- this.reduceOnly = reduceOnly;
- this.ioc = ioc;
- this.postOnly = postOnly;
- this.liquidation = liquidation;
- this.clientId = clientId;
- }
-
- public Date getCreatedAt() {
- return createdAt;
- }
-
- public BigDecimal getFilledSize() {
- return filledSize;
- }
-
- public String getFuture() {
- return future;
- }
-
- public String getId() {
- return id;
- }
-
- public String getMarket() {
- return market;
- }
-
- public BigDecimal getPrice() {
- return price;
- }
-
- public BigDecimal getAvgFillPrice() {
- return avgFillPrice;
- }
-
- public BigDecimal getRemainingSize() {
- return remainingSize;
- }
-
- public FtxOrderSide getSide() {
- return side;
- }
-
- public BigDecimal getSize() {
- return size;
- }
-
- public FtxOrderStatus getStatus() {
- return status;
- }
-
- public FtxOrderType getType() {
- return type;
- }
-
- public boolean isReduceOnly() {
- return reduceOnly;
- }
-
- public boolean isIoc() {
- return ioc;
- }
-
- public boolean isPostOnly() {
- return postOnly;
- }
-
- public boolean isLiquidation() {
- return liquidation;
- }
-
- public String getClientId() {
- return clientId;
- }
-
- @Override
- public String toString() {
- return "FtxOrderDto{"
- + "createdAt="
- + createdAt
- + ", filledSize="
- + filledSize
- + ", future='"
- + future
- + '\''
- + ", id='"
- + id
- + '\''
- + ", market='"
- + market
- + '\''
- + ", price="
- + price
- + ", avgFillPrice="
- + avgFillPrice
- + ", remainingSize="
- + remainingSize
- + ", side="
- + side
- + ", size="
- + size
- + ", status="
- + status
- + ", type="
- + type
- + ", reduceOnly="
- + reduceOnly
- + ", ioc="
- + ioc
- + ", postOnly="
- + postOnly
- + ", clientId='"
- + clientId
- + '\''
- + ", liquidation="
- + liquidation
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderFlags.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderFlags.java
deleted file mode 100644
index 3ea81730443..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderFlags.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-import org.knowm.xchange.dto.Order;
-
-public enum FtxOrderFlags implements Order.IOrderFlags {
- POST_ONLY,
- REDUCE_ONLY,
- IOC,
- RETRY_UNTIL_FILLED
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderRequestPayload.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderRequestPayload.java
deleted file mode 100644
index dcb96242fee..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderRequestPayload.java
+++ /dev/null
@@ -1,143 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-import java.math.BigDecimal;
-
-public class FtxOrderRequestPayload {
-
- private String market;
-
- private FtxOrderSide side;
-
- private BigDecimal price;
-
- private FtxOrderType type;
-
- private BigDecimal size;
-
- private boolean reduceOnly;
-
- private boolean ioc;
-
- private boolean postOnly;
-
- private String clientId;
-
- public FtxOrderRequestPayload(
- String market,
- FtxOrderSide side,
- BigDecimal price,
- FtxOrderType type,
- BigDecimal size,
- boolean reduceOnly,
- boolean ioc,
- boolean postOnly,
- String clientId) {
- this.market = market;
- this.side = side;
- this.price = price;
- this.type = type;
- this.size = size;
- this.reduceOnly = reduceOnly;
- this.ioc = ioc;
- this.postOnly = postOnly;
- this.clientId = clientId;
- }
-
- public String getMarket() {
- return market;
- }
-
- public void setMarket(String market) {
- this.market = market;
- }
-
- public FtxOrderSide getSide() {
- return side;
- }
-
- public void setSide(FtxOrderSide side) {
- this.side = side;
- }
-
- public BigDecimal getPrice() {
- return price;
- }
-
- public void setPrice(BigDecimal price) {
- this.price = price;
- }
-
- public FtxOrderType getType() {
- return type;
- }
-
- public void setType(FtxOrderType type) {
- this.type = type;
- }
-
- public BigDecimal getSize() {
- return size;
- }
-
- public void setSize(BigDecimal size) {
- this.size = size;
- }
-
- public boolean isReduceOnly() {
- return reduceOnly;
- }
-
- public void setReduceOnly(boolean reduceOnly) {
- this.reduceOnly = reduceOnly;
- }
-
- public boolean isIoc() {
- return ioc;
- }
-
- public void setIoc(boolean ioc) {
- this.ioc = ioc;
- }
-
- public boolean isPostOnly() {
- return postOnly;
- }
-
- public void setPostOnly(boolean postOnly) {
- this.postOnly = postOnly;
- }
-
- public String getClientId() {
- return clientId;
- }
-
- public void setClientId(String clientId) {
- this.clientId = clientId;
- }
-
- @Override
- public String toString() {
- return "FtxOrderRequestPOJO{"
- + "market='"
- + market
- + '\''
- + ", side="
- + side
- + ", price="
- + price
- + ", type="
- + type
- + ", size="
- + size
- + ", reduceOnly="
- + reduceOnly
- + ", ioc="
- + ioc
- + ", postOnly="
- + postOnly
- + ", clientId='"
- + clientId
- + '\''
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderSide.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderSide.java
deleted file mode 100644
index fefaf92007a..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderSide.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-public enum FtxOrderSide {
- sell,
- buy;
-
- public FtxOrderSide getOpposite() {
- switch (this) {
- case sell:
- return buy;
- case buy:
- return sell;
- default:
- return null;
- }
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderStatus.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderStatus.java
deleted file mode 100644
index 159669fc5db..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderStatus.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-import com.fasterxml.jackson.annotation.JsonValue;
-
-public enum FtxOrderStatus {
- NEW("new"),
- OPEN("open"),
- CLOSED("closed"),
- CANCELLED("cancelled"),
- TRIGGERED("triggered");
-
- private final String status;
-
- FtxOrderStatus(String status) {
- this.status = status;
- }
-
- @JsonValue
- public String getStatus() {
- return status;
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderType.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderType.java
deleted file mode 100644
index 009b0dcbe2c..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxOrderType.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-public enum FtxOrderType {
- limit,
- market;
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxTriggerDto.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxTriggerDto.java
deleted file mode 100644
index ac4a1875040..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxTriggerDto.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-import java.util.Date;
-
-public class FtxTriggerDto {
-
- private final Date time;
- private final String error;
- private final BigDecimal filledSize;
- private final BigDecimal orderSize;
- private final String orderId;
-
- @JsonCreator
- public FtxTriggerDto(
- @JsonProperty("time") Date time,
- @JsonProperty("error") String error,
- @JsonProperty("filledSize") BigDecimal filledSize,
- @JsonProperty("orderSize") BigDecimal orderSize,
- @JsonProperty("orderId") String orderId) {
- this.time = time;
- this.error = error;
- this.filledSize = filledSize;
- this.orderSize = orderSize;
- this.orderId = orderId;
- }
-
- public Date getTime() {
- return time;
- }
-
- public String getError() {
- return error;
- }
-
- public BigDecimal getFilledSize() {
- return filledSize;
- }
-
- public BigDecimal getOrderSize() {
- return orderSize;
- }
-
- public String getOrderId() {
- return orderId;
- }
-
- @Override
- public String toString() {
- return "FtxOrderDto{"
- + "time="
- + time
- + ", error="
- + error
- + ", filledSize="
- + filledSize
- + ", orderSize="
- + orderSize
- + ", orderId="
- + orderId
- + '}';
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxTriggerOpenOrdersParams.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxTriggerOpenOrdersParams.java
deleted file mode 100644
index cd5bcfb96a4..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/dto/trade/FtxTriggerOpenOrdersParams.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-import org.knowm.xchange.currency.CurrencyPair;
-import org.knowm.xchange.service.trade.params.orders.OpenOrdersParamCurrencyPair;
-
-public class FtxTriggerOpenOrdersParams implements OpenOrdersParamCurrencyPair {
-
- private CurrencyPair currencyPair;
-
- public FtxTriggerOpenOrdersParams(CurrencyPair currencyPair) {
- this.currencyPair = currencyPair;
- }
-
- @Override
- public CurrencyPair getCurrencyPair() {
- return currencyPair;
- }
-
- @Override
- public void setCurrencyPair(CurrencyPair pair) {
- this.currencyPair = pair;
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxAccountService.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxAccountService.java
deleted file mode 100644
index a4430b6a333..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxAccountService.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.knowm.xchange.ftx.service;
-
-import java.io.IOException;
-import org.knowm.xchange.Exchange;
-import org.knowm.xchange.dto.account.AccountInfo;
-import org.knowm.xchange.ftx.FtxAdapters;
-import org.knowm.xchange.service.account.AccountService;
-
-public class FtxAccountService extends FtxAccountServiceRaw implements AccountService {
-
- public FtxAccountService(Exchange exchange) {
- super(exchange);
- }
-
- @Override
- public AccountInfo getAccountInfo() throws IOException {
- return getSubaccountInfo(exchange.getExchangeSpecification().getUserName());
- }
-
- public AccountInfo getSubaccountInfo(String subaccount) throws IOException {
- return FtxAdapters.adaptAccountInfo(
- getFtxAccountInformation(subaccount), getFtxWalletBalances(subaccount));
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxAccountServiceRaw.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxAccountServiceRaw.java
deleted file mode 100644
index d0deb37bc6c..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxAccountServiceRaw.java
+++ /dev/null
@@ -1,219 +0,0 @@
-package org.knowm.xchange.ftx.service;
-
-import java.io.IOException;
-import java.util.List;
-import org.knowm.xchange.Exchange;
-import org.knowm.xchange.ftx.FtxException;
-import org.knowm.xchange.ftx.dto.FtxResponse;
-import org.knowm.xchange.ftx.dto.account.FtxAccountDto;
-import org.knowm.xchange.ftx.dto.account.FtxChangeSubAccountNamePOJO;
-import org.knowm.xchange.ftx.dto.account.FtxConvertAcceptPayloadRequestDto;
-import org.knowm.xchange.ftx.dto.account.FtxConvertAcceptRequestDto;
-import org.knowm.xchange.ftx.dto.account.FtxConvertDto;
-import org.knowm.xchange.ftx.dto.account.FtxConvertSimulatePayloadRequestDto;
-import org.knowm.xchange.ftx.dto.account.FtxConvertSimulatetDto;
-import org.knowm.xchange.ftx.dto.account.FtxFundingPaymentsDto;
-import org.knowm.xchange.ftx.dto.account.FtxLeverageDto;
-import org.knowm.xchange.ftx.dto.account.FtxSubAccountBalanceDto;
-import org.knowm.xchange.ftx.dto.account.FtxSubAccountDto;
-import org.knowm.xchange.ftx.dto.account.FtxSubAccountRequestPOJO;
-import org.knowm.xchange.ftx.dto.account.FtxSubAccountTranferDto;
-import org.knowm.xchange.ftx.dto.account.FtxSubAccountTransferPOJO;
-import org.knowm.xchange.ftx.dto.account.FtxWalletBalanceDto;
-
-public class FtxAccountServiceRaw extends FtxBaseService {
-
- public FtxAccountServiceRaw(Exchange exchange) {
- super(exchange);
- }
-
- public FtxResponse getFtxAccountInformation(String subaccount)
- throws FtxException, IOException {
-
- try {
- return ftx.getAccountInformation(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse> getFtxWalletBalances(String subaccount)
- throws FtxException, IOException {
-
- try {
- return ftx.getWalletBalances(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse getFtxSubAccountBalances(String nickname)
- throws FtxException, IOException {
- try {
- return ftx.getSubAccountBalances(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- null,
- nickname);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse changeFtxSubAccountName(
- String nickname, String newNickname) throws FtxException, IOException {
- try {
- return ftx.changeSubAccountName(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- new FtxChangeSubAccountNamePOJO(nickname, newNickname));
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse> getFtxAllSubAccounts()
- throws FtxException, IOException {
- try {
- return ftx.getAllSubAccounts(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse deleteFtxAllSubAccounts(String nickname) throws FtxException, IOException {
- try {
- return ftx.deleteSubAccounts(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- new FtxSubAccountRequestPOJO(nickname));
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse createFtxSubAccount(String nickname)
- throws FtxException, IOException {
- try {
- return ftx.createSubAccount(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- null,
- new FtxSubAccountRequestPOJO(nickname));
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse transferBetweenFtxSubAccount(
- FtxSubAccountTransferPOJO payload) throws FtxException, IOException {
- try {
- return ftx.transferBetweenSubAccounts(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- null,
- payload);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse changeLeverage(int leverage) throws FtxException, IOException {
- return changeLeverage(null, leverage);
- }
-
- public FtxResponse changeLeverage(String subaccount, int leverage)
- throws FtxException, IOException {
- try {
- return ftx.changeLeverage(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- new FtxLeverageDto(leverage));
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse> getFtxFundingPayments(
- String subaccount, Long startTime, Long endTime, String future)
- throws FtxException, IOException {
- try {
- return ftx.getFundingPayments(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- startTime,
- endTime,
- future);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse simulateFtxConvert(
- String subaccount, String fromCoin, String toCoin, double size)
- throws FtxException, IOException {
-
- try {
- return ftx.simulateConvert(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- new FtxConvertSimulatePayloadRequestDto(fromCoin, toCoin, size));
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse getFtxConvertStatus(String subaccount, Integer quoteId)
- throws FtxException, IOException {
-
- try {
- return ftx.getConvertStatus(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- quoteId.toString());
- } catch (FtxException e) {
- e.printStackTrace();
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse acceptFtxConvert(
- String subaccount, Integer quoteId) throws FtxException, IOException {
-
- try {
- return ftx.acceptConvert(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- quoteId.toString(),
- new FtxConvertAcceptPayloadRequestDto(quoteId));
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxBaseService.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxBaseService.java
deleted file mode 100644
index f3fa2438fbd..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxBaseService.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.knowm.xchange.ftx.service;
-
-import org.knowm.xchange.Exchange;
-import org.knowm.xchange.client.ExchangeRestProxyBuilder;
-import org.knowm.xchange.ftx.FtxAuthenticated;
-import org.knowm.xchange.service.BaseExchangeService;
-import org.knowm.xchange.service.BaseService;
-import si.mazi.rescu.ParamsDigest;
-
-public class FtxBaseService extends BaseExchangeService implements BaseService {
-
- protected final FtxAuthenticated ftx;
- protected final ParamsDigest signatureCreator;
-
- public FtxBaseService(Exchange exchange) {
- super(exchange);
-
- ftx =
- ExchangeRestProxyBuilder.forInterface(
- FtxAuthenticated.class, exchange.getExchangeSpecification())
- .build();
- signatureCreator = FtxDigest.createInstance(exchange.getExchangeSpecification().getSecretKey());
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxBorrowingServiceRaw.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxBorrowingServiceRaw.java
deleted file mode 100644
index d34bbabf399..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxBorrowingServiceRaw.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package org.knowm.xchange.ftx.service;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
-import org.apache.commons.lang3.StringUtils;
-import org.knowm.xchange.ftx.FtxExchange;
-import org.knowm.xchange.ftx.dto.account.FtxBorrowingHistoryDto;
-import org.knowm.xchange.ftx.dto.account.FtxBorrowingInfoDto;
-import org.knowm.xchange.ftx.dto.account.FtxBorrowingRatesDto;
-
-public class FtxBorrowingServiceRaw extends FtxBaseService {
-
- public FtxBorrowingServiceRaw(FtxExchange exchange) {
- super(exchange);
- }
-
- public List histories(String subaccount) {
- try {
- return ftx.getBorrowHistory(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- null,
- null)
- .getResult();
- } catch (IOException e) {
- throw new FtxLendingServiceRaw.FtxLendingServiceException(
- "Can't get lending infos subAccount: " + subaccount, e);
- }
- }
-
- public List historiesByDates(
- String subAccount, Long startTime, Long endTime) {
- try {
- return ftx.getBorrowHistory(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subAccount,
- startTime,
- endTime)
- .getResult();
- } catch (IOException e) {
- throw new FtxLendingServiceRaw.FtxLendingServiceException(
- "Can't get lending infos subAccount: " + subAccount, e);
- }
- }
-
- public List histories(String subaccount, List coins) {
- Objects.requireNonNull(coins);
- return histories(subaccount).stream()
- .filter(lendingHistory -> coins.contains(lendingHistory.getCoin()))
- .collect(Collectors.toList());
- }
-
- public FtxBorrowingHistoryDto history(String subaccount, String coin) {
- Objects.requireNonNull(coin);
- if (StringUtils.isNotBlank(coin))
- throw new FtxBorrowingServiceException("Coin are blank or empty");
- return histories(subaccount).stream()
- .filter(lendingHistory -> lendingHistory.getCoin().equalsIgnoreCase(coin))
- .findFirst()
- .orElse(null);
- }
-
- public List infos(String subaccount) {
- try {
- return ftx.getBorrowingInfos(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount)
- .getResult();
- } catch (IOException e) {
- throw new FtxLendingServiceRaw.FtxLendingServiceException("Can't get lending infos", e);
- }
- }
-
- public List infos(String subaccount, List coins) {
- Objects.requireNonNull(coins);
- return infos(subaccount).stream()
- .filter(lendingInfo -> coins.contains(lendingInfo.getCoin()))
- .collect(Collectors.toList());
- }
-
- public FtxBorrowingInfoDto info(String subaccount, String coin) {
- Objects.requireNonNull(coin);
- if (StringUtils.isNotBlank(coin))
- throw new FtxBorrowingServiceException("Coin are blank or empty");
- return infos(subaccount).stream()
- .filter(lendingInfo -> lendingInfo.getCoin().equalsIgnoreCase(coin))
- .findFirst()
- .orElse(null);
- }
-
- public List rates() {
- try {
- return ftx.getBorrowRates(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator)
- .getResult();
- } catch (IOException e) {
- throw new FtxLendingServiceRaw.FtxLendingServiceException("Can't get lending rates", e);
- }
- }
-
- public List rates(List coins) {
- Objects.requireNonNull(coins);
- return rates().stream()
- .filter(lendingRates -> coins.contains(lendingRates.getCoin()))
- .collect(Collectors.toList());
- }
-
- public FtxBorrowingRatesDto rate(String coin) {
- Objects.requireNonNull(coin);
- if (StringUtils.isNotBlank(coin))
- throw new FtxBorrowingServiceException("Coin are blank or empty");
- try {
- return ftx
- .getBorrowRates(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator)
- .getResult()
- .stream()
- .filter(lendingRates -> lendingRates.getCoin().equalsIgnoreCase(coin))
- .findFirst()
- .orElse(null);
- } catch (IOException e) {
- throw new FtxLendingServiceRaw.FtxLendingServiceException(
- "Can't get lending rate coin: " + coin, e);
- }
- }
-
- public static class FtxBorrowingServiceException extends RuntimeException {
- public FtxBorrowingServiceException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public FtxBorrowingServiceException(String message) {
- super(message);
- }
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxDigest.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxDigest.java
deleted file mode 100644
index 6f41ee2deeb..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxDigest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.knowm.xchange.ftx.service;
-
-import jakarta.ws.rs.HeaderParam;
-import java.nio.charset.StandardCharsets;
-import javax.crypto.Mac;
-import org.knowm.xchange.exceptions.ExchangeException;
-import org.knowm.xchange.service.BaseParamsDigest;
-import org.knowm.xchange.utils.DigestUtils;
-import si.mazi.rescu.RestInvocation;
-
-public class FtxDigest extends BaseParamsDigest {
-
- private FtxDigest(byte[] secretKey) {
-
- super(secretKey, HMAC_SHA_256);
- }
-
- public static FtxDigest createInstance(String secretKey) {
-
- if (secretKey != null) {
- return new FtxDigest(secretKey.getBytes());
- } else return null;
- }
-
- @Override
- public String digestParams(RestInvocation restInvocation) {
-
- String message =
- restInvocation.getParamValue(HeaderParam.class, "FTX-TS").toString()
- + restInvocation.getHttpMethod().toUpperCase()
- + restInvocation.getPath();
-
- if (!restInvocation.getQueryString().isEmpty()) {
- message += "?" + restInvocation.getQueryString();
- }
-
- if (restInvocation.getHttpMethod().equals("POST")
- || (restInvocation.getPath().contains("/orders")
- && restInvocation.getHttpMethod().equals("DELETE"))
- && restInvocation.getRequestBody() != null) {
- message += restInvocation.getRequestBody();
- }
-
- Mac mac256 = getMac();
-
- try {
- mac256.update(message.getBytes(StandardCharsets.UTF_8));
- } catch (Exception e) {
- throw new ExchangeException("Digest encoding exception", e);
- }
-
- return DigestUtils.bytesToHex(mac256.doFinal()).toLowerCase();
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxLendingServiceRaw.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxLendingServiceRaw.java
deleted file mode 100644
index 9852b73689c..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxLendingServiceRaw.java
+++ /dev/null
@@ -1,194 +0,0 @@
-package org.knowm.xchange.ftx.service;
-
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
-import org.apache.commons.lang3.StringUtils;
-import org.knowm.xchange.ftx.FtxAdapters;
-import org.knowm.xchange.ftx.FtxExchange;
-import org.knowm.xchange.ftx.dto.account.FtxLendDataDto;
-import org.knowm.xchange.ftx.dto.account.FtxLendingHistoryDto;
-import org.knowm.xchange.ftx.dto.account.FtxLendingInfoDto;
-import org.knowm.xchange.ftx.dto.account.FtxLendingRatesDto;
-import org.knowm.xchange.ftx.dto.account.FtxSubmitLendingOfferParams;
-
-public class FtxLendingServiceRaw extends FtxBaseService {
-
- public FtxLendingServiceRaw(FtxExchange exchange) {
- super(exchange);
- }
-
- public FtxLendDataDto stopLending(String subaccount, String coin) {
- return lend(subaccount, coin, 0, 0);
- }
-
- public List stopLending(String subaccount, List coins) {
- return coins.stream().map(coin -> stopLending(subaccount, coin)).collect(Collectors.toList());
- }
-
- public FtxLendDataDto lend(String subaccount, String coin, double size, double rate) {
- Objects.requireNonNull(coin);
- if (StringUtils.isNotBlank(coin))
- throw new FtxLendingServiceException("Coin are blank or empty");
- if (rate < 0)
- throw new FtxLendingServiceException(
- "Rate must to be >= 0, subaccount: " + subaccount + ", coin: " + coin);
- if (size < 0)
- throw new FtxLendingServiceException(
- "Size must to be >= 0, subaccount: "
- + subaccount
- + ", coin: "
- + coin
- + ", rate: "
- + rate);
-
- try {
- FtxLendingInfoDto info = info(subaccount, coin);
- double sizeToLend = FtxAdapters.lendingRounding(BigDecimal.valueOf(size)).doubleValue();
-
- if (Double.compare(sizeToLend, info.getLendable()) == 1) {
- throw new FtxLendingServiceException(
- "Can't lend sizeToLend > to lendable, subaccount: "
- + subaccount
- + ", coin: "
- + coin
- + ", size: "
- + size
- + ", sizeToLend: "
- + sizeToLend
- + ", rate: "
- + rate);
- }
- ftx.submitLendingOffer(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- new FtxSubmitLendingOfferParams(
- coin, FtxAdapters.lendingRounding(new BigDecimal(sizeToLend)).doubleValue(), rate));
- return new FtxLendDataDto(coin, info.getLocked(), info.getOffered(), sizeToLend, rate);
- } catch (IOException e) {
- throw new FtxLendingServiceException(
- "Can't lend subaccount: "
- + subaccount
- + ", coin: "
- + coin
- + ", size: "
- + size
- + ", rate: "
- + rate,
- e);
- }
- }
-
- public List histories(String subaccount) {
- try {
- return ftx.getlendingHistories(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount)
- .getResult();
- } catch (IOException e) {
- throw new FtxLendingServiceException("Can't get lending infos subAccount: " + subaccount, e);
- }
- }
-
- public List histories(String subaccount, List coins) {
- Objects.requireNonNull(coins);
- return histories(subaccount).stream()
- .filter(lendingHistory -> coins.contains(lendingHistory.getCoin()))
- .collect(Collectors.toList());
- }
-
- public FtxLendingHistoryDto history(String subaccount, String coin) {
- Objects.requireNonNull(coin);
- if (StringUtils.isNotBlank(coin))
- throw new FtxLendingServiceException("Coin are blank or empty");
- return histories(subaccount).stream()
- .filter(lendingHistory -> lendingHistory.getCoin().equalsIgnoreCase(coin))
- .findFirst()
- .orElse(null);
- }
-
- public List infos(String subaccount) {
- try {
- return ftx.getLendingInfos(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount)
- .getResult();
- } catch (IOException e) {
- throw new FtxLendingServiceException("Can't get lending infos subAccount: " + subaccount, e);
- }
- }
-
- public List infos(String subaccount, List coins) {
- Objects.requireNonNull(coins);
- return infos(subaccount).stream()
- .filter(lendingInfo -> coins.contains(lendingInfo.getCoin()))
- .collect(Collectors.toList());
- }
-
- public FtxLendingInfoDto info(String subaccount, String coin) {
- Objects.requireNonNull(coin);
- if (StringUtils.isNotBlank(coin))
- throw new FtxLendingServiceException("Coin are blank or empty");
- return infos(subaccount).stream()
- .filter(lendingInfo -> lendingInfo.getCoin().equalsIgnoreCase(coin))
- .findFirst()
- .orElse(null);
- }
-
- public List rates() {
- try {
- return ftx.getLendingRates(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator)
- .getResult();
- } catch (IOException e) {
- throw new FtxLendingServiceException("Can't get lending rates", e);
- }
- }
-
- public List rates(List coins) {
- Objects.requireNonNull(coins);
- return rates().stream()
- .filter(lendingRates -> coins.contains(lendingRates.getCoin()))
- .collect(Collectors.toList());
- }
-
- public FtxLendingRatesDto rate(String coin) {
- Objects.requireNonNull(coin);
- if (StringUtils.isNotBlank(coin))
- throw new FtxLendingServiceException("Coin are blank or empty");
- try {
- return ftx
- .getLendingRates(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator)
- .getResult()
- .stream()
- .filter(lendingRates -> lendingRates.getCoin().equalsIgnoreCase(coin))
- .findFirst()
- .orElse(null);
- } catch (IOException e) {
- throw new FtxLendingServiceException("Can't get lending rate coin: " + coin, e);
- }
- }
-
- public static class FtxLendingServiceException extends RuntimeException {
- public FtxLendingServiceException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public FtxLendingServiceException(String message) {
- super(message);
- }
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxMarketDataService.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxMarketDataService.java
deleted file mode 100644
index 46784d8c75e..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxMarketDataService.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.knowm.xchange.ftx.service;
-
-import java.io.IOException;
-import org.knowm.xchange.Exchange;
-import org.knowm.xchange.currency.CurrencyPair;
-import org.knowm.xchange.dto.marketdata.OrderBook;
-import org.knowm.xchange.dto.marketdata.Ticker;
-import org.knowm.xchange.dto.marketdata.Trades;
-import org.knowm.xchange.ftx.FtxAdapters;
-import org.knowm.xchange.service.marketdata.MarketDataService;
-
-public class FtxMarketDataService extends FtxMarketDataServiceRaw implements MarketDataService {
-
- public FtxMarketDataService(Exchange exchange) {
- super(exchange);
- }
-
- @Override
- public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args) throws IOException {
- return FtxAdapters.adaptOrderBook(
- getFtxOrderbook(FtxAdapters.adaptCurrencyPairToFtxMarket(currencyPair)), currencyPair);
- }
-
- @Override
- public Trades getTrades(CurrencyPair currencyPair, Object... args) throws IOException {
- return FtxAdapters.adaptTrades(
- getFtxTrades(FtxAdapters.adaptCurrencyPairToFtxMarket(currencyPair)).getResult(),
- currencyPair);
- }
-
- @Override
- public Ticker getTicker(CurrencyPair currencyPair, Object... args) throws IOException {
-
- return FtxAdapters.adaptTicker(
- getFtxMarket(FtxAdapters.adaptCurrencyPairToFtxMarket(currencyPair)),
- getFtxCandles(
- FtxAdapters.adaptCurrencyPairToFtxMarket(currencyPair),
- "60",
- null,
- null,
- null), // 60 seconds
- currencyPair);
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxMarketDataServiceRaw.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxMarketDataServiceRaw.java
deleted file mode 100644
index 5b3e2f36582..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxMarketDataServiceRaw.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.knowm.xchange.ftx.service;
-
-import java.io.IOException;
-import java.util.List;
-import org.knowm.xchange.Exchange;
-import org.knowm.xchange.ftx.FtxException;
-import org.knowm.xchange.ftx.dto.FtxResponse;
-import org.knowm.xchange.ftx.dto.marketdata.FtxCandleDto;
-import org.knowm.xchange.ftx.dto.marketdata.FtxMarketDto;
-import org.knowm.xchange.ftx.dto.marketdata.FtxMarketsDto;
-import org.knowm.xchange.ftx.dto.marketdata.FtxOrderbookDto;
-import org.knowm.xchange.ftx.dto.marketdata.FtxTradeDto;
-
-public class FtxMarketDataServiceRaw extends FtxBaseService {
-
- public FtxMarketDataServiceRaw(Exchange exchange) {
- super(exchange);
- }
-
- public FtxResponse getFtxMarket(String market) throws FtxException, IOException {
- try {
- return ftx.getMarket(market);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse> getFtxCandles(
- String market, String resolution, String starTime, String endTime, Integer limit)
- throws FtxException, IOException {
- try {
- return ftx.getCandles(market, resolution, starTime, endTime, limit);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse getFtxMarkets() throws FtxException, IOException {
- try {
- return ftx.getMarkets();
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse> getFtxTrades(String market)
- throws FtxException, IOException {
- try {
- return ftx.getTrades(market, 30);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse getFtxOrderbook(String market)
- throws FtxException, IOException {
- try {
- return ftx.getOrderbook(market, 20);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxTradeService.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxTradeService.java
deleted file mode 100644
index ebe6d0bbd2c..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxTradeService.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package org.knowm.xchange.ftx.service;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
-import org.knowm.xchange.Exchange;
-import org.knowm.xchange.dto.Order;
-import org.knowm.xchange.dto.account.OpenPositions;
-import org.knowm.xchange.dto.trade.LimitOrder;
-import org.knowm.xchange.dto.trade.MarketOrder;
-import org.knowm.xchange.dto.trade.OpenOrders;
-import org.knowm.xchange.dto.trade.StopOrder;
-import org.knowm.xchange.dto.trade.UserTrades;
-import org.knowm.xchange.ftx.FtxAdapters;
-import org.knowm.xchange.ftx.dto.trade.CancelAllFtxOrdersParams;
-import org.knowm.xchange.service.trade.TradeService;
-import org.knowm.xchange.service.trade.params.*;
-import org.knowm.xchange.service.trade.params.orders.OpenOrdersParams;
-import org.knowm.xchange.service.trade.params.orders.OrderQueryParams;
-
-public 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 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 getOrder(String... orderIds) throws IOException {
- return getOrderFromSubaccount(exchange.getExchangeSpecification().getUserName(), orderIds);
- }
-
- @Override
- public Collection 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 {
- 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();
- }
- }
-}
diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxTradeServiceRaw.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxTradeServiceRaw.java
deleted file mode 100644
index 74057fc6aab..00000000000
--- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/service/FtxTradeServiceRaw.java
+++ /dev/null
@@ -1,443 +0,0 @@
-package org.knowm.xchange.ftx.service;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import org.knowm.xchange.Exchange;
-import org.knowm.xchange.currency.CurrencyPair;
-import org.knowm.xchange.dto.Order;
-import org.knowm.xchange.dto.account.OpenPositions;
-import org.knowm.xchange.dto.trade.*;
-import org.knowm.xchange.ftx.FtxAdapters;
-import org.knowm.xchange.ftx.FtxException;
-import org.knowm.xchange.ftx.dto.FtxResponse;
-import org.knowm.xchange.ftx.dto.account.FtxPositionDto;
-import org.knowm.xchange.ftx.dto.trade.*;
-import org.knowm.xchange.service.trade.params.*;
-import org.knowm.xchange.service.trade.params.orders.OpenOrdersParamCurrencyPair;
-import org.knowm.xchange.service.trade.params.orders.OpenOrdersParams;
-
-public class FtxTradeServiceRaw extends FtxBaseService {
-
- public FtxTradeServiceRaw(Exchange exchange) {
- super(exchange);
- }
-
- public String placeMarketOrderForSubaccount(String subaccount, MarketOrder marketOrder)
- throws IOException {
- return placeNewFtxOrder(subaccount, FtxAdapters.adaptMarketOrderToFtxOrderPayload(marketOrder))
- .getResult()
- .getId();
- }
-
- public String placeLimitOrderForSubaccount(String subaccount, LimitOrder limitOrder)
- throws IOException {
- return placeNewFtxOrder(subaccount, FtxAdapters.adaptLimitOrderToFtxOrderPayload(limitOrder))
- .getResult()
- .getId();
- }
-
- public FtxResponse placeNewFtxOrder(
- String subaccount, FtxOrderRequestPayload payload) throws FtxException, IOException {
- try {
- return ftx.placeOrder(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- payload);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse modifyFtxOrder(
- String subaccount, String orderId, FtxModifyOrderRequestPayload payload)
- throws FtxException, IOException {
-
- return ftx.modifyOrder(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- orderId,
- payload);
- }
-
- public FtxResponse modifyFtxOrderByClientId(
- String subaccount, String clientId, FtxModifyOrderRequestPayload payload)
- throws FtxException, IOException {
-
- return ftx.modifyOrderByClientId(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- clientId,
- payload);
- }
-
- public boolean cancelOrderForSubaccount(String subaccount, String orderId) throws IOException {
- return cancelFtxOrder(subaccount, orderId);
- }
-
- public boolean cancelFtxOrder(String subaccount, String orderId)
- throws FtxException, IOException {
- try {
- return ftx.cancelOrder(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- orderId)
- .isSuccess();
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public boolean cancelFtxByClientId(String subaccount, String clientId)
- throws FtxException, IOException {
- try {
- return ftx.cancelOrderByClientId(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- clientId)
- .isSuccess();
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public boolean cancelOrderForSubaccount(String subaccount, CancelOrderParams orderParams)
- throws IOException {
- if (orderParams instanceof CancelOrderByCurrencyPair) {
- return cancelAllFtxOrders(
- subaccount,
- new CancelAllFtxOrdersParams(
- FtxAdapters.adaptCurrencyPairToFtxMarket(
- ((CancelOrderByCurrencyPair) orderParams).getCurrencyPair())));
- } else if (orderParams instanceof CancelOrderByUserReferenceParams) {
- return cancelFtxByClientId(
- subaccount, ((CancelOrderByUserReferenceParams) orderParams).getUserReference());
- } else if (orderParams instanceof CancelConditionalOrderFtxParams) {
- return cancelFtxConditionalOrderForSubAccount(
- subaccount, ((CancelConditionalOrderFtxParams) orderParams).getOrderId());
- } else {
- throw new IOException(
- "CancelOrderParams must implement CancelOrderByCurrencyPair interface.");
- }
- }
-
- public boolean cancelAllFtxOrders(String subaccount, CancelAllFtxOrdersParams payLoad)
- throws FtxException, IOException {
- try {
- return ftx.cancelAllOrders(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- payLoad)
- .isSuccess();
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public Collection getOrderFromSubaccount(String subaccount, String... orderIds)
- throws IOException {
- List orderList = new ArrayList<>();
- for (String orderId : orderIds) {
- Order order = FtxAdapters.adaptLimitOrder(getFtxOrderStatus(subaccount, orderId).getResult());
- orderList.add(order);
- }
- return orderList;
- }
-
- public FtxResponse> getFtxOpenOrders(String subaccount, String market)
- throws FtxException, IOException {
- try {
- return ftx.openOrders(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- market);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public OpenOrders getOrderHistoryForSubaccount(String subaccount, TradeHistoryParams params)
- throws IOException {
- if (params instanceof TradeHistoryParamCurrencyPair) {
- return FtxAdapters.adaptOpenOrders(
- getFtxOrderHistory(
- subaccount,
- FtxAdapters.adaptCurrencyPairToFtxMarket(
- ((TradeHistoryParamCurrencyPair) params).getCurrencyPair()),
- ((TradeHistoryParamsAll) params).getStartTime().getTime(),
- ((TradeHistoryParamsAll) params).getEndTime().getTime()));
- } else if (params instanceof TradeHistoryParamInstrument) {
- CurrencyPair currencyPair =
- new CurrencyPair(((TradeHistoryParamInstrument) params).getInstrument().toString());
- return FtxAdapters.adaptOpenOrders(
- getFtxOrderHistory(
- subaccount, FtxAdapters.adaptCurrencyPairToFtxMarket(currencyPair), null, null));
- } else {
- throw new IOException(
- "TradeHistoryParams must implement TradeHistoryParamCurrencyPair or TradeHistoryParamInstrument interface.");
- }
- }
-
- public UserTrades getTradeHistoryForSubaccount(String subaccount, TradeHistoryParams params)
- throws IOException {
- if (params instanceof TradeHistoryParamsAll) {
- CurrencyPair currencyPair =
- new CurrencyPair(((TradeHistoryParamsAll) params).getInstrument().toString());
- return FtxAdapters.adaptUserTrades(
- getFtxFills(
- subaccount,
- FtxAdapters.adaptCurrencyPairToFtxMarket(currencyPair),
- ((TradeHistoryParamsAll) params).getStartTime().getTime(),
- ((TradeHistoryParamsAll) params).getEndTime().getTime())
- .getResult());
- } else if (params instanceof TradeHistoryParamCurrencyPair) {
- return FtxAdapters.adaptUserTrades(
- getFtxFills(
- subaccount,
- FtxAdapters.adaptCurrencyPairToFtxMarket(
- ((TradeHistoryParamCurrencyPair) params).getCurrencyPair()),
- null,
- null)
- .getResult());
- } else if (params instanceof TradeHistoryParamInstrument) {
- CurrencyPair currencyPair =
- new CurrencyPair(((TradeHistoryParamInstrument) params).getInstrument().toString());
- return FtxAdapters.adaptUserTrades(
- getFtxFills(
- subaccount, FtxAdapters.adaptCurrencyPairToFtxMarket(currencyPair), null, null)
- .getResult());
- } else {
- throw new IOException(
- "TradeHistoryParams must implement TradeHistoryParamCurrencyPair or TradeHistoryParamInstrument interface.");
- }
- }
-
- public FtxResponse> getFtxOrderHistory(
- String subaccount, String market, Long startTime, Long endTime)
- throws FtxException, IOException {
- try {
- return ftx.orderHistory(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- market,
- startTime,
- endTime);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse> getFtxFills(
- String subaccount, String market, Long startTime, Long endTime)
- throws FtxException, IOException {
- try {
- return ftx.fills(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- market,
- startTime,
- endTime);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public OpenOrders getOpenOrdersForSubaccount(String subaccount) throws IOException {
- return FtxAdapters.adaptOpenOrders(getFtxAllOpenOrdersForSubaccount(subaccount));
- }
-
- public OpenOrders getOpenOrdersForSubaccount(String subaccount, OpenOrdersParams params)
- throws IOException {
- if (params instanceof FtxTriggerOpenOrdersParams) {
- return FtxAdapters.adaptTriggerOpenOrders(
- getFtxOpenConditionalOrdersForSubAccount(
- subaccount,
- FtxAdapters.adaptCurrencyPairToFtxMarket(
- ((OpenOrdersParamCurrencyPair) params).getCurrencyPair())));
- } else if (params instanceof CurrencyPairParam) {
- return FtxAdapters.adaptOpenOrders(
- getFtxOpenOrders(
- subaccount,
- FtxAdapters.adaptCurrencyPairToFtxMarket(
- ((CurrencyPairParam) params).getCurrencyPair())));
- } else {
- throw new IOException("OpenOrdersParams must implement CurrencyPairParam interface.");
- }
- }
-
- public FtxResponse> getFtxAllOpenOrdersForSubaccount(String subaccount)
- throws FtxException, IOException {
- try {
- return ftx.openOrdersWithoutMarket(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse getFtxOrderStatus(String subaccount, String orderId)
- throws FtxException, IOException {
- try {
- return ftx.getOrderStatus(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- orderId);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public OpenPositions getOpenPositionsForSubaccount(String subaccount) throws IOException {
- return FtxAdapters.adaptOpenPositions(getFtxPositions(subaccount).getResult());
- }
-
- public FtxResponse> getFtxPositions(String subaccount)
- throws FtxException, IOException {
- try {
- return ftx.getFtxPositions(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- true);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public String placeStopOrderForSubAccount(String subaccount, StopOrder stopOrder)
- throws IOException {
- return placeNewFtxConditionalOrderForSubAccount(
- subaccount, FtxAdapters.adaptStopOrderToFtxOrderPayload(stopOrder))
- .getResult()
- .getId();
- }
-
- public boolean cancelStopOrder(String orderId) throws IOException {
- return cancelFtxConditionalOrderForSubAccount(
- exchange.getExchangeSpecification().getUserName(), orderId);
- }
-
- public String changeStopOrder(StopOrder stopOrder) throws IOException {
- return modifyFtxConditionalOrderForSubAccount(
- exchange.getExchangeSpecification().getUserName(),
- stopOrder.getId(),
- FtxAdapters.adaptModifyConditionalOrderToFtxOrderPayload(stopOrder))
- .getResult()
- .getId();
- }
-
- public FtxResponse placeNewFtxConditionalOrderForSubAccount(
- String subaccount, FtxConditionalOrderRequestPayload payload)
- throws FtxException, IOException {
- try {
- return ftx.placeConditionalOrder(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- payload);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse modifyFtxConditionalOrderForSubAccount(
- String subaccount, String orderId, FtxModifyConditionalOrderRequestPayload payload)
- throws FtxException, IOException {
-
- return ftx.modifyConditionalOrder(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- orderId,
- payload);
- }
-
- public boolean cancelFtxConditionalOrderForSubAccount(String subaccount, String orderId)
- throws FtxException, IOException {
- try {
- return ftx.cancelConditionalOrder(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- orderId)
- .isSuccess();
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse> getFtxOpenConditionalOrdersForSubAccount(
- String subaccount, String market) throws FtxException, IOException {
- try {
- return ftx.openConditionalOrders(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- market);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse> getFtxConditionalOrderHistory(
- String subaccount, String market) throws FtxException, IOException {
- try {
- return ftx.conditionalOrderHistory(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- market);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public FtxResponse> getFtxTriggersForSubAccount(
- String subaccount, String orderId) throws FtxException, IOException {
- try {
- return ftx.getTriggers(
- exchange.getExchangeSpecification().getApiKey(),
- exchange.getNonceFactory().createValue(),
- signatureCreator,
- subaccount,
- orderId);
- } catch (FtxException e) {
- throw new FtxException(e.getMessage());
- }
- }
-
- public List getFtxTriggers(String orderId) throws FtxException, IOException {
- return getFtxTriggersForSubAccount(exchange.getExchangeSpecification().getUserName(), orderId)
- .getResult();
- }
-}
diff --git a/xchange-ftx/src/main/resources/api-specification.txt b/xchange-ftx/src/main/resources/api-specification.txt
deleted file mode 100644
index 16e02c77758..00000000000
--- a/xchange-ftx/src/main/resources/api-specification.txt
+++ /dev/null
@@ -1 +0,0 @@
-https://docs.ftx.com/
\ No newline at end of file
diff --git a/xchange-ftx/src/main/resources/ftx.json b/xchange-ftx/src/main/resources/ftx.json
deleted file mode 100644
index 0e0dcd235c4..00000000000
--- a/xchange-ftx/src/main/resources/ftx.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-
-}
\ No newline at end of file
diff --git a/xchange-ftx/src/test/java/org/knowm/xchange/ftx/ExchangeInitIntegration.java b/xchange-ftx/src/test/java/org/knowm/xchange/ftx/ExchangeInitIntegration.java
deleted file mode 100644
index 1d20867e2b9..00000000000
--- a/xchange-ftx/src/test/java/org/knowm/xchange/ftx/ExchangeInitIntegration.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.knowm.xchange.ftx;
-
-import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
-
-import org.junit.Test;
-import org.knowm.xchange.Exchange;
-import org.knowm.xchange.ExchangeFactory;
-
-public class ExchangeInitIntegration {
-
- @Test
- public void ftxInitializationTest() {
- Exchange ftx = ExchangeFactory.INSTANCE.createExchange(FtxExchange.class);
-
- assertThat(ftx.getExchangeInstruments().isEmpty()).isFalse();
- assertThat(ftx.getExchangeInstruments().isEmpty()).isFalse();
- assertThat(ftx.getExchangeMetaData().getInstruments().isEmpty()).isFalse();
- }
-}
diff --git a/xchange-ftx/src/test/java/org/knowm/xchange/ftx/FtxAdapterTest.java b/xchange-ftx/src/test/java/org/knowm/xchange/ftx/FtxAdapterTest.java
deleted file mode 100644
index 0aa8890c1e3..00000000000
--- a/xchange-ftx/src/test/java/org/knowm/xchange/ftx/FtxAdapterTest.java
+++ /dev/null
@@ -1,137 +0,0 @@
-package org.knowm.xchange.ftx;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import java.io.IOException;
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.time.LocalDateTime;
-import java.time.ZoneId;
-import java.time.ZoneOffset;
-import java.util.Date;
-import java.util.List;
-import org.junit.Test;
-import org.knowm.xchange.currency.Currency;
-import org.knowm.xchange.currency.CurrencyPair;
-import org.knowm.xchange.dto.Order.OrderStatus;
-import org.knowm.xchange.dto.Order.OrderType;
-import org.knowm.xchange.dto.trade.StopOrder;
-import org.knowm.xchange.ftx.dto.FtxResponse;
-import org.knowm.xchange.ftx.dto.trade.FtxConditionalOrderRequestPayload;
-import org.knowm.xchange.ftx.dto.trade.FtxConditionalOrderType;
-import org.knowm.xchange.ftx.dto.trade.FtxModifyConditionalOrderRequestPayload;
-import org.knowm.xchange.ftx.dto.trade.FtxOrderDto;
-import org.knowm.xchange.ftx.dto.trade.FtxOrderFlags;
-import org.knowm.xchange.ftx.dto.trade.FtxOrderSide;
-import org.knowm.xchange.ftx.dto.trade.FtxOrderStatus;
-
-public class FtxAdapterTest {
-
- @Test
- public void adaptCurrencyPairToFtxPair() {
- assertPair("BTC-USD", "BTC/USD", "BTC/USD");
- assertPair("BTC-PERP", "BTC/PERP", "BTC-PERP");
- assertPair("BTC-0625", "BTC/0625", "BTC-0625");
- }
-
- private void assertPair(String market, String expString, String expAdapted) {
- CurrencyPair currencyPair = new CurrencyPair(market);
- assertThat(currencyPair.toString()).isEqualTo(expString);
- assertThat(FtxAdapters.adaptCurrencyPairToFtxMarket(currencyPair)).isEqualTo(expAdapted);
- }
-
- @Test
- public void adaptOpenOrdersTest() throws IOException {
- InputStream is =
- FtxAdapterTest.class.getResourceAsStream("/responses/example-ftxOpenOrders.json");
-
- // Use Jackson to parse it
- ObjectMapper mapper = new ObjectMapper();
- FtxResponse> ftxResponse =
- mapper.readValue(is, new TypeReference>>() {});
-
- assertThat(FtxAdapters.adaptOpenOrders(ftxResponse).getOpenOrders().size()).isEqualTo(1);
- }
-
- @Test
- public void adaptUserTradesTest() throws IOException {
- InputStream is =
- FtxAdapterTest.class.getResourceAsStream("/responses/example-ftxOrderHistory.json");
-
- // Use Jackson to parse it
- ObjectMapper mapper = new ObjectMapper();
- FtxResponse> ftxResponse =
- mapper.readValue(is, new TypeReference>>() {});
-
- assertThat(FtxAdapters.adaptOpenOrders(ftxResponse).getOpenOrders().size()).isEqualTo(1);
- }
-
- @Test
- public void adaptFtxOrderStatusToOrderStatusTest() {
- assertThat(FtxAdapters.adaptFtxOrderStatusToOrderStatus(FtxOrderStatus.NEW))
- .isEqualTo(OrderStatus.NEW);
- assertThat(FtxAdapters.adaptFtxOrderStatusToOrderStatus(FtxOrderStatus.CANCELLED))
- .isEqualTo(OrderStatus.CANCELED);
- assertThat(FtxAdapters.adaptFtxOrderStatusToOrderStatus(FtxOrderStatus.CLOSED))
- .isEqualTo(OrderStatus.CLOSED);
- assertThat(FtxAdapters.adaptFtxOrderStatusToOrderStatus(FtxOrderStatus.TRIGGERED))
- .isEqualTo(OrderStatus.NEW);
- assertThat(FtxAdapters.adaptFtxOrderStatusToOrderStatus(FtxOrderStatus.OPEN))
- .isEqualTo(OrderStatus.OPEN);
- }
-
- @Test
- public void adaptConditionalOrderToFtxOrderPayloadTest() {
- CurrencyPair currencyPair = new CurrencyPair(Currency.BTC.getCurrencyCode(), "PERP");
- OrderType orderType = OrderType.BID;
- BigDecimal amount = BigDecimal.valueOf(0.001);
- Date date = Date.from(LocalDateTime.now(ZoneId.of("UTC")).toInstant(ZoneOffset.UTC));
- BigDecimal limit = BigDecimal.valueOf(30000);
- BigDecimal stopPrice = BigDecimal.valueOf(42000);
- StopOrder stopOrder =
- new StopOrder(
- orderType, amount, currencyPair, null, date, stopPrice, limit, null, null, null, null);
-
- FtxModifyConditionalOrderRequestPayload result =
- FtxAdapters.adaptModifyConditionalOrderToFtxOrderPayload(stopOrder);
-
- assertThat(result.getOrderPrice()).isEqualTo(limit);
- assertThat(result.getSize()).isEqualTo(amount);
- assertThat(result.getTriggerPrice()).isEqualTo(stopPrice);
- }
-
- @Test
- public void adaptStopOrderToFtxOrderPayloadTest() throws IOException {
- CurrencyPair currencyPair = new CurrencyPair(Currency.BTC.getCurrencyCode(), "PERP");
- OrderType orderType = OrderType.BID;
- BigDecimal amount = BigDecimal.valueOf(0.001);
- Date date = Date.from(LocalDateTime.now(ZoneId.of("UTC")).toInstant(ZoneOffset.UTC));
- BigDecimal limitPrice = BigDecimal.valueOf(30000);
- BigDecimal stopPrice = BigDecimal.valueOf(42000);
-
- StopOrder stopOrder =
- new StopOrder.Builder(orderType, currencyPair)
- .originalAmount(amount)
- .timestamp(date)
- .stopPrice(stopPrice)
- .limitPrice(limitPrice)
- .intention(StopOrder.Intention.STOP_LOSS)
- .build();
- stopOrder.addOrderFlag(FtxOrderFlags.REDUCE_ONLY);
- stopOrder.addOrderFlag(FtxOrderFlags.RETRY_UNTIL_FILLED);
-
- FtxConditionalOrderRequestPayload result =
- FtxAdapters.adaptStopOrderToFtxOrderPayload(stopOrder);
-
- assertThat(result.getMarket()).isEqualTo("BTC-PERP");
- assertThat(result.getOrderPrice()).isEqualTo(limitPrice);
- assertThat(result.getSize()).isEqualTo(amount);
- assertThat(result.getTriggerPrice()).isEqualTo(stopPrice);
- assertThat(result.getType()).isEqualTo(FtxConditionalOrderType.stop);
- assertThat(result.getSide()).isEqualTo(FtxOrderSide.buy);
- assertThat(result.isReduceOnly()).isEqualTo(true);
- assertThat(result.isRetryUntilFilled()).isEqualTo(true);
- }
-}
diff --git a/xchange-ftx/src/test/java/org/knowm/xchange/ftx/dto/account/AccountDtosTest.java b/xchange-ftx/src/test/java/org/knowm/xchange/ftx/dto/account/AccountDtosTest.java
deleted file mode 100644
index 30302c6d306..00000000000
--- a/xchange-ftx/src/test/java/org/knowm/xchange/ftx/dto/account/AccountDtosTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.knowm.xchange.ftx.dto.account;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import java.io.IOException;
-import java.io.InputStream;
-import java.math.BigDecimal;
-import org.junit.Test;
-import org.knowm.xchange.ftx.dto.FtxResponse;
-import org.knowm.xchange.ftx.dto.trade.FtxOrderSide;
-import org.knowm.xchange.ftx.dto.trade.TradeDtosTest;
-
-public class AccountDtosTest {
-
- @Test
- public void accountDtoUnmarshall() throws IOException {
- // Read in the JSON from the example resources
- InputStream is =
- TradeDtosTest.class.getResourceAsStream("/responses/example-ftxAccountInfo.json");
-
- // Use Jackson to parse it
- ObjectMapper mapper = new ObjectMapper();
- FtxResponse ftxResponse =
- mapper.readValue(is, new TypeReference>() {});
-
- // Verify that the example data was unmarshalled correctly
-
- assertThat(ftxResponse.getResult().getPositions().size()).isEqualTo(1);
- assertThat(ftxResponse.getResult().getPositions().get(0).getSide())
- .isEqualTo(FtxOrderSide.sell);
- assertThat(ftxResponse.getResult().getUsername()).isEqualTo("user@domain.com");
- assertThat(ftxResponse.getResult().getLeverage()).isEqualByComparingTo(BigDecimal.valueOf(10));
- }
-}
diff --git a/xchange-ftx/src/test/java/org/knowm/xchange/ftx/dto/marketdata/MarketDataDtosTest.java b/xchange-ftx/src/test/java/org/knowm/xchange/ftx/dto/marketdata/MarketDataDtosTest.java
deleted file mode 100644
index 2fc3e4f766c..00000000000
--- a/xchange-ftx/src/test/java/org/knowm/xchange/ftx/dto/marketdata/MarketDataDtosTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.knowm.xchange.ftx.dto.marketdata;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import java.io.IOException;
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.time.Instant;
-import java.util.Date;
-import java.util.List;
-import org.junit.Test;
-import org.knowm.xchange.ftx.dto.FtxResponse;
-import org.knowm.xchange.ftx.dto.trade.TradeDtosTest;
-import org.knowm.xchange.utils.jackson.CurrencyPairDeserializer;
-
-public class MarketDataDtosTest {
-
- @Test
- public void marketsDtoUnmarshall() throws IOException {
- // Read in the JSON from the example resources
- InputStream is = TradeDtosTest.class.getResourceAsStream("/responses/example-ftxMarkets.json");
-
- // Use Jackson to parse it
- ObjectMapper mapper = new ObjectMapper();
- FtxResponse ftxResponse =
- mapper.readValue(is, new TypeReference>() {});
-
- // Verify that the example data was unmarshalled correctly
- assertThat(ftxResponse.getResult().getMarketList().size()).isEqualTo(6);
-
- assertThat(ftxResponse.getResult().getMarketList().get(0).getAsk())
- .isEqualTo(BigDecimal.valueOf(128.09));
- assertThat(ftxResponse.getResult().getMarketList().get(0).getBaseCurrency()).isNull();
- assertThat(ftxResponse.getResult().getMarketList().get(0).getType()).isEqualTo("future");
- assertThat(ftxResponse.getResult().getMarketList().get(0).getName()).isEqualTo("AAPL-1225");
- }
-
- @Test
- public void tradesDtoUnmarshall() throws IOException {
- // Read in the JSON from the example resources
- InputStream is = TradeDtosTest.class.getResourceAsStream("/responses/example-ftxTrades.json");
-
- // Use Jackson to parse it
- ObjectMapper mapper = new ObjectMapper();
- FtxResponse> ftxResponse =
- mapper.readValue(is, new TypeReference>>() {});
-
- // Verify that the example data was unmarshalled correctly
- assertThat(ftxResponse.getResult().size()).isEqualTo(1);
- assertThat(ftxResponse.getResult().get(0).getTime()).isBefore(Date.from(Instant.now()));
- assertThat(ftxResponse.getResult().get(0).isLiquidation()).isFalse();
- }
-
- @Test
- public void currencyDeserializerTest() throws IOException {
- // Read in the JSON from the example resources
- InputStream is = TradeDtosTest.class.getResourceAsStream("/responses/example-ftxMarkets.json");
-
- // Use Jackson to parse it
- ObjectMapper mapper = new ObjectMapper();
- FtxResponse ftxResponse =
- mapper.readValue(is, new TypeReference>() {});
-
- // Deserialize CurrencyPair
-
- ftxResponse
- .getResult()
- .getMarketList()
- .forEach(
- ftxMarketDto -> {
- System.out.println(
- CurrencyPairDeserializer.getCurrencyPairFromString(ftxMarketDto.getName())
- .toString());
- });
- }
-}
diff --git a/xchange-ftx/src/test/java/org/knowm/xchange/ftx/dto/trade/TradeDtosTest.java b/xchange-ftx/src/test/java/org/knowm/xchange/ftx/dto/trade/TradeDtosTest.java
deleted file mode 100644
index 577140f793c..00000000000
--- a/xchange-ftx/src/test/java/org/knowm/xchange/ftx/dto/trade/TradeDtosTest.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package org.knowm.xchange.ftx.dto.trade;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import java.io.IOException;
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.util.List;
-import org.junit.Test;
-import org.knowm.xchange.ftx.dto.FtxResponse;
-
-public class TradeDtosTest {
-
- @Test
- public void openOrdersDtoUnmarshall() throws IOException {
- // Read in the JSON from the example resources
- InputStream is =
- TradeDtosTest.class.getResourceAsStream("/responses/example-ftxOpenOrders.json");
-
- // Use Jackson to parse it
- ObjectMapper mapper = new ObjectMapper();
- FtxResponse> ftxResponse =
- mapper.readValue(is, new TypeReference>>() {});
-
- // Verify that the example data was unmarshalled correctly
- assertThat(ftxResponse.getResult().size()).isEqualTo(1);
-
- assertThat(ftxResponse.getResult().get(0).getId()).isEqualTo(String.valueOf(9596912));
- assertThat(ftxResponse.getResult().get(0).getMarket()).isEqualTo("BTC-PERP");
- assertThat(ftxResponse.getResult().get(0).getSide()).isEqualTo(FtxOrderSide.buy);
- assertThat(ftxResponse.getResult().get(0).getType()).isEqualTo(FtxOrderType.limit);
- assertThat(ftxResponse.getResult().get(0).getStatus()).isEqualTo(FtxOrderStatus.NEW);
- }
-
- @Test
- public void userTradesDtoUnmarshall() throws IOException {
- // Read in the JSON from the example resources
- InputStream is =
- TradeDtosTest.class.getResourceAsStream("/responses/example-ftxOrderHistory.json");
-
- // Use Jackson to parse it
- ObjectMapper mapper = new ObjectMapper();
- FtxResponse> ftxResponse =
- mapper.readValue(is, new TypeReference>>() {});
-
- // Verify that the example data was unmarshalled correctly
- assertThat(ftxResponse.getResult().size()).isEqualTo(1);
-
- assertThat(ftxResponse.getResult().get(0).getId()).isEqualTo(String.valueOf(257132591));
- assertThat(ftxResponse.getResult().get(0).getMarket()).isEqualTo("BTC-PERP");
- assertThat(ftxResponse.getResult().get(0).getSide()).isEqualTo(FtxOrderSide.buy);
- assertThat(ftxResponse.getResult().get(0).getType()).isEqualTo(FtxOrderType.limit);
- assertThat(ftxResponse.getResult().get(0).getStatus()).isEqualTo(FtxOrderStatus.NEW);
- assertThat(ftxResponse.getResult().get(0).getFuture()).isEqualTo("BTC-PERP");
- }
-
- @Test
- public void openConditionalOrdersDtoUnmarshall() throws IOException {
- // Read in the JSON from the example resources
- InputStream is =
- TradeDtosTest.class.getResourceAsStream("/responses/example-ftxConditionalOpenOrders.json");
-
- // Use Jackson to parse it
- ObjectMapper mapper = new ObjectMapper();
- FtxResponse> ftxResponse =
- mapper.readValue(is, new TypeReference>>() {});
-
- // Verify that the example data was unmarshalled correctly
- assertThat(ftxResponse.getResult().size()).isEqualTo(1);
- assertThat(ftxResponse.getResult().get(0).getFuture()).isEqualTo("XRP-PERP");
- assertThat(ftxResponse.getResult().get(0).getId()).isEqualTo("50001");
- assertThat(ftxResponse.getResult().get(0).getMarket()).isEqualTo("XRP-PERP");
- assertThat(ftxResponse.getResult().get(0).getOrderPrice())
- .isEqualTo(BigDecimal.valueOf(321.12));
- assertThat(ftxResponse.getResult().get(0).isReduceOnly()).isEqualTo(false);
- assertThat(ftxResponse.getResult().get(0).getSide()).isEqualTo(FtxOrderSide.buy);
- assertThat(ftxResponse.getResult().get(0).getSize()).isEqualTo(BigDecimal.valueOf(0.003));
- assertThat(ftxResponse.getResult().get(0).getStatus()).isEqualTo(FtxOrderStatus.OPEN);
- assertThat(ftxResponse.getResult().get(0).getTrailStart())
- .isEqualTo(BigDecimal.valueOf(432.21));
- assertThat(ftxResponse.getResult().get(0).getTrailValue())
- .isEqualTo(BigDecimal.valueOf(654.43));
- assertThat(ftxResponse.getResult().get(0).getTriggerPrice())
- .isEqualTo(BigDecimal.valueOf(0.49));
- assertThat(ftxResponse.getResult().get(0).getType()).isEqualTo(FtxConditionalOrderType.stop);
- assertThat(ftxResponse.getResult().get(0).getOrderType()).isEqualTo(FtxOrderType.market);
- assertThat(ftxResponse.getResult().get(0).getFilledSize()).isEqualTo(BigDecimal.valueOf(42.42));
- assertThat(ftxResponse.getResult().get(0).getAvgFillPrice())
- .isEqualTo(BigDecimal.valueOf(234.65));
- assertThat(ftxResponse.getResult().get(0).isRetryUntilFilled()).isEqualTo(true);
- }
-
- @Test
- public void triggerDtoUnmarshall() throws IOException {
- // Read in the JSON from the example resources
- InputStream is =
- TradeDtosTest.class.getResourceAsStream(
- "/responses/example-ftxConditionalOrderTriggers.json");
-
- // Use Jackson to parse it
- ObjectMapper mapper = new ObjectMapper();
- FtxResponse> ftxResponse =
- mapper.readValue(is, new TypeReference>>() {});
-
- // Verify that the example data was unmarshalled correctly
- assertThat(ftxResponse.getResult().size()).isEqualTo(1);
- assertThat(ftxResponse.getResult().get(0).getError()).isEqualTo("error");
- assertThat(ftxResponse.getResult().get(0).getFilledSize()).isEqualTo(BigDecimal.valueOf(4.0));
- assertThat(ftxResponse.getResult().get(0).getOrderSize()).isEqualTo(BigDecimal.valueOf(10.0));
- assertThat(ftxResponse.getResult().get(0).getOrderId()).isEqualTo("38066650");
- }
-}
diff --git a/xchange-ftx/src/test/resources/responses/example-ftxAccountInfo.json b/xchange-ftx/src/test/resources/responses/example-ftxAccountInfo.json
deleted file mode 100644
index e0fec1eaa2f..00000000000
--- a/xchange-ftx/src/test/resources/responses/example-ftxAccountInfo.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "success": true,
- "result": {
- "backstopProvider": true,
- "collateral": 3568181.02691129,
- "freeCollateral": 1786071.456884368,
- "initialMarginRequirement": 0.12222384240257728,
- "leverage": 10,
- "liquidating": false,
- "maintenanceMarginRequirement": 0.07177992558058484,
- "makerFee": 0.0002,
- "marginFraction": 0.5588433331419503,
- "openMarginFraction": 0.2447194090423075,
- "takerFee": 0.0005,
- "totalAccountValue": 3568180.98341129,
- "totalPositionSize": 6384939.6992,
- "username": "user@domain.com",
- "positions": [
- {
- "cost": -31.7906,
- "entryPrice": 138.22,
- "future": "ETH-PERP",
- "initialMarginRequirement": 0.1,
- "longOrderSize": 1744.55,
- "maintenanceMarginRequirement": 0.04,
- "netSize": -0.23,
- "openSize": 1744.32,
- "realizedPnl": 3.39441714,
- "shortOrderSize": 1732.09,
- "side": "sell",
- "size": 0.23,
- "unrealizedPnl": 0
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/xchange-ftx/src/test/resources/responses/example-ftxConditionalOpenOrders.json b/xchange-ftx/src/test/resources/responses/example-ftxConditionalOpenOrders.json
deleted file mode 100644
index f2384cd34a2..00000000000
--- a/xchange-ftx/src/test/resources/responses/example-ftxConditionalOpenOrders.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "success": true,
- "result": [
- {
- "createdAt": "2019-03-05T09:56:55.728933+00:00",
- "error": null,
- "future": "XRP-PERP",
- "id": 50001,
- "market": "XRP-PERP",
- "orderId": "order-id",
- "orderPrice": 321.12,
- "reduceOnly": false,
- "side": "buy",
- "size": 0.003,
- "status": "open",
- "trailStart": 432.21,
- "trailValue": 654.43,
- "triggerPrice": 0.49,
- "triggeredAt": "2019-03-05T09:56:55.728933+00:00",
- "type": "stop",
- "orderType": "market",
- "filledSize": 42.42,
- "avgFillPrice": 234.65,
- "retryUntilFilled": true
- }
- ]
-}
\ No newline at end of file
diff --git a/xchange-ftx/src/test/resources/responses/example-ftxConditionalOrderTriggers.json b/xchange-ftx/src/test/resources/responses/example-ftxConditionalOrderTriggers.json
deleted file mode 100644
index 0f051998655..00000000000
--- a/xchange-ftx/src/test/resources/responses/example-ftxConditionalOrderTriggers.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "success": true,
- "result": [
- {
- "error": "error",
- "filledSize": 4.0,
- "orderSize": 10.0,
- "orderId": 38066650,
- "time": "2020-01-19T09:23:36.570904+00:00"
- }
- ]
-}
\ No newline at end of file
diff --git a/xchange-ftx/src/test/resources/responses/example-ftxMarkets.json b/xchange-ftx/src/test/resources/responses/example-ftxMarkets.json
deleted file mode 100644
index 511d226b472..00000000000
--- a/xchange-ftx/src/test/resources/responses/example-ftxMarkets.json
+++ /dev/null
@@ -1,144 +0,0 @@
-{
- "result": [
- {
- "ask": 128.09,
- "baseCurrency": null,
- "bid": 127.85,
- "change1h": -0.002183917011153576,
- "change24h": 0.04860655737704918,
- "changeBod": 0.0,
- "enabled": true,
- "highLeverageFeeExempt": false,
- "last": 127.93,
- "minProvideSize": 0.01,
- "name": "AAPL-1225",
- "postOnly": false,
- "price": 127.93,
- "priceIncrement": 0.01,
- "quoteCurrency": null,
- "quoteVolume24h": 82754.5233,
- "restricted": true,
- "sizeIncrement": 0.01,
- "tokenizedEquity": true,
- "type": "future",
- "underlying": "AAPL",
- "volumeUsd24h": 82754.5233
- },
- {
- "ask": 20507.0,
- "baseCurrency": null,
- "bid": 20488.5,
- "change1h": -0.0038617540621280937,
- "change24h": 0.003179728010957832,
- "changeBod": -0.005938098354298456,
- "enabled": true,
- "highLeverageFeeExempt": false,
- "last": 20517.5,
- "minProvideSize": 0.0001,
- "name": "BTC-0625",
- "postOnly": false,
- "price": 20507.0,
- "priceIncrement": 0.5,
- "quoteCurrency": null,
- "quoteVolume24h": 3569787.10815,
- "restricted": false,
- "sizeIncrement": 0.0001,
- "type": "future",
- "underlying": "BTC",
- "volumeUsd24h": 3569787.10815
- },
- {
- "ask": 423.0,
- "baseCurrency": null,
- "bid": 422.5,
- "change1h": -0.005875440658049354,
- "change24h": -0.019698725376593278,
- "changeBod": 0.00834326579261025,
- "enabled": true,
- "highLeverageFeeExempt": false,
- "last": 423.0,
- "minProvideSize": 0.0001,
- "name": "BTC-MOVE-1216",
- "postOnly": false,
- "price": 423.0,
- "priceIncrement": 0.5,
- "quoteCurrency": null,
- "quoteVolume24h": 106330.1879,
- "restricted": false,
- "sizeIncrement": 0.0001,
- "type": "future",
- "underlying": "BTC",
- "volumeUsd24h": 106330.1879
- },
- {
- "ask": 19329.0,
- "baseCurrency": null,
- "bid": 19328.5,
- "change1h": -0.004557861667610856,
- "change24h": 0.0007766588137831051,
- "changeBod": -0.006527717097992856,
- "enabled": true,
- "highLeverageFeeExempt": true,
- "last": 19328.5,
- "minProvideSize": 0.001,
- "name": "BTC-PERP",
- "postOnly": false,
- "price": 19328.5,
- "priceIncrement": 0.5,
- "quoteCurrency": null,
- "quoteVolume24h": 778066194.11935,
- "restricted": false,
- "sizeIncrement": 0.0001,
- "type": "future",
- "underlying": "BTC",
- "volumeUsd24h": 778066194.11935
- },
- {
- "ask": 19321.0,
- "baseCurrency": "BTC",
- "bid": 19320.0,
- "change1h": -0.004534095885823222,
- "change24h": 0.0009584499015646047,
- "changeBod": -0.006709166623823968,
- "enabled": true,
- "highLeverageFeeExempt": true,
- "last": 19320.5,
- "minProvideSize": 0.0001,
- "name": "BTC/USD",
- "postOnly": false,
- "price": 19320.5,
- "priceIncrement": 0.5,
- "quoteCurrency": "USD",
- "quoteVolume24h": 37670583.4427,
- "restricted": false,
- "sizeIncrement": 0.0001,
- "type": "spot",
- "underlying": null,
- "volumeUsd24h": 37670583.4427
- },
- {
- "ask": 0.0593,
- "baseCurrency": "ADABEAR",
- "bid": 0.058775,
- "change1h": 0.03604794641283272,
- "change24h": 0.1483978116451739,
- "changeBod": 0.03477112676056338,
- "enabled": true,
- "highLeverageFeeExempt": true,
- "last": 0.0587,
- "minProvideSize": 1.0,
- "name": "ADABEAR/USD",
- "postOnly": false,
- "price": 0.058775,
- "priceIncrement": 2.5e-05,
- "quoteCurrency": "USD",
- "quoteVolume24h": 5466.98187,
- "restricted": false,
- "sizeIncrement": 1.0,
- "type": "spot",
- "underlying": null,
- "volumeUsd24h": 5466.98187
- }
- ],
- "success": true
-}
\ No newline at end of file
diff --git a/xchange-ftx/src/test/resources/responses/example-ftxOpenOrders.json b/xchange-ftx/src/test/resources/responses/example-ftxOpenOrders.json
deleted file mode 100644
index 50b13712538..00000000000
--- a/xchange-ftx/src/test/resources/responses/example-ftxOpenOrders.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "success": true,
- "result": [
- {
- "createdAt": "2019-03-05T09:56:55.728933+00:00",
- "filledSize": 10,
- "future": "BTC-PERP",
- "id": 9596912,
- "market": "BTC-PERP",
- "price": 0.306525,
- "avgFillPrice": 0.306526,
- "remainingSize": 31421,
- "side": "buy",
- "size": 31431,
- "status": "new",
- "type": "limit",
- "reduceOnly": false,
- "ioc": false,
- "postOnly": false,
- "clientId": null
- }
- ]
-}
\ No newline at end of file
diff --git a/xchange-ftx/src/test/resources/responses/example-ftxOrderHistory.json b/xchange-ftx/src/test/resources/responses/example-ftxOrderHistory.json
deleted file mode 100644
index 6b43847c17f..00000000000
--- a/xchange-ftx/src/test/resources/responses/example-ftxOrderHistory.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "success": true,
- "result": [
- {
- "avgFillPrice": 10135.25,
- "clientId": null,
- "createdAt": "2019-06-27T15:24:03.101197+00:00",
- "filledSize": 0.001,
- "future": "BTC-PERP",
- "id": 257132591,
- "ioc": false,
- "market": "BTC-PERP",
- "postOnly": false,
- "price": 10135.25,
- "reduceOnly": false,
- "remainingSize": 0.0,
- "side": "buy",
- "size": 0.001,
- "status": "new",
- "type": "limit"
- }
- ],
- "hasMoreData": false
-}
\ No newline at end of file
diff --git a/xchange-ftx/src/test/resources/responses/example-ftxTrades.json b/xchange-ftx/src/test/resources/responses/example-ftxTrades.json
deleted file mode 100644
index bffbb56f152..00000000000
--- a/xchange-ftx/src/test/resources/responses/example-ftxTrades.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "success": true,
- "result": [
- {
- "id": 3855995,
- "liquidation": false,
- "price": 3857.75,
- "side": "buy",
- "size": 0.111,
- "time": "2019-03-20T18:16:23.397991+00:00"
- }
- ]
-}
\ No newline at end of file
diff --git a/xchange-stream-ftx/pom.xml b/xchange-stream-ftx/pom.xml
deleted file mode 100644
index 5affb330825..00000000000
--- a/xchange-stream-ftx/pom.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
- 4.0.0
-
-
- org.knowm.xchange
- xchange-parent
- 5.2.1-SNAPSHOT
-
- xchange-stream-ftx
-
- XChange Ftx Stream
-
-
-
- org.knowm.xchange
- xchange-ftx
- ${project.parent.version}
- compile
-
-
- org.knowm.xchange
- xchange-stream-core
- ${project.parent.version}
- compile
-
-
- org.mockito
- mockito-core
-
-
-
-
diff --git a/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingAdapters.java b/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingAdapters.java
deleted file mode 100644
index 1a4dda0fbdb..00000000000
--- a/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingAdapters.java
+++ /dev/null
@@ -1,281 +0,0 @@
-package info.bitrich.xchangestream.ftx;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
-import com.google.common.collect.Streams;
-import info.bitrich.xchangestream.ftx.dto.FtxOrderbookResponse;
-import info.bitrich.xchangestream.ftx.dto.FtxTickerResponse;
-import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper;
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.nio.charset.StandardCharsets;
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-import java.time.Instant;
-import java.time.OffsetDateTime;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import java.util.stream.Collectors;
-import java.util.zip.CRC32;
-import org.knowm.xchange.currency.Currency;
-import org.knowm.xchange.currency.CurrencyPair;
-import org.knowm.xchange.dto.Order;
-import org.knowm.xchange.dto.Order.OrderType;
-import org.knowm.xchange.dto.marketdata.OrderBook;
-import org.knowm.xchange.dto.marketdata.Ticker;
-import org.knowm.xchange.dto.marketdata.Trade;
-import org.knowm.xchange.dto.trade.LimitOrder;
-import org.knowm.xchange.dto.trade.UserTrade;
-import org.knowm.xchange.dto.trade.UserTrade.Builder;
-import org.knowm.xchange.ftx.FtxAdapters;
-import org.knowm.xchange.ftx.dto.marketdata.FtxTradeDto;
-import org.knowm.xchange.ftx.dto.trade.FtxOrderFlags;
-import org.knowm.xchange.instrument.Instrument;
-
-public class FtxStreamingAdapters {
-
- private static final ObjectMapper mapper = StreamingObjectMapperHelper.getObjectMapper();
-
- /** Incoming values always has 1 trailing 0 after the decimal, and start with 1 zero */
- private static final ThreadLocal dfp =
- ThreadLocal.withInitial(
- () -> new DecimalFormat("0.0#######", new DecimalFormatSymbols(Locale.US)));
-
- private static final ThreadLocal dfs =
- ThreadLocal.withInitial(
- () -> new DecimalFormat("0.####E00", new DecimalFormatSymbols(Locale.US)));
- private static final ThreadLocal dfq =
- ThreadLocal.withInitial(
- () -> new DecimalFormat("0.0#######", new DecimalFormatSymbols(Locale.US)));
-
- static Ticker NULL_TICKER =
- new Ticker.Builder().build(); // not need to create a new one each time
-
- public static OrderBook adaptOrderbookMessage(
- OrderBook orderBook, Instrument instrument, JsonNode jsonNode) {
-
- Streams.stream(jsonNode)
- .filter(JsonNode::isObject)
- .map(
- res -> {
- try {
- return mapper.treeToValue(res, FtxOrderbookResponse.class);
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
- })
- .forEach(
- message -> {
- if ("partial".equals(message.getAction())) {
- message
- .getAsks()
- .forEach(
- ask ->
- orderBook
- .getAsks()
- .add(
- new LimitOrder.Builder(Order.OrderType.ASK, instrument)
- .limitPrice(ask.get(0))
- .originalAmount(ask.get(1))
- .build()));
-
- message
- .getBids()
- .forEach(
- bid ->
- orderBook
- .getBids()
- .add(
- new LimitOrder.Builder(Order.OrderType.BID, instrument)
- .limitPrice(bid.get(0))
- .originalAmount(bid.get(1))
- .build()));
- } else {
- message
- .getAsks()
- .forEach(
- ask ->
- orderBook.update(
- new LimitOrder.Builder(Order.OrderType.ASK, instrument)
- .limitPrice(ask.get(0))
- .originalAmount(ask.get(1))
- .build()));
- message
- .getBids()
- .forEach(
- bid ->
- orderBook.update(
- new LimitOrder.Builder(Order.OrderType.BID, instrument)
- .limitPrice(bid.get(0))
- .originalAmount(bid.get(1))
- .build()));
- }
-
- if (orderBook.getAsks().size() > 0 && orderBook.getBids().size() > 0) {
- Long calculatedChecksum =
- getOrderbookChecksum(orderBook.getAsks(), orderBook.getBids());
-
- if (!calculatedChecksum.equals(message.getChecksum())) {
- final OrderBook sortedOrderBook =
- new OrderBook(
- Date.from(Instant.now()),
- new ArrayList<>(orderBook.getAsks()),
- new ArrayList<>(orderBook.getBids()),
- true);
- calculatedChecksum =
- getOrderbookChecksum(sortedOrderBook.getAsks(), sortedOrderBook.getBids());
- if (!calculatedChecksum.equals(message.getChecksum())) {
- throw new IllegalStateException("Checksum is not correct!");
- }
- }
- }
- });
-
- return new OrderBook(
- Date.from(Instant.now()),
- new ArrayList<>(orderBook.getAsks()),
- new ArrayList<>(orderBook.getBids()),
- true);
- }
-
- public static Long getOrderbookChecksum(List asks, List bids) {
- StringBuilder data = new StringBuilder(3072);
- DecimalFormat fp = dfp.get();
- DecimalFormat fs = dfs.get();
- DecimalFormat fq = dfq.get();
-
- for (int i = 0; i < 100; i++) {
- if (bids.size() > i) {
- BigDecimal limitPrice = bids.get(i).getLimitPrice();
- boolean scientific = limitPrice.toPlainString().startsWith("0.0000");
-
- data.append(scientific ? fs.format(limitPrice) : fp.format(limitPrice))
- .append(":")
- .append(fq.format(bids.get(i).getOriginalAmount()))
- .append(":");
- }
-
- if (asks.size() > i) {
- BigDecimal limitPrice = asks.get(i).getLimitPrice();
- boolean scientific = limitPrice.toPlainString().startsWith("0.0000");
-
- data.append(scientific ? fs.format(limitPrice) : fp.format(limitPrice))
- .append(":")
- .append(fq.format(asks.get(i).getOriginalAmount()))
- .append(":");
- }
- }
-
- String s = data.toString().replace("E", "e");
-
- CRC32 crc32 = new CRC32();
- byte[] toBytes = s.getBytes(StandardCharsets.UTF_8);
- crc32.update(toBytes, 0, toBytes.length - 1); // strip last :
-
- return crc32.getValue();
- }
-
- public static Ticker adaptTickerMessage(Instrument instrument, JsonNode jsonNode) {
- return Streams.stream(jsonNode)
- .filter(JsonNode::isObject)
- .map(
- res -> {
- try {
- return mapper.treeToValue(res, FtxTickerResponse.class);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- })
- .map(ftxTickerResponse -> ftxTickerResponse.toTicker(instrument))
- .findFirst()
- .orElse(NULL_TICKER);
- }
-
- public static Iterable adaptTradesMessage(Instrument instrument, JsonNode jsonNode) {
- return Streams.stream(jsonNode)
- .filter(JsonNode::isArray)
- .map(res -> (ArrayNode) res)
- .flatMap(Streams::stream)
- .map(
- tradeNode -> {
- try {
- return mapper.treeToValue(tradeNode, FtxTradeDto.class);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- })
- .map(
- ftxTradeDto ->
- new Trade.Builder()
- .timestamp(ftxTradeDto.getTime())
- .instrument(instrument)
- .id(ftxTradeDto.getId())
- .price(ftxTradeDto.getPrice())
- .type(FtxAdapters.adaptFtxOrderSideToOrderType(ftxTradeDto.getSide()))
- .originalAmount(ftxTradeDto.getSize())
- .build())
- .collect(Collectors.toList());
- }
-
- public static UserTrade adaptUserTrade(JsonNode jsonNode) {
- JsonNode data = jsonNode.get("data");
-
- Builder userTradeBuilder =
- UserTrade.builder()
- .currencyPair(new CurrencyPair(data.get("market").asText()))
- .type("buy".equals(data.get("side").asText()) ? OrderType.BID : OrderType.ASK)
- .instrument(new CurrencyPair(data.get("market").asText()))
- .originalAmount(data.get("size").decimalValue())
- .price(data.get("price").decimalValue())
- .timestamp(Date.from(OffsetDateTime.parse(data.get("time").asText()).toInstant()))
- .id(data.get("id").asText())
- .orderId(data.get("orderId").asText())
- .feeAmount(data.get("fee").decimalValue())
- .feeCurrency(new Currency(data.get("feeCurrency").asText()));
-
- if (data.has("clientOrderId")) {
- userTradeBuilder.orderUserReference(data.get("clientOrderId").asText());
- }
- return userTradeBuilder.build();
- }
-
- public static Order adaptOrders(JsonNode jsonNode) {
- JsonNode data = jsonNode.get("data");
-
- // FTX reduces the remaining size on closed orders to 0 even though it's not filled.
- // Without any trade this results in a cumulative quantity equal to the size of the order,
- // which is wrong. We therefore calculate the remaining quantity manually.
- BigDecimal size = data.get("size").decimalValue();
- BigDecimal filledSize = data.get("filledSize").decimalValue();
- BigDecimal remainingSize = size.subtract(filledSize);
-
- LimitOrder.Builder order =
- new LimitOrder.Builder(
- "buy".equals(data.get("side").asText()) ? Order.OrderType.BID : Order.OrderType.ASK,
- new CurrencyPair(data.get("market").asText()))
- .id(data.get("id").asText())
- .timestamp(Date.from(Instant.now()))
- .limitPrice(data.get("price").decimalValue())
- .originalAmount(data.get("size").decimalValue())
- .userReference(data.get("clientId").asText())
- .remainingAmount(remainingSize)
- .cumulativeAmount(data.get("filledSize").decimalValue())
- .averagePrice(data.get("avgFillPrice").decimalValue())
- .orderStatus(Order.OrderStatus.valueOf(data.get("status").asText().toUpperCase()));
-
- if (data.get("ioc").asBoolean()) {
- order.flag(FtxOrderFlags.IOC);
- }
- if (data.get("postOnly").asBoolean()) {
- order.flag(FtxOrderFlags.POST_ONLY);
- }
- if (data.get("reduceOnly").asBoolean()) {
- order.flag(FtxOrderFlags.REDUCE_ONLY);
- }
-
- return order.build();
- }
-}
diff --git a/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingExchange.java b/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingExchange.java
deleted file mode 100644
index 2548b2799c9..00000000000
--- a/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingExchange.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package info.bitrich.xchangestream.ftx;
-
-import info.bitrich.xchangestream.core.ProductSubscription;
-import info.bitrich.xchangestream.core.StreamingExchange;
-import info.bitrich.xchangestream.core.StreamingMarketDataService;
-import info.bitrich.xchangestream.core.StreamingTradeService;
-import info.bitrich.xchangestream.ftx.dto.FtxWebsocketCredential;
-import info.bitrich.xchangestream.service.netty.ConnectionStateModel;
-import io.reactivex.rxjava3.core.Completable;
-import io.reactivex.rxjava3.core.Observable;
-import org.knowm.xchange.ExchangeSpecification;
-import org.knowm.xchange.ftx.FtxExchange;
-
-public class FtxStreamingExchange extends FtxExchange implements StreamingExchange {
-
- private static final String API_URI = "wss://ftx.com/ws/";
-
- private FtxStreamingService ftxStreamingService;
- private FtxStreamingMarketDataService ftxStreamingMarketDataService;
- private FtxStreamingTradeService ftxStreamingTradeService;
-
- @Override
- protected void initServices() {
- super.initServices();
-
- String apiUri =
- exchangeSpecification.getOverrideWebsocketApiUri() != null
- ? exchangeSpecification.getOverrideWebsocketApiUri()
- : API_URI;
-
- if (exchangeSpecification.getApiKey() != null) {
- this.ftxStreamingService =
- new FtxStreamingService(
- apiUri,
- () ->
- new FtxWebsocketCredential(
- exchangeSpecification.getApiKey(),
- exchangeSpecification.getSecretKey(),
- exchangeSpecification.getUserName()));
- this.ftxStreamingTradeService = new FtxStreamingTradeService(ftxStreamingService);
- } else {
- this.ftxStreamingService = new FtxStreamingService(apiUri);
- }
-
- applyStreamingSpecification(getExchangeSpecification(), ftxStreamingService);
- this.ftxStreamingMarketDataService = new FtxStreamingMarketDataService(ftxStreamingService);
- }
-
- @Override
- public Completable connect(ProductSubscription... args) {
- return ftxStreamingService.connect();
- }
-
- @Override
- public Completable disconnect() {
- return ftxStreamingService.disconnect();
- }
-
- @Override
- public boolean isAlive() {
- return ftxStreamingService.isSocketOpen();
- }
-
- @Override
- public Observable