Skip to content

Commit

Permalink
Check that option is settled before pricing pool
Browse files Browse the repository at this point in the history
  • Loading branch information
tensojka committed Sep 28, 2023
1 parent 7a8d15c commit 3d90007
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contracts/core_amm/liquidity_pool.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ func _get_value_of_pool_position{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*,
return (res = value_of_rest_of_the_pool_);
}

let (current_block_time) = get_block_timestamp();
with_attr error_message("Option is not yet settled, please wait") {
assert_le_felt(current_block_time, option.maturity);
}

let (current_volatility) = get_pool_volatility_auto(lptoken_address, option.maturity, option.strike_price);

with_attr error_message("Failed getting value of position in _get_value_of_pool_position"){
Expand Down

0 comments on commit 3d90007

Please sign in to comment.