Fix: undo special case for btc swap and add ccp for swaps
This commit is contained in:
1 parent
bc6eb59110
commit
5ba7901258
1 file changed
+9
-8
@@ -1,8 +1,9 @@
|
||||
#include "OkxInstrumentStore.h"
|
||||
#include "lib/api/domain/SecurityType.h"
|
||||
#include "lib/core/TimeStamp.h"
|
||||
#include "lib/domain/Security.h"
|
||||
#include "lib/api/domain/SecurityType.h"
|
||||
#include "lib/domain_model/Security.pb.h"
|
||||
#include "lib/logging/Common.h"
|
||||
#include "lib/logging/logging.h"
|
||||
#include "lib/persistence/IDGenerator.h"
|
||||
#include "lib/utils/bts_fatal.h"
|
||||
@@ -11,6 +12,8 @@
|
||||
|
||||
#include <ccapi_cpp/ccapi_message.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
@@ -53,13 +56,11 @@ static void instrument_to_sec(const OkxInstrument &oi, Security &sec) {
|
||||
case bts::md::okx::OkxInstrumentType::SWAP:{
|
||||
auto &fut = sec.security.emplace<FutureSecurity>();
|
||||
core::TimeStamp::from_ymd(3000, 1, 1,&fut.expiration);
|
||||
if(oi.instId.find("USDT")!=std::string::npos || oi.instId.find("USDC")!=std::string::npos){
|
||||
sec.security_common.symbol = oi.instId.substr(0,oi.instId.find_first_of("-"));
|
||||
//tickSz 0.1, lotSz 0.01, minSz = 0.01
|
||||
if(oi.instId.find("BTC")!=std::string::npos){// so that config overrides them
|
||||
scomm.min_quantity = 0;
|
||||
scomm.min_quantity_increment = 0;
|
||||
}
|
||||
if (oi.instId.find("USDT") != std::string::npos ||
|
||||
oi.instId.find("USDC") != std::string::npos) {
|
||||
sec.security_common.symbol =
|
||||
oi.instId.substr(0, oi.instId.find_first_of("-"));
|
||||
scomm.cash_per_point = oi.ctVal;
|
||||
break;
|
||||
}
|
||||
sec.security_common.symbol = oi.settleCcy;
|
||||
|
||||
Reference in new issue
Block a user