Unit ID
7W1cEWtJGTFxUcXSn0E4tphp5KFHbMqit/It0iBO5r4=
Received
29.08.2025 15:04:26
Confirmation delay (full node)
6 minutes 9 seconds
Confirmation delay (light node)
10 minutes 18 seconds
Messages
Definition
Definition: [ "autonomous agent", { "getters": "{ $locked_reward_share = 0.01; $liquid_reward_share = 0.001; $deposit_asset_reducer = 0.5; $bytes_reducer = 0.75; $new_user_reward = 10e9; $referral_reward = 10e9; $balance_cap = 200e9; $get_period = ($days_old, $fu_addition_days) => { $res = {period: 1}; foreach($fu_addition_days, 7, ($index, $day) => { if ($days_old > +$day) $res.period = $index + 2; }); $res.period }; $is_eligible_for_infriends = ($address, $user, $ceiling_price, $followup_reward_days) => { $days_old = floor((timestamp - $user.reg_ts)/24/3600); $fu_addition_days = keys($followup_reward_days); $period = $get_period($days_old, $fu_addition_days); $days_old % $period == 0 }; // either one of the users is new or both are allowed to make in-friends today $are_eligible = ($address1, $address2, $user1, $user2, $ceiling_price, $followup_reward_days) => { $bNewUser = !$user1.last_date OR !$user2.last_date; { user1_eligible: $bNewUser OR $is_eligible_for_infriends($address1, $user1, $ceiling_price, $followup_reward_days), user2_eligible: $bNewUser OR $is_eligible_for_infriends($address2, $user2, $ceiling_price, $followup_reward_days), } }; // exchange rate in bytes $get_deposit_asset_exchange_rate = ($friends_aa, $asset) => { $aa = var[$friends_aa]['deposit_asset_'||$asset]; require($aa, "unknown deposit asset"); $params = definition[$aa][1].params; $bX = $params.x_asset == $asset AND $params.y_asset == 'base'; $bY = $params.x_asset == 'base' AND $params.y_asset == $asset; require($bX OR $bY, "deposit asset must be one of the pool's assets and the other asset must be GBYTE"); $recent = var[$aa]['recent']; require($recent AND $recent.current AND $recent.prev, "no recent state of the pool"); $pmax = max($recent.current.pmax, $recent.prev.pmax); $pmin = min($recent.current.pmin, $recent.prev.pmin); require($pmin > 0 AND $pmax > 0, "pmin and pmax must be > 0"); $bX ? $pmin : 1/$pmax }; $get_total_balance = ($balances, $ceiling_price, $friends_aa) => { $totals = {in_bytes: $balances.base * $bytes_reducer}; $asset_balances = filter($balances, 5, ($a, $balance) => $a != 'base' AND $a != 'frd'); foreach($asset_balances, 3, ($a, $balance) => { $totals.in_bytes = $totals.in_bytes + $balance * $get_deposit_asset_exchange_rate($friends_aa, $a) * $deposit_asset_reducer; }); $balances.frd + $totals.in_bytes / $ceiling_price }; $get_rewards = ($address1, $address2, $user1, $user2, $ceiling_price, $friends_aa, $bFollowup) => { $total_balance1 = $get_total_balance($user1.balances, $ceiling_price, $friends_aa); $total_balance2 = $get_total_balance($user2.balances, $ceiling_price, $friends_aa); $bNewUser = !$user1.last_date OR !$user2.last_date; $capped_total_balance1 = $bNewUser ? $total_balance1 : min($total_balance1, $balance_cap); $capped_total_balance2 = $bNewUser ? $total_balance2 : min($total_balance2, $balance_cap); $rewards = { user1: { locked: floor($capped_total_balance1 * $locked_reward_share), liquid: floor($capped_total_balance1 * $liquid_reward_share), }, user2: { locked: floor($capped_total_balance2 * $locked_reward_share), liquid: floor($capped_total_balance2 * $liquid_reward_share), }, }; if (!$user1.last_date) $rewards.user1.is_new = true; if (!$user2.last_date) $rewards.user2.is_new = true; if ($bNewUser){ $capped_new_user_reward = floor(min($new_user_reward, $total_balance1, $total_balance2)); $rewards.user1.locked = $rewards.user1.locked + $capped_new_user_reward; $rewards.user1.new_user_reward = $capped_new_user_reward; $rewards.user2.locked = $rewards.user2.locked + $capped_new_user_reward; $rewards.user2.new_user_reward = $capped_new_user_reward; } if (!$user1.last_date AND $user1.ref){ $capped_referral_reward1 = min($referral_reward, floor($total_balance1)); $rewards.user1.referred_user_reward = $capped_referral_reward1; $rewards.user1.locked = $rewards.user1.locked + $capped_referral_reward1; // $rewards.user1.referrer = {address: $user1.ref, reward: $capped_referral_reward1}; $rewards.referrers[$user1.ref] = $capped_referral_reward1; } if (!$user2.last_date AND $user2.ref){ $capped_referral_reward2 = min($referral_reward, floor($total_balance2)); $rewards.user2.referred_user_reward = $capped_referral_reward2; $rewards.user2.locked = $rewards.user2.locked + $capped_referral_reward2; // $rewards.user2.referrer = {address: $user2.ref, reward: $capped_referral_reward2}; $rewards.referrers[$user2.ref] = $capped_referral_reward2 + $rewards.referrers[$user2.ref]; // might be the same referrer for both users } $rewards }; }", "messages": [ { "app": "state", "state": "{ $get_rewards(); bounce("library only"); }" } ] } ]
Technical information
Fees:
5,688 bytes
(406 headers, 5282 payload)
TPS fee:
0 bytes
Actual TPS fee:
0 bytes
Level:3769369
Witnessed level:3769360
Main chain index:3742505
Latest included mc index:3742504
Status:stable/confirmed/final