From fdd41c9c375004445645edb8143215a40ef8ada4 Mon Sep 17 00:00:00 2001 From: Lucas Soriano del Pino Date: Wed, 6 Oct 2021 12:42:29 +1100 Subject: [PATCH] Use new generate_payouts API --- daemon/src/payout_curve.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon/src/payout_curve.rs b/daemon/src/payout_curve.rs index bb370f1..4361989 100644 --- a/daemon/src/payout_curve.rs +++ b/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> { 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,