Unit ID
Xftc0h718SapvhBXyxnv9pK4fVzk0MClBQVTw5sA+Tw=
Received
25.12.2024 09:02:47
Confirmation delay (full node)
6 minutes 5 seconds
Confirmation delay (light node)
8 minutes 9 seconds
Messages
Definition
Definition: [ "autonomous agent", { "messages": { "cases": [ { "if": "{ $define_usd = trigger.data.define_usd AND !var['usd_asset']; $define_www = trigger.data.define_www AND !var['www_asset']; if ($define_usd AND $define_www) bounce("can't define both assets at the same time"); $define_usd OR $define_www }", "messages": [ { "app": "asset", "payload": { "is_private": false, "is_transferrable": true, "auto_destroy": false, "fixed_denominations": false, "issued_by_definer_only": true, "cosigned_by_definer": false, "spender_attested": false } }, { "app": "state", "state": "{ $asset = $define_usd ? 'usd_asset' : 'www_asset'; var[$asset] = response_unit; response[$asset] = response_unit; }" } ] }, { "if": "{trigger.output[[asset=base]] >= 1e5 AND var['usd_asset'] AND var['www_asset']}", "messages": [ { "app": "payment", "payload": { "asset": "{var['usd_asset']}", "outputs": [ { "address": "{trigger.address}", "amount": "{ trigger.output[[asset=base]] }" } ] } }, { "app": "payment", "payload": { "asset": "{var['www_asset']}", "outputs": [ { "address": "{trigger.address}", "amount": "{ trigger.output[[asset=base]] }" } ] } } ] }, { "if": "{ trigger.data.blackswan AND !var['blackswan'] AND data_feed[[oracles='X55IWSNMHNDUIYKICDW3EOYAWHRUKANP', feed_name='WWW_USD']] < 0.50 AND timestamp < 1556668800 }", "messages": [ { "app": "state", "state": "{ var['blackswan'] = 1; response['blackswan'] = 1; }" } ] }, { "if": "{ if (trigger.output[[asset!=base]].asset == 'none') return false; $www_asset_amount = trigger.output[[asset=var['www_asset']]]; $usd_asset_amount = trigger.output[[asset=var['usd_asset']]]; if ($www_asset_amount < 1e4 AND $usd_asset_amount < 1e4) return false; if ($www_asset_amount == $usd_asset_amount){ // helps in case the exchange rate is never posted $bytes = $www_asset_amount; return true; } if (var['blackswan']) $bytes = $usd_asset_amount; else{ if (timestamp < 1556668800) bounce('wait for maturity date'); // data_feed will abort if the exchange rate not posted yet $exchange_rate = data_feed[[oracles='X55IWSNMHNDUIYKICDW3EOYAWHRUKANP', feed_name='WWW_USD']]; $bytes_per_usd_asset = min(10/$exchange_rate/2, 1); $bytes_per_www_asset = 1 - $bytes_per_usd_asset; $bytes = round($bytes_per_usd_asset * $usd_asset_amount + $bytes_per_www_asset * $www_asset_amount); } true }", "messages": [ { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{trigger.address}", "amount": "{ $bytes }" } ] } } ] } ] } } ]
Technical information
Fees:
3,066 bytes
(406 headers, 2660 payload)
TPS fee:
0 bytes
Actual TPS fee:
0 bytes
Level:3614424
Witnessed level:3614417
Main chain index:3587576
Latest included mc index:3587575
Status:stable/confirmed/final