diff --git a/src/sdk/Dockerfile b/src/sdk/Dockerfile index 3da602c57..3da5c5045 100644 --- a/src/sdk/Dockerfile +++ b/src/sdk/Dockerfile @@ -12,19 +12,22 @@ env SDK_ROOT=/sdk \ SDK_VERSION=$SDK_VERSION \ SDK_BUILD_DATE=$SDK_BUILD_DATE -# copy sdk -COPY include/ /sdk/include/ -COPY lib/ /sparkbin/ -COPY externals /sdk/externals/ -COPY spark.conf /sparkdata/conf/ -COPY futures.coconut /sparkdata/data/replay/futures.coconut - # add user bts RUN groupadd --gid 1000 $USERNAME && \ useradd -s /bin/bash --uid 1000 --gid 1000 -m $USERNAME && \ + mkdir -p /sparkbin/plugins && \ + mkdir /sparkdata && \ ln -s /sparkbin/ sdk/lib && \ echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME && \ chmod 0440 /etc/sudoers.d/$USERNAME && \ chown -R bts.bts /sparkbin/plugins && \ chown -R bts.bts /sparkdata +# copy sdk +COPY include/ /sdk/include/ +COPY lib/ /sparkbin/ +COPY externals /sdk/externals/ +COPY spark.conf /sparkdata/conf/ +COPY --chown=$USERNAME futures.coconut /sparkdata/data/replay/futures.coconut + + diff --git a/src/server/sparkd/md/platforms/ice_onixs/ICEListener.h b/src/server/sparkd/md/platforms/ice_onixs/ICEListener.h index b73cf1c49..cd7001d41 100644 --- a/src/server/sparkd/md/platforms/ice_onixs/ICEListener.h +++ b/src/server/sparkd/md/platforms/ice_onixs/ICEListener.h @@ -212,30 +212,32 @@ void ICEListener::on_uds_future_spread(const Definition& def, bool& is_intereste fsec.alt_symbol(def.strategySymbol); const auto& legs = def.legs; - fsec.set_leg_count(legs.size()); - for(size_t x = 0; x < fsec.leg_count(); ++x) - { - const auto& leg = legs[x]; - if(leg.ratioPriceNumerator && leg.ratioPriceDenominator) + if (legs.size() > 0) { + fsec.set_leg_count(legs.size()); + for(size_t x = 0; x < fsec.leg_count(); ++x) { - auto num = *leg.ratioPriceNumerator; - auto denom = *leg.ratioPriceDenominator; - fsec.legs[x].leg_price = num / (double) denom; + const auto& leg = legs[x]; + if(leg.ratioPriceNumerator && leg.ratioPriceDenominator) + { + auto num = *leg.ratioPriceNumerator; + auto denom = *leg.ratioPriceDenominator; + fsec.legs[x].leg_price = num / (double) denom; + } + if(leg.ratioQtyNumerator && leg.ratioQtyDenominator) + { + auto num = *leg.ratioQtyNumerator; + auto denom = *leg.ratioQtyDenominator; + fsec.legs[x].leg_delta = num / (double) denom; + } + + fsec.legs[x].leg_quantity = leg.ratio; + fsec.legs[x].leg_side = leg.side == onixs_ice::Side::Bid ? api::SIDE_BUY : api::SIDE_SELL; + fsec.legs[x].exchange_key = ExchangeKey(leg.marketId); + fsec.legs[x].key = invalid_security_key; } - if(leg.ratioQtyNumerator && leg.ratioQtyDenominator) - { - auto num = *leg.ratioQtyNumerator; - auto denom = *leg.ratioQtyDenominator; - fsec.legs[x].leg_delta = num / (double) denom; - } - - fsec.legs[x].leg_quantity = leg.ratio; - fsec.legs[x].leg_side = leg.side == onixs_ice::Side::Bid ? api::SIDE_BUY : api::SIDE_SELL; - fsec.legs[x].exchange_key = ExchangeKey(leg.marketId); - fsec.legs[x].key = invalid_security_key; + add_security(fsec); + is_interested = true; } - add_security(fsec); - is_interested = true; }