Browse Source

Merge #332

332: Provide margin of counterparty r=bonomat a=bonomat

Very useful for the maker.

Not shown in the UI for now. 

Co-authored-by: Philipp Hoenisch <philipp@hoenisch.at>
refactor/no-log-handler
bors[bot] 3 years ago
committed by GitHub
parent
commit
6f448f3c76
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      daemon/src/to_sse_event.rs

3
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,
}
})

Loading…
Cancel
Save