Skip to content

Commit 1625f49

Browse files
tokenomics: scale reward units to atom precision.
Use 1 KAT = 1_000_000_000 atoms in runtime/reward defaults so producer and waiting-pool payouts do not floor to zero under deterministic integer splits. Align RPC/doc surfaces and the warmup reward test with the updated unit scale. Made-with: Cursor
1 parent cd27571 commit 1625f49

7 files changed

Lines changed: 21 additions & 7 deletions

File tree

crates/catalyst-cli/src/node.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ const META_PROTOCOL_NETWORK_ID: &str = "protocol:network_id";
210210
const META_PROTOCOL_GENESIS_HASH: &str = "protocol:genesis_hash";
211211

212212
// Tokenomics v1 constants (aligned with docs/tokenomics-spec.md).
213-
const TOKENOMICS_BLOCK_REWARD_ATOMS: u64 = 1;
213+
// 1 KAT = 1_000_000_000 atoms so reward splits don't floor to zero.
214+
const TOKENOMICS_BLOCK_REWARD_ATOMS: u64 = 1_000_000_000;
214215
const TOKENOMICS_FEE_BURN_BPS: u64 = 7_000;
215216
const TOKENOMICS_FEE_TO_REWARD_POOL_BPS: u64 = 3_000;
216217
const TOKENOMICS_FEE_TO_TREASURY_BPS: u64 = 0;
@@ -318,7 +319,15 @@ mod tokenomics_tests {
318319
distribute_waiting_pool_rewards_and_fee_credits(&store, &mk_lsu(at)).await;
319320
let bal_at = get_fee_credit_balance_u64(&store, &worker).await;
320321
assert_eq!(bal_at, TOKENOMICS_FEE_CREDITS_ACCRUAL_ATOMS_PER_DAY);
321-
assert_eq!(get_balance_i64(&store, &worker).await, bal0.saturating_add(1));
322+
let reward_from_fees = 10u64.saturating_mul(TOKENOMICS_FEE_TO_REWARD_POOL_BPS) / 10_000;
323+
let expected_waiting_reward = TOKENOMICS_BLOCK_REWARD_ATOMS
324+
.saturating_add(reward_from_fees)
325+
.saturating_mul(TOKENOMICS_WAITING_POOL_REWARD_BPS)
326+
/ 10_000;
327+
assert_eq!(
328+
get_balance_i64(&store, &worker).await,
329+
bal0.saturating_add(expected_waiting_reward as i64)
330+
);
322331
}
323332

324333
#[tokio::test]

crates/catalyst-consensus/src/phases.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,8 @@ pub struct RewardConfig {
11121112
impl Default for RewardConfig {
11131113
fn default() -> Self {
11141114
Self {
1115-
block_reward: 1,
1115+
// 1 KAT in atom units (1 KAT = 1_000_000_000 atoms).
1116+
block_reward: 1_000_000_000,
11161117
fee_to_reward_pool_bps: 3000,
11171118
producer_set_reward_bps: 7000,
11181119
waiting_pool_reward_bps: 3000,

crates/catalyst-rpc/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ const META_PROTOCOL_CHAIN_ID: &str = "protocol:chain_id";
2222
const META_PROTOCOL_NETWORK_ID: &str = "protocol:network_id";
2323
const META_PROTOCOL_GENESIS_HASH: &str = "protocol:genesis_hash";
2424
const META_SNAPSHOT_LATEST: &str = "snapshot:latest";
25-
const TOKENOMICS_BLOCK_REWARD_ATOMS: u64 = 1;
25+
// 1 KAT = 1_000_000_000 atoms.
26+
const TOKENOMICS_BLOCK_REWARD_ATOMS: u64 = 1_000_000_000;
2627
const TOKENOMICS_FEE_BURN_BPS: u64 = 7_000;
2728
const TOKENOMICS_FEE_TO_REWARD_POOL_BPS: u64 = 3_000;
2829
const TOKENOMICS_FEE_TO_TREASURY_BPS: u64 = 0;

docs/tokenomics-explainer-handoff.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Catalyst v1 uses a fair-launch model with `0 KAT` at genesis and fixed issuance
2323

2424
- `genesis_supply = 0 KAT`
2525
- `fixed_block_reward = 1 KAT` per successful cycle
26+
- `atoms_per_kat = 1_000_000_000`
2627
- `cycle_target = 20s`
2728
- `fee_burn_bps = 7000` (70%)
2829
- `fee_to_reward_pool_bps = 3000` (30%)

docs/tokenomics-model.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ It does **not** define future adaptive/dynamic monetary policy.
2626
- **Issuance start**: first successful cycle after genesis
2727
- **Cycle target**: `20 seconds`
2828
- **Fixed block reward**: `1 KAT` per successful cycle
29+
- **Unit scale**: `1 KAT = 1_000_000_000 atoms`
2930

3031
Rationale:
3132

@@ -46,7 +47,7 @@ Per successful cycle:
4647
### Parameters
4748

4849
- `fee_burn_bps = 7000` (70% of fees)
49-
- `block_reward_atoms = 1`
50+
- `block_reward_atoms = 1_000_000_000`
5051
- `fee_to_reward_pool_bps = 3000` (30% of fees)
5152
- `fee_to_treasury_bps = 0`
5253
- `producer_set_reward_bps = 7000`

docs/tokenomics-spec.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ If you are writing long-form/public docs, use `docs/tokenomics-model.md` as the
1111
- No premine / no token sale
1212
- Issuance starts on successful post-genesis cycles
1313
- Fixed issuance: `1 KAT` per successful cycle
14+
- Unit scale: `1 KAT = 1_000_000_000 atoms`
1415
- Reward split includes:
1516
- selected producer set
1617
- eligible waiting worker pool
@@ -31,7 +32,7 @@ If you are writing long-form/public docs, use `docs/tokenomics-model.md` as the
3132

3233
- `crates/catalyst-consensus/src/phases.rs`
3334
- `RewardConfig` defaults:
34-
- `block_reward = 1`
35+
- `block_reward = 1_000_000_000` (1 KAT in atoms)
3536
- `fee_to_reward_pool_bps = 3000`
3637
- `producer_set_reward_bps = 7000`
3738
- `waiting_pool_reward_bps = 3000`

docs/tokenomics-testnet-validation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ curl -s -X POST http://127.0.0.1:8545 -H 'content-type: application/json' \
6363
Expected outcome:
6464

6565
- `applied_cycle` is non-zero and increasing over time
66-
- `block_reward_atoms` matches configured fixed reward (`1`)
66+
- `block_reward_atoms` matches configured fixed reward (`1000000000`)
6767
- `estimated_issued_atoms` increases as `applied_cycle` increases
6868
- `fee_burn_bps = 7000`, `fee_to_reward_pool_bps = 3000`, `fee_to_treasury_bps = 0`
6969
- `producer_set_reward_bps = 7000`, `waiting_pool_reward_bps = 3000`

0 commit comments

Comments
 (0)