Skip to content

Commit

Permalink
Use AI for home stats calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Groxan committed May 31, 2024
1 parent 60ab3ad commit 9f46ff2
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 60 deletions.
2 changes: 1 addition & 1 deletion Tzkt.Api/Controllers/RewardsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public Task<RewardSplit> GetRewardSplit([Required][TzAddress] string baker, [Min
/// Get reward split delegator
/// </summary>
/// <remarks>
/// Returns delegator from the reward split for the specified cycle.
/// Returns delegator/staker from the reward split for the specified cycle.
/// </remarks>
/// <param name="baker">Baker address</param>
/// <param name="cycle">Reward split cycle</param>
Expand Down
2 changes: 1 addition & 1 deletion Tzkt.Api/Models/Baking/Cycle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public class Cycle
/// <summary>
/// [DEPRECATED]
/// </summary>
public long LBSubsidy => 1249999;
public long LBSubsidy => 833_333;

/// <summary>
/// [DEPRECATED]
Expand Down
2 changes: 1 addition & 1 deletion Tzkt.Api/Models/Baking/RewardSplit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public class RewardSplit
public long NonceRevelationLosses { get; set; }

/// <summary>
/// List of delegators at the snapshot time
/// List of delegators (including stakers) at the snapshot time
/// </summary>
public IEnumerable<SplitDelegator> Delegators { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion Tzkt.Api/Models/ProtocolConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public class ProtocolConstants
/// <summary>
/// [DEPRECATED]
/// </summary>
public int LBSubsidy => 80_000_000 * TimeBetweenBlocks / 60 / 16;
public int LBSubsidy => 5_000_000 * TimeBetweenBlocks / 60;

/// <summary>
/// [DEPRECATED]
Expand Down
4 changes: 2 additions & 2 deletions Tzkt.Api/Repositories/CyclesRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public async Task<object[][]> Get(
break;
case "lbSubsidy":
foreach (var row in rows)
result[j++][i] = 1249999;
result[j++][i] = 833_333;
break;
case "totalDelegated":
foreach (var row in rows)
Expand Down Expand Up @@ -360,7 +360,7 @@ public async Task<object[]> Get(
break;
case "lbSubsidy":
foreach (var row in rows)
result[j++] = 1249999;
result[j++] = 833_333;
break;
case "totalDelegated":
foreach (var row in rows)
Expand Down
117 changes: 69 additions & 48 deletions Tzkt.Api/Services/Home/HomeService.cs

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions Tzkt.Api/Swagger/WsSubscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,7 @@ Sends operations of specified types or related to specified accounts, included i
// (can be used with 'transaction', 'origination', 'delegation' types only)

types: '' // comma-separated list of operation types, any of:
// 'transaction', 'origination', 'delegation', 'reveal', 'register_constant', 'set_deposits_limit', 'increase_paid_storage'
// 'update_consensus_key', 'tx_rollup_origination', 'tx_rollup_submit_batch', 'tx_rollup_commit', 'tx_rollup_return_bond',
// 'tx_rollup_finalize_commitment', 'tx_rollup_remove_commitment', 'tx_rollup_rejection', 'tx_rollup_dispatch_tickets',
// 'transfer_ticket', `sr_add_messages`, `sr_cement`, `sr_execute`, `sr_originate`, `sr_publish`, `sr_recover_bond`, `sr_refute`,
// 'double_baking', 'double_endorsing', 'double_preendorsing', 'nonce_revelation', 'vdf_revelation', 'activation', 'drain_delegate',
// 'proposal', 'ballot', 'endorsement', 'preendorsement'.
// 'transaction', 'origination', 'delegation', 'reveal', etc.
}
````
Expand Down

0 comments on commit 9f46ff2

Please sign in to comment.