Browse Source
Use new generate_payouts API
upload-correct-windows-binary
Lucas Soriano del Pino
3 years ago
No known key found for this signature in database
GPG Key ID: EE611E973A1530E7
1 changed files with
4 additions and
4 deletions
-
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, |
|
|
|