OKEx.Net
Open source .Net API wrapper for the @OKEx V5 Rest API and V5 Websocket API
Install / Use
/learn @burakoner/OKEx.NetREADME
Critical Announcement
It's highly recommended to migrate to OKX.Api in order to get next updates and avoid from CryptoExchange.Net derived errors. It's available on both Github and Nuget
Github Repository: https://github.com/burakoner/OKX.Api
Nuget Package: https://www.nuget.org/packages/OKX.Api
OKEx.Net
A .Net wrapper for the OKEx API as described on OKEx, including all features the API provides using clear and readable objects.
If you think something is broken, something is missing or have any questions, please open an Issue
CryptoExchange.Net
Implementation is build upon the CryptoExchange.Net library, make sure to also check out the documentation on that: docs
My CryptoExchange.Net implementations:
<table> <tr> <td>![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
JKorf CryptoExchange.Net implementations:
<table> <tr> <td>![]()
![]()
![]()
![]()
![]()
![]()
![]()
Implementations from third parties:
<table> <tr> <td>![]()
![]()
![]()
![]()
![]()

Donations
Donations are greatly appreciated and a motivation to keep improving.
BTC: 33WbRKqt7wXARVdAJSu1G1x3QnbyPtZ2bH
ETH: 0x65b02db9b67b73f5f1e983ae10796f91ded57b64
Installation
Available on Nuget.
PM> Install-Package OKEx.Net
To get started with OKEx.Net first you will need to get the library itself. The easiest way to do this is to install the package into your project using NuGet. Using Visual Studio this can be done in two ways.
Using the package manager
In Visual Studio right click on your solution and select 'Manage NuGet Packages for solution...'. A screen will appear which initially shows the currently installed packages. In the top bit select 'Browse'. This will let you download net package from the NuGet server. In the search box type 'OKEx.Net' and hit enter. The OKEx.Net package should come up in the results. After selecting the package you can then on the right hand side select in which projects in your solution the package should install. After you've selected all project you wish to install and use OKEx.Net in hit 'Install' and the package will be downloaded and added to you projects.
Using the package manager console
In Visual Studio in the top menu select 'Tools' -> 'NuGet Package Manager' -> 'Package Manager Console'. This should open up a command line interface. On top of the interface there is a dropdown menu where you can select the Default Project. This is the project that OKEx.Net will be installed in. After selecting the correct project type Install-Package OKEx.Net in the command line interface. This should install the latest version of the package in your project.
After doing either of above steps you should now be ready to actually start using OKEx.Net.
Getting started
After installing it's time to actually use it. To get started we have to add the OKEx.Net namespace: using Okex.Net;.
OKEx.Net provides two clients to interact with the OKEx API. The OkexClient provides all rest API calls. The OkexSocketClient provides functions to interact with the websocket provided by the OKEx API. Both clients are disposable and as such can be used in a usingstatement.
Rest Api Examples
Public Endpoints (Unsigned)
OkexClient api = new OkexClient();
var public_01 = api.GetInstruments(OkexInstrumentType.Spot);
var public_02 = api.GetInstruments(OkexInstrumentType.Margin);
var public_03 = api.GetInstruments(OkexInstrumentType.Swap);
var public_04 = api.GetInstruments(OkexInstrumentType.Futures);
var public_05 = api.GetInstruments(OkexInstrumentType.Option, "USD");
var public_06 = api.GetDeliveryExerciseHistory(OkexInstrumentType.Futures, "BTC-USD");
var public_07 = api.GetDeliveryExerciseHistory(OkexInstrumentType.Option, "BTC-USD");
var public_08 = api.GetOpenInterests(OkexInstrumentType.Futures);
var public_09 = api.GetOpenInterests(OkexInstrumentType.Option, "BTC-USD");
var public_10 = api.GetOpenInterests(OkexInstrumentType.Swap);
var public_11 = api.GetFundingRates("BTC-USD-SWAP");
var public_12 = api.GetFundingRateHistory("BTC-USD-SWAP");
var public_13 = api.GetLimitPrice("BTC-USD-SWAP");
var public_14 = api.GetOptionMarketData("BTC-USD");
var public_15 = api.GetEstimatedPrice("BTC-USD-211004-41000-C");
var public_16 = api.GetDiscountInfo();
var public_17 = api.GetSystemTime();
var public_18 = api.GetLiquidationOrders(OkexInstrumentType.Futures, underlying: "BTC-USD", alias: OkexInstrumentAlias.Quarter, state: OkexLiquidationState.Unfilled);
var public_19 = api.GetMarkPrices(OkexInstrumentType.Futures);
var public_20 = api.GetPositionTiers(OkexInstrumentType.Futures, OkexMarginMode.Isolated, "BTC-USD");
var public_21 = api.GetInterestRates();
var public_22 = api.GetVIPInterestRates();
var public_23 = api.GetUnderlying(OkexInstrumentType.Futures);
var public_24 = api.GetUnderlying(OkexInstrumentType.Option);
var public_25 = api.GetUnderlying(OkexInstrumentType.Swap);
var public_26 = api.GetInsuranceFund(OkexInstrumentType.Margin, currency:"BTC");
var public_27 = api.UnitConvert( OkexConvertType.CurrencyToContract, instrumentId:"BTC-USD-SWAP", price:35000, size:0.888m);
Market Endpoints (Unsigned)
OkexClient api = new OkexClient();
var market_01 = api.GetTickers(OkexInstrumentType.Spot);
var market_02 = api.GetTicker("BTC-USDT");
var market_03 = api.GetIndexTickers(instrumentId: "BTC-USDT");
var market_04 = api.GetOrderBook("BTC-USDT", 40);
var market_05 = api.GetCandlesticks("BTC-USDT", OkexPeriod.OneHour);
var market_06 = api.GetCandlesticksHistory("BTC-USDT", OkexPeriod.OneHour);
var market_07 = api.GetIndexCandlesticks("BTC-USDT", OkexPeriod.OneHour);
var market_08 = api.GetMarkPriceCandlesticks("BTC-USDT", OkexPeriod.OneHour);
var market_09 = api.GetTrades("BTC-USDT");
var market_10 = api.GetTradesHistory("BTC-USDT");
var market_11 = api.Get24HourVolume();
var market_12 = api.GetOracle();
var market_13 = api.GetIndexComponents("BTC-USDT");
var market_14 = api.GetBlockTickers(OkexInstrumentType.Spot);
var market_15 = api.GetBlockTickers(OkexInstrumentType.Futures);
var market_16 = api.GetBlockTickers(OkexInstrumentType.Option);
var market_17 = api.GetBlockTickers(OkexInstrumentType.Swap);
var market_18 = api.GetBlockTicker("BTC-USDT");
var market_19 = api.GetBlockTrades("BTC-USDT");
**Trading Endpoint
