Skip to content

Commit

Permalink
change in src/lib.cairo
Browse files Browse the repository at this point in the history
  • Loading branch information
nikanor.goreglyad committed Jul 17, 2024
1 parent 209243f commit 2b13854
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/amm_core/pricing/lookup_table_cdf.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use array::ArrayTrait;
use array::SpanTrait;

fn get_std_normal_cdf_table() -> Array<u128> {
let mut arr = ArrayTrait::new();
let mut arr = ArrayTrait::<u128>::new();
arr.append(9223372036854775808);
arr.append(9238090399336028160);
arr.append(9252808702943967232);
Expand Down Expand Up @@ -4003,5 +4003,6 @@ fn get_std_normal_cdf_table() -> Array<u128> {
arr.append(18446744073709539328);
arr.append(18446744073709539328);
arr.append(18446744073709539328);
arr.append(18446744073709539328)
arr.append(18446744073709539328);
arr
}
3 changes: 2 additions & 1 deletion src/amm_core/pricing/option_pricing.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/lib.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ mod amm_core {
mod fees;
mod option_pricing;
mod option_pricing_helpers;
mod lookup_table_cdf;
}
mod peripheries {
mod view;
Expand Down

0 comments on commit 2b13854

Please sign in to comment.