Unit ID
ribUruvt0jjtaIc+HQk3ia7WmKvnAT4WmKx7Lpnmbc8=
Received
18.01.2023 16:29:59
Confirmation delay (full node)
3 minutes 23 seconds
Confirmation delay (light node)
5 minutes 14 seconds
Messages
Definition
Definition: [ "autonomous agent", { "doc_url": "https://pyth.ooo/perpetual-factory.json", "init": "{ $base_aa = 'ZUCXQ6TECTAIEI62TDTHHFFRNVZEYSZF'; }", "messages": { "cases": [ { "init": "{ $reserve_asset = trigger.data.reserve_asset OTHERWISE 'base'; if ($reserve_asset != 'base') require(asset[$reserve_asset].exists, "reserve_asset does not exist"); $params = { reserve_asset: $reserve_asset, }; $names = [ 'swap_fee', 'arb_profit_tax', 'adjustment_period', 'presale_period', 'auction_price_halving_period', 'token_share_threshold', 'min_s0_share', ]; foreach($names, 7, $name => { $value = trigger.data[$name]; if (exists($value)) { require(typeof($value) == 'number' AND $value >= 0, $name||" must be a nonnegative number"); if ($name == 'swap_fee' OR $name == 'token_share_threshold' OR $name == 'min_s0_share') // however >100% tax allowed for arb_profit_tax require($value < 1, $name||" must be < 1"); if ($name == 'adjustment_period' OR $name == 'presale_period' OR $name == 'auction_price_halving_period') require(is_integer($value), $name||" must be integer"); $params[$name] = $value; } }); // staking AA params foreach(['challenging_period', 'max_term', 'min_term', 'decay_factor'], 4, $p => { $value = trigger.data[$p]; if (exists($value)) { require(typeof($value) == 'number' AND $value > 0, $p||" must be a positive number"); if ($p == 'challenging_period' OR $p == 'max_term' OR $p == 'min_term') require(is_integer($value), $p||" must be integer"); if ($p == 'decay_factor') require($value > 1, "decay factor must be >1"); $params[$p] = $value; } }); $aa = [ 'autonomous agent', { base_aa: $base_aa, params: $params } ]; $aa_address = chash160($aa); require(!definition[$aa_address], "such an AA already exists: "||$aa_address); }", "messages": [ { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{ $aa_address }", "amount": 5000 } ] } }, { "app": "data", "payload": { "define": 1, "factory": "{this_address}" } }, { "app": "definition", "payload": { "definition": "{$aa}" } }, { "app": "state", "state": "{ var['perp_' || $aa_address] = $params; response['address'] = $aa_address; }" } ] } ] } } ]
Technical information
Fees:
3,123 bytes
(452 headers, 2671 payload)
Level:2954330
Witnessed level:2954322
Main chain index:2929569
Latest included mc index:2929568
Status:stable/confirmed/final