From f4f67d428901dad604af02fd44b1e95a1a4aa770 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Wed, 1 Sep 2021 22:49:42 -0400 Subject: [PATCH] Let the ui convert synth net change to n ticks Whether or not to display a price in dollar or n ticks form is a display setting, and furthermore the front end assumes all prices are in dollar form --- src/lib/md/MDConsumerHandle.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lib/md/MDConsumerHandle.cpp b/src/lib/md/MDConsumerHandle.cpp index 21d5417d4..4f6ea5f9a 100644 --- a/src/lib/md/MDConsumerHandle.cpp +++ b/src/lib/md/MDConsumerHandle.cpp @@ -294,12 +294,9 @@ TimeStamp copy_synthetic_depth( if (synth.security.synthetic().price_calc() == api::SyntheticContract::PRICECALC_NET_CHANGE) { auto settle = synth.legs[x].settlement_price(); - double tick = synth.legs[x].get_minimum_tick(); for (size_t d = 0; d < COCONUT_MAX_DEPTH; ++d) { - auto b = (bids[d] - settle); - auto a = (asks[d] - settle); - bids[d] = {b.int_price() / tick, b.size()}; - asks[d] = {a.int_price() / tick, a.size()}; + bids[d] = {bids[d].int_price() - settle, bids[d].size()}; + asks[d] = {asks[d].int_price() - settle, asks[d].size()}; } }