Browse Source

Use new generate_payouts API

upload-correct-windows-binary
Lucas Soriano del Pino 3 years ago
parent
commit
fdd41c9c37
No known key found for this signature in database GPG Key ID: EE611E973A1530E7
  1. 8
      daemon/src/payout_curve.rs

8
daemon/src/payout_curve.rs

@ -2,7 +2,7 @@ use crate::model::{Leverage, Usd};
use anyhow::Result;
use bdk::bitcoin;
use cfd_protocol::interval::MAX_PRICE_DEC;
use cfd_protocol::Payout;
use cfd_protocol::{generate_payouts, Payout};
pub fn calculate(
price: Usd,
@ -12,13 +12,13 @@ pub fn calculate(
) -> Result<Vec<Payout>> {
let dollars = price.try_into_u64()?;
let payouts = vec![
Payout::new(
generate_payouts(
0..=(dollars - 10),
maker_payin + taker_payin,
bitcoin::Amount::ZERO,
)?,
Payout::new((dollars - 10)..=(dollars + 10), maker_payin, taker_payin)?,
Payout::new(
generate_payouts((dollars - 10)..=(dollars + 10), maker_payin, taker_payin)?,
generate_payouts(
(dollars + 10)..=MAX_PRICE_DEC,
bitcoin::Amount::ZERO,
maker_payin + taker_payin,

Loading…
Cancel
Save