From a8d4b270c51fa63b0dd4afb4a74e4d42b52142f6 Mon Sep 17 00:00:00 2001 From: "blaze.tan" Date: Mon, 19 Feb 2024 16:07:21 +0800 Subject: [PATCH] add new endpoint --- README.md | 2 +- pom.xml | 2 +- .../core/KucoinFuturesClientBuilder.java | 2 +- .../rest/adapter/FundingFeeAPIAdapter.java | 7 ++++++ .../core/rest/adapter/IndexAPIAdapter.java | 20 +++++++++------- .../core/rest/adapter/OrderAPIAdapter.java | 11 +++++---- .../core/rest/interfaces/FundingFeeAPI.java | 13 ++++++++++ .../core/rest/interfaces/IndexAPI.java | 16 ++++++++----- .../core/rest/interfaces/OrderAPI.java | 15 ++++++++---- .../retrofit/FundingFeeAPIRetrofit.java | 8 +++++++ .../interfaces/retrofit/IndexAPIRetrofit.java | 11 ++++----- .../interfaces/retrofit/OrderAPIRetrofit.java | 9 ++++--- .../OrderCancelByClientOidResponse.java | 24 +++++++++++++++++++ .../response/PublicFundingReteResponse.java | 15 ++++++++++++ .../response/TradeStatisticsResponse.java | 15 ++++++++++++ .../com/kucoin/futures/core/BaseTest.java | 7 +++--- .../core/KucoinFuturesRestClientTest.java | 19 ++++++++++++++- 17 files changed, 154 insertions(+), 42 deletions(-) create mode 100644 src/main/java/com/kucoin/futures/core/rest/response/OrderCancelByClientOidResponse.java create mode 100644 src/main/java/com/kucoin/futures/core/rest/response/PublicFundingReteResponse.java create mode 100644 src/main/java/com/kucoin/futures/core/rest/response/TradeStatisticsResponse.java diff --git a/README.md b/README.md index b34c5f8..97a139d 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The detailed document [https://docs.kucoin.com/futures/](https://docs.kucoin.com com.kucoin.futures kucoin-futures-java-sdk - 1.2.4 + 1.2.5 ``` ## Usage diff --git a/pom.xml b/pom.xml index 837e959..c594a5f 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.kucoin.futures kucoin-futures-java-sdk - 1.2.4 + 1.2.5 kucoin-futures-java-sdk kucoin-futures-java-sdk diff --git a/src/main/java/com/kucoin/futures/core/KucoinFuturesClientBuilder.java b/src/main/java/com/kucoin/futures/core/KucoinFuturesClientBuilder.java index ac6d23d..d857291 100644 --- a/src/main/java/com/kucoin/futures/core/KucoinFuturesClientBuilder.java +++ b/src/main/java/com/kucoin/futures/core/KucoinFuturesClientBuilder.java @@ -77,7 +77,7 @@ public KucoinFuturesRestClient buildRestClient() { if (tickerAPI == null) tickerAPI = new TickerAPIAdaptor(baseUrl); if (orderBookAPI == null) orderBookAPI = new OrderBookAPIAdapter(baseUrl); if (historyAPI == null) historyAPI = new HistoryAPIAdapter(baseUrl); - if (indexAPI == null) indexAPI = new IndexAPIAdapter(baseUrl); + if (indexAPI == null) indexAPI = new IndexAPIAdapter(baseUrl, apiKey); if (timeAPI == null) timeAPI = new TimeAPIAdapter(baseUrl); if (serviceStatusAPI == null) serviceStatusAPI = new ServiceStatusAPIAdapter(baseUrl); if (kChartAPI == null) kChartAPI = new KChartAPIAdapter(baseUrl); diff --git a/src/main/java/com/kucoin/futures/core/rest/adapter/FundingFeeAPIAdapter.java b/src/main/java/com/kucoin/futures/core/rest/adapter/FundingFeeAPIAdapter.java index 13fd8e7..ab89cbd 100644 --- a/src/main/java/com/kucoin/futures/core/rest/adapter/FundingFeeAPIAdapter.java +++ b/src/main/java/com/kucoin/futures/core/rest/adapter/FundingFeeAPIAdapter.java @@ -7,11 +7,13 @@ import com.kucoin.futures.core.rest.interceptor.FuturesApiKey; import com.kucoin.futures.core.rest.interfaces.FundingFeeAPI; import com.kucoin.futures.core.rest.request.DuringHasMoreRequest; +import com.kucoin.futures.core.rest.response.PublicFundingReteResponse; import com.kucoin.futures.core.rest.response.HasMoreResponse; import com.kucoin.futures.core.rest.interfaces.retrofit.FundingFeeAPIRetrofit; import com.kucoin.futures.core.rest.response.FundingHistoryResponse; import java.io.IOException; +import java.util.List; /** * @author chenshiwei @@ -31,4 +33,9 @@ public HasMoreResponse getFundingHistory(String symbol, return super.executeSync(getAPIImpl().getFundingHistory(symbol, reverse, forward, request.getStarAt(), request.getEndAt(), request.getOffset(), request.getMaxCount())); } + + @Override + public List getPublicFundingRates(String symbol, long from, long to) throws IOException { + return super.executeSync(getAPIImpl().getFundingRates(symbol, from, to)); + } } diff --git a/src/main/java/com/kucoin/futures/core/rest/adapter/IndexAPIAdapter.java b/src/main/java/com/kucoin/futures/core/rest/adapter/IndexAPIAdapter.java index bc07ef7..8ac6bb6 100644 --- a/src/main/java/com/kucoin/futures/core/rest/adapter/IndexAPIAdapter.java +++ b/src/main/java/com/kucoin/futures/core/rest/adapter/IndexAPIAdapter.java @@ -4,16 +4,13 @@ package com.kucoin.futures.core.rest.adapter; -import com.kucoin.futures.core.rest.response.IndexResponse; -import com.kucoin.futures.core.rest.response.MarkPriceResponse; +import com.kucoin.futures.core.rest.impl.retrofit.AuthRetrofitAPIImpl; +import com.kucoin.futures.core.rest.interceptor.FuturesApiKey; +import com.kucoin.futures.core.rest.response.*; import com.kucoin.futures.core.rest.impl.retrofit.PublicRetrofitAPIImpl; import com.kucoin.futures.core.rest.interfaces.IndexAPI; import com.kucoin.futures.core.rest.interfaces.retrofit.IndexAPIRetrofit; import com.kucoin.futures.core.rest.request.DuringHasMoreRequest; -import com.kucoin.futures.core.rest.response.FundingRateResponse; -import com.kucoin.futures.core.rest.response.HasMoreResponse; -import com.kucoin.futures.core.rest.response.IndexRateResponse; -import com.kucoin.futures.core.rest.response.InterestRateResponse; import java.io.IOException; @@ -21,10 +18,11 @@ * @author chenshiwei * @since 2019/10/15 */ -public class IndexAPIAdapter extends PublicRetrofitAPIImpl implements IndexAPI { +public class IndexAPIAdapter extends AuthRetrofitAPIImpl implements IndexAPI { - public IndexAPIAdapter(String baseUrl) { + public IndexAPIAdapter(String baseUrl, FuturesApiKey apiKey) { this.baseUrl = baseUrl; + this.apiKey = apiKey; } @Override @@ -60,4 +58,10 @@ public HasMoreResponse getPremiumIndex(String symbol) throws public FundingRateResponse getCurrentFundingRate(String symbol) throws IOException { return super.executeSync(getAPIImpl().getCurrentFundingRate(symbol)); } + + @Override + public TradeStatisticsResponse getTradeStatistics() throws IOException { + return super.executeSync(getAPIImpl().getTradeStatistics()); + } + } diff --git a/src/main/java/com/kucoin/futures/core/rest/adapter/OrderAPIAdapter.java b/src/main/java/com/kucoin/futures/core/rest/adapter/OrderAPIAdapter.java index 4aa3f93..bb63970 100644 --- a/src/main/java/com/kucoin/futures/core/rest/adapter/OrderAPIAdapter.java +++ b/src/main/java/com/kucoin/futures/core/rest/adapter/OrderAPIAdapter.java @@ -9,10 +9,8 @@ import com.kucoin.futures.core.rest.request.OrderCreateApiRequest; import com.kucoin.futures.core.rest.impl.retrofit.AuthRetrofitAPIImpl; import com.kucoin.futures.core.rest.request.DuringPageRequest; -import com.kucoin.futures.core.rest.response.OrderCancelResponse; -import com.kucoin.futures.core.rest.response.OrderCreateResponse; -import com.kucoin.futures.core.rest.response.OrderResponse; -import com.kucoin.futures.core.rest.response.Pagination; +import com.kucoin.futures.core.rest.response.*; +import retrofit2.http.Query; import java.io.IOException; import java.util.List; @@ -37,6 +35,11 @@ public OrderCancelResponse cancelOrder(String orderId) throws IOException { return executeSync(getAPIImpl().cancelOrder(orderId)); } + @Override + public OrderCancelByClientOidResponse cancelOrderByClientOid(String clientOid, String symbol) throws IOException { + return executeSync(getAPIImpl().cancelOrderByClientOid(clientOid, symbol)); + } + @Override public OrderCancelResponse cancelAllLimitOrders(String symbol) throws IOException { return executeSync(getAPIImpl().cancelLimitOrders(symbol)); diff --git a/src/main/java/com/kucoin/futures/core/rest/interfaces/FundingFeeAPI.java b/src/main/java/com/kucoin/futures/core/rest/interfaces/FundingFeeAPI.java index 78c54e8..3290b7e 100644 --- a/src/main/java/com/kucoin/futures/core/rest/interfaces/FundingFeeAPI.java +++ b/src/main/java/com/kucoin/futures/core/rest/interfaces/FundingFeeAPI.java @@ -3,11 +3,13 @@ */ package com.kucoin.futures.core.rest.interfaces; +import com.kucoin.futures.core.rest.response.PublicFundingReteResponse; import com.kucoin.futures.core.rest.response.FundingHistoryResponse; import com.kucoin.futures.core.rest.request.DuringHasMoreRequest; import com.kucoin.futures.core.rest.response.HasMoreResponse; import java.io.IOException; +import java.util.List; /** * Funding Fee API @@ -31,4 +33,15 @@ public interface FundingFeeAPI { HasMoreResponse getFundingHistory(String symbol, Boolean reverse, Boolean forward, DuringHasMoreRequest request) throws IOException; + /** + * Get Public Funding History + * + * @param symbol + * @param from + * @param to + * @return + * @throws IOException + */ + List getPublicFundingRates(String symbol, long from, long to) throws IOException; + } diff --git a/src/main/java/com/kucoin/futures/core/rest/interfaces/IndexAPI.java b/src/main/java/com/kucoin/futures/core/rest/interfaces/IndexAPI.java index 1595645..0195907 100644 --- a/src/main/java/com/kucoin/futures/core/rest/interfaces/IndexAPI.java +++ b/src/main/java/com/kucoin/futures/core/rest/interfaces/IndexAPI.java @@ -4,13 +4,8 @@ package com.kucoin.futures.core.rest.interfaces; -import com.kucoin.futures.core.rest.response.IndexResponse; -import com.kucoin.futures.core.rest.response.MarkPriceResponse; +import com.kucoin.futures.core.rest.response.*; import com.kucoin.futures.core.rest.request.DuringHasMoreRequest; -import com.kucoin.futures.core.rest.response.FundingRateResponse; -import com.kucoin.futures.core.rest.response.HasMoreResponse; -import com.kucoin.futures.core.rest.response.IndexRateResponse; -import com.kucoin.futures.core.rest.response.InterestRateResponse; import java.io.IOException; @@ -73,4 +68,13 @@ HasMoreResponse getIndexList(String symbol, Boolean reverse, Bool * @return */ FundingRateResponse getCurrentFundingRate(String symbol) throws IOException; + + /** + * Get 24hour futures transaction volume + * + * @return + * @throws IOException + */ + TradeStatisticsResponse getTradeStatistics() throws IOException; + } diff --git a/src/main/java/com/kucoin/futures/core/rest/interfaces/OrderAPI.java b/src/main/java/com/kucoin/futures/core/rest/interfaces/OrderAPI.java index 1bba45e..e363c10 100644 --- a/src/main/java/com/kucoin/futures/core/rest/interfaces/OrderAPI.java +++ b/src/main/java/com/kucoin/futures/core/rest/interfaces/OrderAPI.java @@ -5,10 +5,7 @@ import com.kucoin.futures.core.rest.request.DuringPageRequest; import com.kucoin.futures.core.rest.request.OrderCreateApiRequest; -import com.kucoin.futures.core.rest.response.OrderCancelResponse; -import com.kucoin.futures.core.rest.response.OrderCreateResponse; -import com.kucoin.futures.core.rest.response.OrderResponse; -import com.kucoin.futures.core.rest.response.Pagination; +import com.kucoin.futures.core.rest.response.*; import java.io.IOException; import java.util.List; @@ -46,6 +43,16 @@ public interface OrderAPI { */ OrderCancelResponse cancelOrder(String orderId) throws IOException; + /** + * Cancel Order by clientOid + * + * @param clientOid + * @param symbol + * @return OrderCancelByClientOidResponse + * @throws IOException + */ + OrderCancelByClientOidResponse cancelOrderByClientOid(String clientOid, String symbol) throws IOException; + /** * Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders. * diff --git a/src/main/java/com/kucoin/futures/core/rest/interfaces/retrofit/FundingFeeAPIRetrofit.java b/src/main/java/com/kucoin/futures/core/rest/interfaces/retrofit/FundingFeeAPIRetrofit.java index 4998bad..563c430 100644 --- a/src/main/java/com/kucoin/futures/core/rest/interfaces/retrofit/FundingFeeAPIRetrofit.java +++ b/src/main/java/com/kucoin/futures/core/rest/interfaces/retrofit/FundingFeeAPIRetrofit.java @@ -3,6 +3,7 @@ */ package com.kucoin.futures.core.rest.interfaces.retrofit; +import com.kucoin.futures.core.rest.response.PublicFundingReteResponse; import com.kucoin.futures.core.rest.response.FundingHistoryResponse; import com.kucoin.futures.core.rest.response.HasMoreResponse; import com.kucoin.futures.core.rest.response.KucoinFuturesResponse; @@ -10,6 +11,8 @@ import retrofit2.http.GET; import retrofit2.http.Query; +import java.util.List; + /** * @author chenshiwei * @since 2019/10/14 @@ -25,4 +28,9 @@ Call>> getFundingH @Query("offset") Long offset, @Query("maxCount") Long maxCount); + @GET("/api/v1/contract/funding-rates") + Call>> getFundingRates(@Query("symbol") String symbol, + @Query("from") long from, + @Query("to") long to); + } diff --git a/src/main/java/com/kucoin/futures/core/rest/interfaces/retrofit/IndexAPIRetrofit.java b/src/main/java/com/kucoin/futures/core/rest/interfaces/retrofit/IndexAPIRetrofit.java index d3f796a..a958b47 100644 --- a/src/main/java/com/kucoin/futures/core/rest/interfaces/retrofit/IndexAPIRetrofit.java +++ b/src/main/java/com/kucoin/futures/core/rest/interfaces/retrofit/IndexAPIRetrofit.java @@ -4,13 +4,7 @@ package com.kucoin.futures.core.rest.interfaces.retrofit; -import com.kucoin.futures.core.rest.response.IndexResponse; -import com.kucoin.futures.core.rest.response.MarkPriceResponse; -import com.kucoin.futures.core.rest.response.FundingRateResponse; -import com.kucoin.futures.core.rest.response.HasMoreResponse; -import com.kucoin.futures.core.rest.response.IndexRateResponse; -import com.kucoin.futures.core.rest.response.InterestRateResponse; -import com.kucoin.futures.core.rest.response.KucoinFuturesResponse; +import com.kucoin.futures.core.rest.response.*; import retrofit2.Call; import retrofit2.http.GET; import retrofit2.http.Path; @@ -49,4 +43,7 @@ Call>> getIndexList(@Query( @GET("api/v1/funding-rate/{symbol}/current") Call> getCurrentFundingRate(@Path("symbol") String symbol); + @GET("api/v1/trade-statistics") + Call> getTradeStatistics(); + } diff --git a/src/main/java/com/kucoin/futures/core/rest/interfaces/retrofit/OrderAPIRetrofit.java b/src/main/java/com/kucoin/futures/core/rest/interfaces/retrofit/OrderAPIRetrofit.java index 94db84d..b6c74f8 100644 --- a/src/main/java/com/kucoin/futures/core/rest/interfaces/retrofit/OrderAPIRetrofit.java +++ b/src/main/java/com/kucoin/futures/core/rest/interfaces/retrofit/OrderAPIRetrofit.java @@ -4,11 +4,7 @@ package com.kucoin.futures.core.rest.interfaces.retrofit; import com.kucoin.futures.core.rest.request.OrderCreateApiRequest; -import com.kucoin.futures.core.rest.response.KucoinFuturesResponse; -import com.kucoin.futures.core.rest.response.OrderCancelResponse; -import com.kucoin.futures.core.rest.response.OrderCreateResponse; -import com.kucoin.futures.core.rest.response.OrderResponse; -import com.kucoin.futures.core.rest.response.Pagination; +import com.kucoin.futures.core.rest.response.*; import retrofit2.Call; import retrofit2.http.Body; import retrofit2.http.DELETE; @@ -30,6 +26,9 @@ public interface OrderAPIRetrofit { @DELETE("api/v1/orders/{orderId}") Call> cancelOrder(@Path("orderId") String orderId); + @DELETE("api/v1/orders/client-order/{clientOid}") + Call> cancelOrderByClientOid(@Path("clientOid") String clientOid, @Query("symbol") String symbol); + @DELETE("api/v1/orders") Call> cancelLimitOrders(@Query("symbol") String symbol); diff --git a/src/main/java/com/kucoin/futures/core/rest/response/OrderCancelByClientOidResponse.java b/src/main/java/com/kucoin/futures/core/rest/response/OrderCancelByClientOidResponse.java new file mode 100644 index 0000000..a1bb733 --- /dev/null +++ b/src/main/java/com/kucoin/futures/core/rest/response/OrderCancelByClientOidResponse.java @@ -0,0 +1,24 @@ +/* + * Copyright 2019 Mek Global Limited + */ +package com.kucoin.futures.core.rest.response; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; +import lombok.ToString; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * @author blazetan + */ +@Data +@ToString +@JsonIgnoreProperties(ignoreUnknown = true) +public class OrderCancelByClientOidResponse { + + private String clientOid; + +} diff --git a/src/main/java/com/kucoin/futures/core/rest/response/PublicFundingReteResponse.java b/src/main/java/com/kucoin/futures/core/rest/response/PublicFundingReteResponse.java new file mode 100644 index 0000000..5cc7c8c --- /dev/null +++ b/src/main/java/com/kucoin/futures/core/rest/response/PublicFundingReteResponse.java @@ -0,0 +1,15 @@ +package com.kucoin.futures.core.rest.response; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @author blazetan + */ +@Data +public class PublicFundingReteResponse { + private String symbol; + private BigDecimal fundingRate; + private long timepoint; +} diff --git a/src/main/java/com/kucoin/futures/core/rest/response/TradeStatisticsResponse.java b/src/main/java/com/kucoin/futures/core/rest/response/TradeStatisticsResponse.java new file mode 100644 index 0000000..c29ebeb --- /dev/null +++ b/src/main/java/com/kucoin/futures/core/rest/response/TradeStatisticsResponse.java @@ -0,0 +1,15 @@ +package com.kucoin.futures.core.rest.response; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @author blazetan + */ +@Data +public class TradeStatisticsResponse { + + private BigDecimal turnoverOf24h; + +} diff --git a/src/test/java/com/kucoin/futures/core/BaseTest.java b/src/test/java/com/kucoin/futures/core/BaseTest.java index bc0e407..c4e1fed 100644 --- a/src/test/java/com/kucoin/futures/core/BaseTest.java +++ b/src/test/java/com/kucoin/futures/core/BaseTest.java @@ -43,8 +43,7 @@ public class BaseTest { @BeforeClass public static void setUpClass() throws IOException { KucoinFuturesClientBuilder builder = new KucoinFuturesClientBuilder().withBaseUrl("https://api-futures.kucoin.com") - .withApiKey("", "", - "", APIConstants.DEFAULT_API_KEY_VERSION); + .withApiKey("", "", "", APIConstants.DEFAULT_API_KEY_VERSION); futuresRestClient = builder.buildRestClient(); kucoinFuturesPrivateWSClient = builder.buildPrivateWSClient(); @@ -53,8 +52,8 @@ public static void setUpClass() throws IOException { kucoinFuturesPublicWSClient = builder.buildPublicWSClient(); kucoinFuturesPublicWSClient.connect(); - startAt = LocalDateTime.of(2021, 3, 1, 0, 0, 0).atZone(ZoneId.of("Asia/Shanghai")).toInstant().toEpochMilli(); - endAt = LocalDateTime.of(2021, 4, 30, 0, 0, 0).atZone(ZoneId.of("Asia/Shanghai")).toInstant().toEpochMilli(); + startAt = LocalDateTime.of(2024, 1, 1, 0, 0, 0).atZone(ZoneId.of("Asia/Shanghai")).toInstant().toEpochMilli(); + endAt = LocalDateTime.of(2024, 1, 30, 0, 0, 0).atZone(ZoneId.of("Asia/Shanghai")).toInstant().toEpochMilli(); pageRequest = DuringPageRequest.builder().starAt(startAt).endAt(endAt).currentPage(1).pageSize(10).build(); hasMoreRequest = DuringHasMoreRequest.builder().starAt(startAt).endAt(endAt).offset(0).maxCount(10).build(); diff --git a/src/test/java/com/kucoin/futures/core/KucoinFuturesRestClientTest.java b/src/test/java/com/kucoin/futures/core/KucoinFuturesRestClientTest.java index c669cae..2ed3cb9 100644 --- a/src/test/java/com/kucoin/futures/core/KucoinFuturesRestClientTest.java +++ b/src/test/java/com/kucoin/futures/core/KucoinFuturesRestClientTest.java @@ -135,6 +135,15 @@ public void orderAPI() throws Exception { OrderCancelResponse orderCancelResponse = futuresRestClient.orderAPI().cancelOrder(order.getOrderId()); assertThat(orderCancelResponse.getCancelledOrderIds().size(), is(1)); + order = placeCannotDealLimitOrder(); + assertThat(order, notNullValue()); + + orderDetail = futuresRestClient.orderAPI().getOrderDetail(order.getOrderId()); + assertThat(orderDetail, notNullValue()); + + OrderCancelByClientOidResponse orderCancelByClientOidResponse = futuresRestClient.orderAPI().cancelOrderByClientOid(orderDetail.getClientOid(), SYMBOL); + assertThat(orderCancelByClientOidResponse.getClientOid(), notNullValue()); + placeCannotDealLimitOrder(); OrderCancelResponse cancelAllLimitOrders = futuresRestClient.orderAPI().cancelAllLimitOrders(SYMBOL); assertThat(cancelAllLimitOrders.getCancelledOrderIds().size(), greaterThan(0)); @@ -189,6 +198,10 @@ public void fundingFeeAPI() throws Exception { HasMoreResponse fundingHistory = futuresRestClient.fundingFeeAPI() .getFundingHistory(SYMBOL, null, null, hasMoreRequest); assertThat(fundingHistory, notNullValue()); + + List publicFundingReteResponses = futuresRestClient.fundingFeeAPI().getPublicFundingRates("IDUSDTM", 1700310700000L, 1702310700000L); + assertThat(publicFundingReteResponses, notNullValue()); + } @Test @@ -235,6 +248,10 @@ public void indexAPI() throws Exception { FundingRateResponse currentFundingRate = futuresRestClient.indexAPI().getCurrentFundingRate(SYMBOL); assertThat(currentFundingRate, notNullValue()); + + TradeStatisticsResponse tradeStatistics = futuresRestClient.indexAPI().getTradeStatistics(); + assertThat(tradeStatistics, notNullValue()); + } @Test @@ -258,7 +275,7 @@ public void timeAPI() throws Exception { private OrderCreateResponse placeCannotDealLimitOrder() throws IOException { OrderCreateApiRequest pageRequest = OrderCreateApiRequest.builder() - .price(BigDecimal.valueOf(1000)).size(BigDecimal.ONE).side("buy").leverage("5") + .price(BigDecimal.valueOf(5)).size(BigDecimal.ONE).side("buy").leverage("5") .symbol(SYMBOL).type("limit").clientOid(UUID.randomUUID().toString()).build(); return futuresRestClient.orderAPI().createOrder(pageRequest); }