示例#1
0
 /// <summary>
 /// This is the taker volume for both buyers and sellers. This shows the influx and exit of funds in and out of {coin}.
 /// </summary>
 /// <param name="currency">Currency</param>
 /// <param name="instrumentType">Instrument Type</param>
 /// <param name="period">period, the default is 5m, e.g. [5m/1H/1D]</param>
 /// <param name="begin">begin, e.g. 1597026383085</param>
 /// <param name="end">end, e.g. 1597026383011</param>
 /// <param name="ct">Cancellation Token</param>
 /// <returns></returns>
 public virtual WebCallResult <IEnumerable <OkexTakerVolume> > GetRubikTakerVolume(
     string currency,
     OkexInstrumentType instrumentType,
     OkexPeriod period    = OkexPeriod.FiveMinutes,
     long?begin           = null,
     long?end             = null,
     CancellationToken ct = default) => GetRubikTakerVolume_Async(currency, instrumentType, period, begin, end, ct).Result;
        /// <summary>
        /// Retrieve advance algo orders (includes iceberg order and twap order). Data will be pushed when first subscribed. Data will be pushed when triggered by events such as placing/canceling order.
        /// </summary>
        /// <param name="instrumentType">Instrument Type</param>
        /// <param name="instrumentId">Instrument ID</param>
        /// <param name="underlying">Underlying</param>
        /// <param name="onData">On Data Handler</param>
        /// <returns></returns>
        public virtual async Task <CallResult <UpdateSubscription> > SubscribeToAdvanceAlgoOrderUpdates_Async(
            OkexInstrumentType instrumentType,
            string instrumentId,
            string underlying,
            Action <OkexAlgoOrder> onData)
        {
            var internalHandler = new Action <DataEvent <OkexSocketUpdateResponse <IEnumerable <OkexAlgoOrder> > > >(data =>
            {
                foreach (var d in data.Data.Data)
                {
                    onData(d);
                }
            });


            var request = new OkexSocketRequest(OkexSocketOperation.Subscribe, new OkexSocketRequestArgument
            {
                Channel        = "algo-advance",
                InstrumentId   = instrumentId,
                InstrumentType = instrumentType,
                Underlying     = underlying,
            });

            return(await SubscribeAsync(request, null, true, internalHandler).ConfigureAwait(false));
        }
示例#3
0
        /// <summary>
        /// This is the taker volume for both buyers and sellers. This shows the influx and exit of funds in and out of {coin}.
        /// </summary>
        /// <param name="currency">Currency</param>
        /// <param name="instrumentType">Instrument Type</param>
        /// <param name="period">period, the default is 5m, e.g. [5m/1H/1D]</param>
        /// <param name="begin">begin, e.g. 1597026383085</param>
        /// <param name="end">end, e.g. 1597026383011</param>
        /// <param name="ct">Cancellation Token</param>
        /// <returns></returns>
        public virtual async Task <WebCallResult <IEnumerable <OkexTakerVolume> > > GetRubikTakerVolume_Async(
            string currency,
            OkexInstrumentType instrumentType,
            OkexPeriod period    = OkexPeriod.FiveMinutes,
            long?begin           = null,
            long?end             = null,
            CancellationToken ct = default)
        {
            var parameters = new Dictionary <string, object> {
                { "ccy", currency },
                { "instType", JsonConvert.SerializeObject(instrumentType, new InstrumentTypeConverter(false)) },
                { "period", JsonConvert.SerializeObject(period, new PeriodConverter(false)) },
            };

            parameters.AddOptionalParameter("begin", begin?.ToString(OkexGlobals.OkexCultureInfo));
            parameters.AddOptionalParameter("end", end?.ToString(OkexGlobals.OkexCultureInfo));

            var result = await SendRequestAsync <OkexRestApiResponse <IEnumerable <OkexTakerVolume> > >(GetUrl(Endpoints_V5_RubikStat_TakerVolume), HttpMethod.Get, ct, parameters).ConfigureAwait(false);

            if (!result.Success)
            {
                return(WebCallResult <IEnumerable <OkexTakerVolume> > .CreateErrorResult(result.ResponseStatusCode, result.ResponseHeaders, result.Error));
            }
            if (result.Data.ErrorCode > 0)
            {
                return(WebCallResult <IEnumerable <OkexTakerVolume> > .CreateErrorResult(result.ResponseStatusCode, result.ResponseHeaders, new ServerError(result.Data.ErrorCode, result.Data.ErrorMessage, result.Data.Data)));
            }

            return(new WebCallResult <IEnumerable <OkexTakerVolume> >(result.ResponseStatusCode, result.ResponseHeaders, result.Data.Data, null));
        }
示例#4
0
 /// <summary>
 /// Position information,Maximum leverage depends on your borrowings and margin ratio.
 /// </summary>
 /// <param name="instrumentType">Instrument Type</param>
 /// <param name="marginMode">Margin Mode</param>
 /// <param name="underlying">Underlying</param>
 /// <param name="instrumentId">Instrument ID</param>
 /// <param name="tier"></param>
 /// <param name="ct">Cancellation Token</param>
 /// <returns></returns>
 public virtual WebCallResult <IEnumerable <OkexPositionTier> > GetPositionTiers(
     OkexInstrumentType instrumentType,
     OkexMarginMode marginMode,
     string underlying,
     string instrumentId  = null,
     string tier          = null,
     CancellationToken ct = default) => GetPositionTiers_Async(instrumentType, marginMode, underlying, instrumentId, tier, ct).Result;
示例#5
0
 /// <summary>
 /// Retrieve information on liquidation orders in the last 1 days.
 /// </summary>
 /// <param name="instrumentType">Instrument Type</param>
 /// <param name="marginMode">Margin Mode</param>
 /// <param name="instrumentId">Instrument ID</param>
 /// <param name="currency">Currency</param>
 /// <param name="underlying">Underlying</param>
 /// <param name="alias">Alias</param>
 /// <param name="state">State</param>
 /// <param name="after">Pagination of data to return records earlier than the requested ts, Unix timestamp format in milliseconds, e.g. 1597026383085</param>
 /// <param name="before">Pagination of data to return records newer than the requested ts, Unix timestamp format in milliseconds, e.g. 1597026383085</param>
 /// <param name="limit">Number of results per request. The maximum is 100; the default is 100.</param>
 /// <param name="ct">Cancellation Token</param>
 /// <returns></returns>
 public virtual WebCallResult <IEnumerable <OkexLiquidationInfo> > GetLiquidationOrders(
     OkexInstrumentType instrumentType,
     OkexMarginMode?marginMode  = null,
     string instrumentId        = null,
     string currency            = null,
     string underlying          = null,
     OkexInstrumentAlias?alias  = null,
     OkexLiquidationState?state = null,
     long?after           = null, long?before = null, int limit = 100,
     CancellationToken ct = default) => GetLiquidationOrders_Async(
     instrumentType,
     marginMode,
     instrumentId,
     currency,
     underlying,
     alias,
     state,
     after, before, limit,
     ct).Result;
示例#6
0
        /// <summary>
        /// Position information,Maximum leverage depends on your borrowings and margin ratio.
        /// </summary>
        /// <param name="instrumentType">Instrument Type</param>
        /// <param name="marginMode">Margin Mode</param>
        /// <param name="underlying">Underlying</param>
        /// <param name="instrumentId">Instrument ID</param>
        /// <param name="tier"></param>
        /// <param name="ct">Cancellation Token</param>
        /// <returns></returns>
        public virtual async Task <WebCallResult <IEnumerable <OkexPositionTier> > > GetPositionTiers_Async(
            OkexInstrumentType instrumentType,
            OkexMarginMode marginMode,
            string underlying,
            string instrumentId  = null,
            string tier          = null,
            CancellationToken ct = default)
        {
            if (instrumentType.IsNotIn(OkexInstrumentType.Margin, OkexInstrumentType.Futures, OkexInstrumentType.Option, OkexInstrumentType.Swap))
            {
                throw new ArgumentException("Instrument Type can be only Margin, Futures, Option or Swap.");
            }

            var parameters = new Dictionary <string, object>
            {
                { "instType", JsonConvert.SerializeObject(instrumentType, new InstrumentTypeConverter(false)) },
                { "tdMode", JsonConvert.SerializeObject(marginMode, new MarginModeConverter(false)) },
            };

            parameters.AddOptionalParameter("uly", underlying);
            parameters.AddOptionalParameter("instId", instrumentId);
            parameters.AddOptionalParameter("tier", tier);

            var result = await SendRequestAsync <OkexRestApiResponse <IEnumerable <OkexPositionTier> > >(GetUrl(Endpoints_V5_Public_PositionTiers), HttpMethod.Get, ct, parameters).ConfigureAwait(false);

            if (!result.Success)
            {
                return(WebCallResult <IEnumerable <OkexPositionTier> > .CreateErrorResult(result.ResponseStatusCode, result.ResponseHeaders, result.Error));
            }
            if (result.Data.ErrorCode > 0)
            {
                return(WebCallResult <IEnumerable <OkexPositionTier> > .CreateErrorResult(result.ResponseStatusCode, result.ResponseHeaders, new ServerError(result.Data.ErrorCode, result.Data.ErrorMessage, result.Data.Data)));
            }

            return(new WebCallResult <IEnumerable <OkexPositionTier> >(result.ResponseStatusCode, result.ResponseHeaders, result.Data.Data, null));
        }
 /// <summary>
 /// The full instrument list will be pushed for the first time after subscription. Subsequently, the instruments will be pushed if there's any change to the instrument’s state (such as delivery of FUTURES, exercise of OPTION, listing of new contracts / trading pairs, trading suspension, etc.).
 /// </summary>
 /// <param name="instrumentType">Instrument Type</param>
 /// <param name="onData">On Data Handler</param>
 /// <returns></returns>
 public virtual CallResult <UpdateSubscription> SubscribeToInstruments(OkexInstrumentType instrumentType, Action <OkexInstrument> onData) => SubscribeToInstruments_Async(instrumentType, onData).Result;
 /// <summary>
 /// Retrieve the estimated delivery/exercise price of FUTURES contracts and OPTION.
 /// Only the estimated delivery/exercise price will be pushed an hour before delivery/exercise, and will be pushed if there is any price change.
 /// </summary>
 /// <param name="instrumentType">Instrument Type</param>
 /// <param name="underlying">Underlying</param>
 /// <param name="onData">On Data Handler</param>
 /// <returns></returns>
 public virtual CallResult <UpdateSubscription> SubscribeToEstimatedPrice(OkexInstrumentType instrumentType, string underlying, Action <OkexEstimatedPrice> onData) => SubscribeToEstimatedPrice_Async(instrumentType, underlying, onData).Result;
示例#9
0
        /// <summary>
        /// Retrieve the latest price snapshot, best bid/ask price, and trading volume in the last 24 hours.
        /// </summary>
        /// <param name="instrumentType">Instrument Type</param>
        /// <param name="underlying">Underlying</param>
        /// <param name="ct">Cancellation Token</param>
        /// <returns></returns>
        public virtual async Task <WebCallResult <IEnumerable <OkexTicker> > > GetTickers_Async(OkexInstrumentType instrumentType, string underlying = null, CancellationToken ct = default)
        {
            var parameters = new Dictionary <string, object>
            {
                { "instType", JsonConvert.SerializeObject(instrumentType, new InstrumentTypeConverter(false)) },
            };

            parameters.AddOptionalParameter("uly", underlying);

            var result = await SendRequestAsync <OkexRestApiResponse <IEnumerable <OkexTicker> > >(GetUrl(Endpoints_V5_Market_Tickers), HttpMethod.Get, ct, parameters).ConfigureAwait(false);

            if (!result.Success)
            {
                return(WebCallResult <IEnumerable <OkexTicker> > .CreateErrorResult(result.ResponseStatusCode, result.ResponseHeaders, result.Error));
            }
            if (result.Data.ErrorCode > 0)
            {
                return(WebCallResult <IEnumerable <OkexTicker> > .CreateErrorResult(result.ResponseStatusCode, result.ResponseHeaders, new ServerError(result.Data.ErrorCode, result.Data.ErrorMessage, result.Data.Data)));
            }

            return(new WebCallResult <IEnumerable <OkexTicker> >(result.ResponseStatusCode, result.ResponseHeaders, result.Data.Data, null));
        }
示例#10
0
 /// <summary>
 /// Retrieve the latest price snapshot, best bid/ask price, and trading volume in the last 24 hours.
 /// </summary>
 /// <param name="instrumentType">Instrument Type</param>
 /// <param name="underlying">Underlying</param>
 /// <param name="ct">Cancellation Token</param>
 /// <returns></returns>
 public virtual WebCallResult <IEnumerable <OkexTicker> > GetTickers(OkexInstrumentType instrumentType, string underlying = null, CancellationToken ct = default)
 => GetTickers_Async(instrumentType, underlying, ct).Result;
示例#11
0
        /// <summary>
        /// Retrieve the estimated delivery price, which will only have a return value one hour before the delivery/exercise.
        /// </summary>
        /// <param name="instrumentType">Instrument Type</param>
        /// <param name="underlying">Underlying</param>
        /// <param name="after">Pagination of data to return records earlier than the requested ts, Unix timestamp format in milliseconds, e.g. 1597026383085</param>
        /// <param name="before">Pagination of data to return records newer than the requested ts, Unix timestamp format in milliseconds, e.g. 1597026383085</param>
        /// <param name="limit">Number of results per request. The maximum is 100; the default is 100.</param>
        /// <param name="ct">Cancellation Token</param>
        /// <returns></returns>
        public virtual async Task <WebCallResult <IEnumerable <OkexDeliveryExerciseHistory> > > GetDeliveryExerciseHistory_Async(OkexInstrumentType instrumentType, string underlying, long?after = null, long?before = null, int limit = 100, CancellationToken ct = default)
        {
            if (instrumentType.IsNotIn(OkexInstrumentType.Futures, OkexInstrumentType.Option))
            {
                throw new ArgumentException("Instrument Type can be only Futures or Option.");
            }

            if (limit < 1 || limit > 100)
            {
                throw new ArgumentException("Limit can be between 1-100.");
            }

            var parameters = new Dictionary <string, object>
            {
                { "instType", JsonConvert.SerializeObject(instrumentType, new InstrumentTypeConverter(false)) },
                { "uly", underlying },
            };

            parameters.AddOptionalParameter("after", after?.ToString());
            parameters.AddOptionalParameter("before", before?.ToString());
            parameters.AddOptionalParameter("limit", limit.ToString());

            var result = await SendRequestAsync <OkexRestApiResponse <IEnumerable <OkexDeliveryExerciseHistory> > >(GetUrl(Endpoints_V5_Public_DeliveryExerciseHistory), HttpMethod.Get, ct, parameters).ConfigureAwait(false);

            if (!result.Success)
            {
                return(WebCallResult <IEnumerable <OkexDeliveryExerciseHistory> > .CreateErrorResult(result.ResponseStatusCode, result.ResponseHeaders, result.Error));
            }
            if (result.Data.ErrorCode > 0)
            {
                return(WebCallResult <IEnumerable <OkexDeliveryExerciseHistory> > .CreateErrorResult(result.ResponseStatusCode, result.ResponseHeaders, new ServerError(result.Data.ErrorCode, result.Data.ErrorMessage, result.Data.Data)));
            }

            return(new WebCallResult <IEnumerable <OkexDeliveryExerciseHistory> >(result.ResponseStatusCode, result.ResponseHeaders, result.Data.Data, null));
        }
示例#12
0
 /// <summary>
 /// Get Underlying
 /// </summary>
 /// <param name="instrumentType">Instrument Type</param>
 /// <param name="ct">Cancellation Token</param>
 /// <returns></returns>
 public virtual WebCallResult <IEnumerable <string> > GetUnderlying(OkexInstrumentType instrumentType, CancellationToken ct = default) => GetUnderlying_Async(instrumentType, ct).Result;
示例#13
0
 /// <summary>
 /// Retrieve mark price.
 /// We set the mark price based on the SPOT index and at a reasonable basis to prevent individual users from manipulating the market and causing the contract price to fluctuate.
 /// </summary>
 /// <param name="instrumentType">Instrument Type</param>
 /// <param name="underlying">Underlying</param>
 /// <param name="instrumentId">Instrument ID</param>
 /// <param name="ct">Cancellation Token</param>
 /// <returns></returns>
 public virtual WebCallResult <IEnumerable <OkexMarkPrice> > GetMarkPrices(OkexInstrumentType instrumentType, string underlying = null, string instrumentId = null, CancellationToken ct = default) => GetMarkPrices_Async(instrumentType, underlying, instrumentId, ct).Result;
示例#14
0
        /// <summary>
        /// Retrieve information on liquidation orders in the last 1 days.
        /// </summary>
        /// <param name="instrumentType">Instrument Type</param>
        /// <param name="marginMode">Margin Mode</param>
        /// <param name="instrumentId">Instrument ID</param>
        /// <param name="currency">Currency</param>
        /// <param name="underlying">Underlying</param>
        /// <param name="alias">Alias</param>
        /// <param name="state">State</param>
        /// <param name="after">Pagination of data to return records earlier than the requested ts, Unix timestamp format in milliseconds, e.g. 1597026383085</param>
        /// <param name="before">Pagination of data to return records newer than the requested ts, Unix timestamp format in milliseconds, e.g. 1597026383085</param>
        /// <param name="limit">Number of results per request. The maximum is 100; the default is 100.</param>
        /// <param name="ct">Cancellation Token</param>
        /// <returns></returns>
        public virtual async Task <WebCallResult <IEnumerable <OkexLiquidationInfo> > > GetLiquidationOrders_Async(
            OkexInstrumentType instrumentType,
            OkexMarginMode?marginMode  = null,
            string instrumentId        = null,
            string currency            = null,
            string underlying          = null,
            OkexInstrumentAlias?alias  = null,
            OkexLiquidationState?state = null,
            long?after           = null, long?before = null, int limit = 100,
            CancellationToken ct = default)
        {
            if (instrumentType.IsIn(OkexInstrumentType.Futures, OkexInstrumentType.Swap, OkexInstrumentType.Option) && string.IsNullOrEmpty(underlying))
            {
                throw new ArgumentException("Underlying is required.");
            }

            if (instrumentType.IsIn(OkexInstrumentType.Futures, OkexInstrumentType.Swap) && state == null)
            {
                throw new ArgumentException("State is required.");
            }

            if (instrumentType.IsIn(OkexInstrumentType.Futures) && alias == null)
            {
                throw new ArgumentException("Alias is required.");
            }

            if (limit < 1 || limit > 100)
            {
                throw new ArgumentException("Limit can be between 1-100.");
            }

            var parameters = new Dictionary <string, object>
            {
                { "instType", JsonConvert.SerializeObject(instrumentType, new InstrumentTypeConverter(false)) },
            };

            if (marginMode != null)
            {
                parameters.AddOptionalParameter("mgnMode", JsonConvert.SerializeObject(marginMode, new MarginModeConverter(false)));
            }
            parameters.AddOptionalParameter("instId", instrumentId);
            parameters.AddOptionalParameter("ccy", currency);
            parameters.AddOptionalParameter("uly", underlying);
            if (alias != null)
            {
                parameters.AddOptionalParameter("alias", JsonConvert.SerializeObject(alias, new InstrumentAliasConverter(false)));
            }
            if (state != null)
            {
                parameters.AddOptionalParameter("state", JsonConvert.SerializeObject(state, new LiquidationStateConverter(false)));
            }
            parameters.AddOptionalParameter("after", after?.ToString());
            parameters.AddOptionalParameter("before", before?.ToString());
            parameters.AddOptionalParameter("limit", limit.ToString());

            var result = await SendRequestAsync <OkexRestApiResponse <IEnumerable <OkexLiquidationInfo> > >(GetUrl(Endpoints_V5_Public_LiquidationOrders), HttpMethod.Get, ct, parameters).ConfigureAwait(false);

            if (!result.Success)
            {
                return(WebCallResult <IEnumerable <OkexLiquidationInfo> > .CreateErrorResult(result.ResponseStatusCode, result.ResponseHeaders, result.Error));
            }
            if (result.Data.ErrorCode > 0)
            {
                return(WebCallResult <IEnumerable <OkexLiquidationInfo> > .CreateErrorResult(result.ResponseStatusCode, result.ResponseHeaders, new ServerError(result.Data.ErrorCode, result.Data.ErrorMessage, result.Data.Data)));
            }

            return(new WebCallResult <IEnumerable <OkexLiquidationInfo> >(result.ResponseStatusCode, result.ResponseHeaders, result.Data.Data, null));
        }
 /// <summary>
 /// Retrieve position information. Initial snapshot will be pushed according to subscription granularity. Data will be pushed when triggered by events such as placing/canceling order, and will also be pushed in regular interval according to subscription granularity.
 /// </summary>
 /// <param name="instrumentType">Instrument Type</param>
 /// <param name="instrumentId">Instrument ID</param>
 /// <param name="underlying">Underlying</param>
 /// <param name="onData">On Data Handler</param>
 /// <returns></returns>
 public virtual CallResult <UpdateSubscription> SubscribeToPositionUpdates(
     OkexInstrumentType instrumentType,
     string instrumentId,
     string underlying,
     Action <OkexPosition> onData) => SubscribeToPositionUpdates_Async(instrumentType, instrumentId, underlying, onData).Result;
        /// <summary>
        /// The full instrument list will be pushed for the first time after subscription. Subsequently, the instruments will be pushed if there's any change to the instrument’s state (such as delivery of FUTURES, exercise of OPTION, listing of new contracts / trading pairs, trading suspension, etc.).
        /// </summary>
        /// <param name="instrumentType">Instrument Type</param>
        /// <param name="onData">On Data Handler</param>
        /// <returns></returns>
        public virtual async Task <CallResult <UpdateSubscription> > SubscribeToInstruments_Async(OkexInstrumentType instrumentType, Action <OkexInstrument> onData)
        {
            var internalHandler = new Action <DataEvent <OkexSocketUpdateResponse <IEnumerable <OkexInstrument> > > >(data =>
            {
                foreach (var d in data.Data.Data)
                {
                    onData(d);
                }
            });

            var request = new OkexSocketRequest(OkexSocketOperation.Subscribe, "instruments", instrumentType);

            return(await SubscribeAsync(request, null, false, internalHandler).ConfigureAwait(false));
        }
示例#17
0
 public OkexSocketRequest(OkexSocketOperation op, string channel, OkexInstrumentType instrumentType, string underlying)
 {
     Operation = op;
     Arguments = new List <OkexSocketRequestArgument>();
     Arguments.Add(new OkexSocketRequestArgument(channel, instrumentType, underlying));
 }
示例#18
0
        /// <summary>
        /// Get Underlying
        /// </summary>
        /// <param name="instrumentType">Instrument Type</param>
        /// <param name="ct">Cancellation Token</param>
        /// <returns></returns>
        public virtual async Task <WebCallResult <IEnumerable <string> > > GetUnderlying_Async(OkexInstrumentType instrumentType, CancellationToken ct = default)
        {
            if (instrumentType.IsNotIn(OkexInstrumentType.Futures, OkexInstrumentType.Option, OkexInstrumentType.Swap))
            {
                throw new ArgumentException("Instrument Type can be only Futures, Option or Swap.");
            }

            var parameters = new Dictionary <string, object>
            {
                { "instType", JsonConvert.SerializeObject(instrumentType, new InstrumentTypeConverter(false)) },
            };
            var result = await SendRequestAsync <OkexRestApiResponse <IEnumerable <IEnumerable <string> > > >(GetUrl(Endpoints_V5_Public_Underlying), HttpMethod.Get, ct, parameters).ConfigureAwait(false);

            if (!result.Success)
            {
                return(WebCallResult <IEnumerable <string> > .CreateErrorResult(result.ResponseStatusCode, result.ResponseHeaders, result.Error));
            }
            if (result.Data.ErrorCode > 0)
            {
                return(WebCallResult <IEnumerable <string> > .CreateErrorResult(result.ResponseStatusCode, result.ResponseHeaders, new ServerError(result.Data.ErrorCode, result.Data.ErrorMessage, result.Data.Data)));
            }

            return(new WebCallResult <IEnumerable <string> >(result.ResponseStatusCode, result.ResponseHeaders, result.Data.Data.FirstOrDefault(), null));
        }
示例#19
0
 /// <summary>
 /// Retrieve the estimated delivery price, which will only have a return value one hour before the delivery/exercise.
 /// </summary>
 /// <param name="instrumentType">Instrument Type</param>
 /// <param name="underlying">Underlying</param>
 /// <param name="after">Pagination of data to return records earlier than the requested ts, Unix timestamp format in milliseconds, e.g. 1597026383085</param>
 /// <param name="before">Pagination of data to return records newer than the requested ts, Unix timestamp format in milliseconds, e.g. 1597026383085</param>
 /// <param name="limit">Number of results per request. The maximum is 100; the default is 100.</param>
 /// <param name="ct">Cancellation Token</param>
 /// <returns></returns>
 public virtual WebCallResult <IEnumerable <OkexDeliveryExerciseHistory> > GetDeliveryExerciseHistory(OkexInstrumentType instrumentType, string underlying, long?after = null, long?before = null, int limit = 100, CancellationToken ct = default) => GetDeliveryExerciseHistory_Async(instrumentType, underlying, after, before, limit, ct).Result;
 /// <summary>
 /// Retrieve advance algo orders (includes iceberg order and twap order). Data will be pushed when first subscribed. Data will be pushed when triggered by events such as placing/canceling order.
 /// </summary>
 /// <param name="instrumentType">Instrument Type</param>
 /// <param name="instrumentId">Instrument ID</param>
 /// <param name="underlying">Underlying</param>
 /// <param name="onData">On Data Handler</param>
 /// <returns></returns>
 public virtual CallResult <UpdateSubscription> SubscribeToAdvanceAlgoOrderUpdates(
     OkexInstrumentType instrumentType,
     string instrumentId,
     string underlying,
     Action <OkexAlgoOrder> onData) => SubscribeToAdvanceAlgoOrderUpdates_Async(instrumentType, instrumentId, underlying, onData).Result;