Unit ID
UV3Xw/tRUxWU+6gKtd/olqMRMmcKsr0enlc1o1MOkHI=
Received
06.07.2022 22:26:51
Confirmation delay (full node)
14 minutes 9 seconds
Messages
Data
curve_address: AXN2FCEZNDS3THORLZW4IUHU7MESLLPC
AA responses
From YIVA2EHCCWC5UQYOIWUY2ALSGPJHFWNM
  • Bounced
  • Response unit:
  • Response: { "error": "formula if(!exists(var[$curve_address]['p2'])) bounce('p2 not initialized'); $canBeDone = balance[$asset1] > 0 AND balance[$asset2] > 0; $curve_params = definition[$curve_address][1].params; if(trigger.output[[asset=$asset1]] > 0){ response['message'] = "Added " || (trigger.output[[asset=$asset1]] / 10^$curve_params.decimals1) || " T1 tokens"; } if (trigger.output[[asset=$asset2]] > 0){ response['message'] = "Added " || (trigger.output[[asset=$asset2]] / 10^$curve_params.decimals2) || " T2 tokens"; } if($canBeDone){ $initial_p2 = var[$curve_address]['p2']; $dilution_factor = var[$curve_address]['dilution_factor']; $m = $curve_params.m; $n = $curve_params.n; $auto_withdraw = trigger.data.auto_withdraw; $p2 = var[$curve_address]['p2']; $new_supply1 = var[$curve_address]['supply1'] - balance[$asset1]; $new_supply2 = var[$curve_address]['supply2'] - balance[$asset2]; $s1 = $new_supply1 / 10^$curve_params.decimals1; $s2 = $new_supply2 / 10^$curve_params.decimals2; $expectT1 = (($p2 / ($dilution_factor * $n * (is_integer($n*2) ? sqrt($s2^(($n-1)*2)) : $s2^($n-1))))^(1 / $m)) - (var[$curve_address]['supply1'] / 10^$curve_params.decimals1); $expectT2 = (($p2 / ($dilution_factor * ($s1^$m) * $n)) ^ (1 / ($n - 1))) - var[$curve_address]['supply2'] / 10 ^ $curve_params.decimals2; $expectT1WithoutDecimals = abs(round($expectT1 * 10^$curve_params.decimals1)); $expectT2WithoutDecimals = abs(round($expectT2 * 10^$curve_params.decimals2)); if(abs($expectT2WithoutDecimals) < balance[$asset2]) { $count1 = balance[$asset1]; $count2 = $expectT2WithoutDecimals; $change1 = 0; $change2 = balance[$asset2] - $count2; } else if(abs($expectT1WithoutDecimals) < balance[$asset1]){ $count1 = $expectT1WithoutDecimals; $count2 = balance[$asset2]; $change1 = balance[$asset1] - $count1; $change2 = 0; } else { bounce("Couldn't calculate optimal quantity"); } response['count1'] = $count1; response['count2'] = $count2; response['change1'] = $change1; response['change2'] = $change2; } failed: not finite in ^" }
Technical information
Fees:
1,376 bytes
(451 headers, 925 payload)
Level:9351396
Witnessed level:9351384
Main chain index:8994518
Latest included mc index:8994517
Status:stable/confirmed/final