From 2b13854e0c5dbae61fa343ad7b04d8abad975bf5 Mon Sep 17 00:00:00 2001 From: "nikanor.goreglyad" Date: Wed, 17 Jul 2024 14:38:40 +0200 Subject: [PATCH] change in src/lib.cairo --- src/amm_core/pricing/lookup_table_cdf.cairo | 5 +++-- src/amm_core/pricing/option_pricing.cairo | 3 ++- src/lib.cairo | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/amm_core/pricing/lookup_table_cdf.cairo b/src/amm_core/pricing/lookup_table_cdf.cairo index be0e2c4..a8e2b90 100644 --- a/src/amm_core/pricing/lookup_table_cdf.cairo +++ b/src/amm_core/pricing/lookup_table_cdf.cairo @@ -2,7 +2,7 @@ use array::ArrayTrait; use array::SpanTrait; fn get_std_normal_cdf_table() -> Array { - let mut arr = ArrayTrait::new(); + let mut arr = ArrayTrait::::new(); arr.append(9223372036854775808); arr.append(9238090399336028160); arr.append(9252808702943967232); @@ -4003,5 +4003,6 @@ fn get_std_normal_cdf_table() -> Array { arr.append(18446744073709539328); arr.append(18446744073709539328); arr.append(18446744073709539328); - arr.append(18446744073709539328) + arr.append(18446744073709539328); + arr } diff --git a/src/amm_core/pricing/option_pricing.cairo b/src/amm_core/pricing/option_pricing.cairo index 6fb3a64..b985e88 100644 --- a/src/amm_core/pricing/option_pricing.cairo +++ b/src/amm_core/pricing/option_pricing.cairo @@ -52,6 +52,7 @@ mod OptionPricing { // and that is used for updating prices. // @param x: number in Math64x61 form // @return Returns std normal cdf value in Math64x61 form + fn std_normal_cdf_dep(x: Fixed) -> Fixed { let TWO = FixedTrait::from_unscaled_felt(2); let THREE = FixedTrait::from_unscaled_felt(3); @@ -88,7 +89,7 @@ mod OptionPricing { return (FixedTrait::ONE() - dist_symmetric_value); }; let scaled_x = x * FixedTrait::new(4000, false); - let index_fixed = scaled_x / FixedTrait::new(147573952589676412928, false); // 2^6 + let index_fixed = scaled_x / FixedTrait::new(147573952589676412928, false); // 2^67 let index: usize = index_fixed.try_into().unwrap(); // Ensure index is within bounds diff --git a/src/lib.cairo b/src/lib.cairo index c3cc3d9..b3051fb 100644 --- a/src/lib.cairo +++ b/src/lib.cairo @@ -17,6 +17,7 @@ mod amm_core { mod fees; mod option_pricing; mod option_pricing_helpers; + mod lookup_table_cdf; } mod peripheries { mod view;