Skip to content

Commit fa6a23c

Browse files
Merge pull request #502 from crypto-chassis/develop
Release
2 parents 5e6a6e9 + f39c2dd commit fa6a23c

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Announcement: In Release v6.11.0 we have upgraded kucoin and kucoin-futures API key version from v2 to v3. Thank you.
2-
31
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
42
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
53
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

include/ccapi_cpp/ccapi_macro.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,9 @@
507507
#ifndef CCAPI_EM_POSITION_ASSET
508508
#define CCAPI_EM_POSITION_ASSET "POSITION_ASSET"
509509
#endif
510+
#ifndef CCAPI_EM_POSITION_MARGIN_TYPE
511+
#define CCAPI_EM_POSITION_MARGIN_TYPE "MARGIN_TYPE"
512+
#endif
510513
#ifndef CCAPI_EM_POSITION_COST
511514
#define CCAPI_EM_POSITION_COST "COST"
512515
#endif

include/ccapi_cpp/service/ccapi_execution_management_service_okx.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,11 @@ class ExecutionManagementServiceOkx : public ExecutionManagementService {
327327
Element element;
328328
element.insert(CCAPI_INSTRUMENT, x["instId"].GetString());
329329
element.insert(CCAPI_EM_POSITION_SIDE, x["posSide"].GetString());
330-
std::string availPos = x["availPos"].GetString();
331-
std::string positionQuantity = availPos.empty() ? x["pos"].GetString() : availPos;
330+
std::string positionQuantity = x["pos"].GetString();
332331
element.insert(CCAPI_EM_POSITION_QUANTITY, positionQuantity);
333332
element.insert(CCAPI_EM_POSITION_ASSET, x["posCcy"].GetString());
333+
element.insert(CCAPI_EM_POSITION_MARGIN_TYPE,
334+
std::string(x["mgnMode"].GetString()) == "cross" ? CCAPI_EM_MARGIN_TYPE_CROSS_MARGIN : CCAPI_EM_MARGIN_TYPE_ISOLATED_MARGIN);
334335
element.insert(CCAPI_EM_POSITION_ENTRY_PRICE, x["avgPx"].GetString());
335336
element.insert(CCAPI_EM_POSITION_LEVERAGE, x["lever"].GetString());
336337
elementList.emplace_back(std::move(element));
@@ -606,6 +607,8 @@ class ExecutionManagementServiceOkx : public ExecutionManagementService {
606607
element.insert(CCAPI_EM_POSITION_SIDE, x["posSide"].GetString());
607608
element.insert(CCAPI_EM_POSITION_QUANTITY, x["pos"].GetString());
608609
element.insert(CCAPI_EM_POSITION_ASSET, x["posCcy"].GetString());
610+
element.insert(CCAPI_EM_POSITION_MARGIN_TYPE,
611+
std::string(x["mgnMode"].GetString()) == "cross" ? CCAPI_EM_MARGIN_TYPE_CROSS_MARGIN : CCAPI_EM_MARGIN_TYPE_ISOLATED_MARGIN);
609612
element.insert(CCAPI_EM_POSITION_ENTRY_PRICE, x["avgPx"].GetString());
610613
element.insert(CCAPI_EM_UNREALIZED_PNL, x["upl"].GetString());
611614
elementList.emplace_back(std::move(element));

include/ccapi_cpp/service/ccapi_market_data_service.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,10 +1046,6 @@ class MarketDataService : public Service {
10461046
auto& detail = x.second;
10471047
if (type == MarketDataMessage::DataType::CANDLESTICK) {
10481048
for (auto& y : detail) {
1049-
auto& openPrice = y.at(MarketDataMessage::DataFieldType::OPEN_PRICE);
1050-
auto& highPrice = y.at(MarketDataMessage::DataFieldType::HIGH_PRICE);
1051-
auto& lowPrice = y.at(MarketDataMessage::DataFieldType::LOW_PRICE);
1052-
auto& closePrice = y.at(MarketDataMessage::DataFieldType::CLOSE_PRICE);
10531049
Element element;
10541050
std::string k1(CCAPI_OPEN_PRICE);
10551051
std::string k2(CCAPI_HIGH_PRICE);

0 commit comments

Comments
 (0)