From e1206d38f07df65fea10df96151d80c9c01dc8ab Mon Sep 17 00:00:00 2001 From: Philipp Hoenisch Date: Fri, 15 Oct 2021 09:44:19 +1100 Subject: [PATCH] Provide margin of counterparty --- daemon/src/to_sse_event.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/src/to_sse_event.rs b/daemon/src/to_sse_event.rs index b5d4601..fb5d26d 100644 --- a/daemon/src/to_sse_event.rs +++ b/daemon/src/to_sse_event.rs @@ -26,6 +26,8 @@ pub struct Cfd { #[serde(with = "::bdk::bitcoin::util::amount::serde::as_btc")] pub margin: Amount, + #[serde(with = "::bdk::bitcoin::util::amount::serde::as_btc")] + pub margin_counterparty: Amount, #[serde(with = "::bdk::bitcoin::util::amount::serde::as_btc")] pub profit_btc: SignedAmount, @@ -257,6 +259,7 @@ impl ToSseEvent for CfdsWithAuxData { // TODO: Depending on the state the margin might be set (i.e. in Open we save it // in the DB internally) and does not have to be calculated margin: cfd.margin().unwrap(), + margin_counterparty: cfd.counterparty_margin().unwrap(), details, } })