YIVA2EHCCWC5UQYOIWUY2ALSGPJHFWNM
- MCI: 8994561
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"message": "Added 0.011351197 T2 tokens",
"count1": 14628570422,
"count2": 11351197,
"change1": 156441772,
"change2": 0
}
}
- MCI: 8994518
- 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 ^"
}
- MCI: 8994514
- Not bounced
- Response: {
"responseVars": {
"message": "Added 14.785012194 T1 tokens"
},
"info": "no messages after filtering"
}
Show transactions in assets:
No transactions found, it may be worth changing the filter
Unit ID
Date
From
Direction
To
Amount
06.07.2022 22:48:23
YIVA2EHCCWC5UQYOIWUY2ALSGPJHFWNM
out
06.07.2022 22:48:23
YIVA2EHCCWC5UQYOIWUY2ALSGPJHFWNM
out
06.07.2022 22:48:23
in
YIVA2EHCCWC5UQYOIWUY2ALSGPJHFWNM
06.07.2022 22:48:23
in
YIVA2EHCCWC5UQYOIWUY2ALSGPJHFWNM
06.07.2022 22:26:51
YIVA2EHCCWC5UQYOIWUY2ALSGPJHFWNM
out
06.07.2022 22:26:51
in
YIVA2EHCCWC5UQYOIWUY2ALSGPJHFWNM
06.07.2022 22:26:51
in
YIVA2EHCCWC5UQYOIWUY2ALSGPJHFWNM
06.07.2022 22:24:41
in
YIVA2EHCCWC5UQYOIWUY2ALSGPJHFWNM
06.07.2022 22:24:41
in
YIVA2EHCCWC5UQYOIWUY2ALSGPJHFWNM