Unit ID
OK1jGK35tZNr2DcpHLG1ddXTgcco47HuESGn9mjowRI=
Received
23.05.2024 16:23:54
Confirmation delay (full node)
15 minutes 16 seconds
Confirmation delay (light node)
23 minutes 42 seconds
Messages
Payments
AA responses
From WQBLYBRAMJVXDWS7BGTUNUTW2STO6LYP
  • Bounced
  • Response: { "error": "formula { $curve_aa = $get_curve_aa(); $curve_params = definition[params.curve_aa][1].params; // tokens $reserve_asset = $curve_params.reserve_asset OTHERWISE 'base'; $asset1 = var[$curve_aa]['asset1']; $shares_asset = var['shares_asset']; $get_leverage = () => $curve_params.leverage OTHERWISE 0; $dilution_factor = var[$curve_aa]['dilution_factor']; $get_reserve = ($s1, $s2) => { $r = $dilution_factor * $s1^$curve_params.m * $s2^$curve_params.n; $r }; $get_p2 = ($s1, $s2) => { $p2 = $dilution_factor * $s1^$curve_params.m * $curve_params.n * (is_integer($curve_params.n*2) ? sqrt($s2^(($curve_params.n-1)*2)) : $s2^($curve_params.n-1) ); // derivative $p2 }; $get_p1 = () => { $s1 = var[$curve_aa]['supply1']/10^$curve_params.decimals1; $s2 = var[$curve_aa]['supply2']/10^$curve_params.decimals2; $p1_in_full_units = $dilution_factor * $curve_params.m * $s1^($curve_params.m-1) * $s2^$curve_params.n; // derivative $p1_in_smallest_units = $p1_in_full_units * 10^($curve_params.reserve_asset_decimals - $curve_params.decimals1); $p1_in_smallest_units }; $get_oracles = () => { $oracles = var[$curve_aa]['oracles']; if ($oracles) return $oracles; $initial_oracles = []; if ($curve_params.oracle1 AND $curve_params.feed_name1) $initial_oracles[] = {oracle: $curve_params.oracle1, feed_name: $curve_params.feed_name1, op: $curve_params.op1 OTHERWISE '*'}; if ($curve_params.oracle2 AND $curve_params.feed_name2) $initial_oracles[] = {oracle: $curve_params.oracle2, feed_name: $curve_params.feed_name2, op: $curve_params.op2 OTHERWISE '*'}; if ($curve_params.oracle3 AND $curve_params.feed_name3) $initial_oracles[] = {oracle: $curve_params.oracle3, feed_name: $curve_params.feed_name3, op: $curve_params.op3 OTHERWISE '*'}; $initial_oracles }; $get_initial_interest_rate = () => exists($curve_params.interest_rate) ? $curve_params.interest_rate : 0.1; // 10% $get_interest_rate = () => { $interest_rate_var = var[$curve_aa]['interest_rate']; exists($interest_rate_var) ? $interest_rate_var : $get_initial_interest_rate() }; $get_growth_factor = () => { $interest_rate = $get_interest_rate(); $term = (timestamp - var[$curve_aa]['rate_update_ts']) / (360 * 24 * 3600); // in years $growth_factor = var[$curve_aa]['growth_factor'] * (1 + $interest_rate)^$term; $growth_factor }; $get_oracle_price = () => { $oracles = $get_oracles(); $oracle_price = reduce($oracles, 3, ($price, $oracle_info) => { $df = data_feed[[oracles=$oracle_info.oracle, feed_name=$oracle_info.feed_name]]; ($oracle_info.op == '*') ? $price * $df : $price / $df }, 1); $oracle_price }; $get_target_p2 = () => { $target_p2 = $get_oracle_price()^($get_leverage() - 1) * $get_growth_factor(); $target_p2 }; $get_exchange_data = () => { $target_p2 = $get_target_p2(); $s2 = var[$curve_aa]['supply2']/10^$curve_params.decimals2; $target_s1 = ($target_p2/$curve_params.n * $s2^(1-$curve_params.n))^(1/$curve_params.m); $tokens1_delta = round($target_s1 * 10^$curve_params.decimals1) - var[$curve_aa]['supply1']; $new_s1 = (var[$curve_aa]['supply1'] + $tokens1_delta) / 10^$curve_params.decimals1; $reserve_delta = ceil($get_reserve($new_s1, $s2) * 10^$curve_params.reserve_asset_decimals) - var[$curve_aa]['reserve']; // calc the reward $initial_p2 = var[$curve_aa]['p2']; $distance = abs($initial_p2 - $target_p2) / $target_p2; $p2 = $get_p2($new_s1, $s2); // might be slightly different from target_p2 due to limited precision of s1 $new_distance = abs($p2 - $target_p2) / $target_p2; // zero or very close $reward = floor((1 - $new_distance/$distance) * var[$curve_aa]['fast_capacity']); $reserve_needed = $reserve_delta - $reward + ($reserve_asset == 'base' ? 1000 : 0); { tokens1_delta: $tokens1_delta, reserve_delta: $reserve_delta, reserve_needed: $reserve_needed, reward: $reward, } }; $p1 = $get_p1(); $get_total_assets = () => { balance[$reserve_asset] - trigger.output[[asset=$reserve_asset]] + $p1 * (balance[$asset1] - trigger.output[[asset=$asset1]]) }; $get_reserve_share_after = ($delta_reserve, $delta_asset1) => { (balance[$reserve_asset] - $delta_reserve) / (balance[$reserve_asset] - $delta_reserve + $p1 * (balance[$asset1] - $delta_asset1)) }; $status = var['status']; $max_reserve_share = var['max_reserve_share'] OTHERWISE params.max_reserve_share OTHERWISE 1; $min_reserve_share = exists(var['min_reserve_share']) ? var['min_reserve_share'] : (params.min_reserve_share OTHERWISE 0); $triggerer_reward_share = exists(var['triggerer_reward_share']) ? var['triggerer_reward_share'] : (params.triggerer_reward_share OTHERWISE 0); $min_reserve_delta = var['min_reserve_delta'] OTHERWISE params.min_reserve_delta OTHERWISE 1e5; $min_reserve_investment = $reserve_asset == 'base' ? 1e4 : 0; if (trigger.data.to AND !is_valid_address(trigger.data.to)) bounce("bad to address"); $to = trigger.data.to OTHERWISE trigger.address; $governance_base_aa = 'P5CS22H3DNZ35RTY7TFAGRUDQRHRIK7T'; } failed: 1st var name is not a string: false" }
Technical information
Fees:
762 bytes
(451 headers, 311 payload)
Level:11001511
Witnessed level:11001499
Main chain index:10621396
Latest included mc index:10621395
Status:stable/confirmed/final