[PR #132] [MERGED] SMP 0.20.0: /eco stats, the daily economy report, web/economy.json #134

Closed
opened 2026-11-03 04:03:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon-mods/pull/132
Author: @ludovic111
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: feat/smp-report


📝 Commits (2)

  • 27bfc9d SMP 0.19.0: the bank (/bank), savings paid by the Treasury
  • bb97027 SMP 0.20.0: /eco stats, the daily economy report, web/economy.json

📊 Changes

11 files changed (+1147 additions, -16 deletions)

View changed files

📝 native/smp/Cargo.lock (+1 -1)
📝 native/smp/Cargo.toml (+1 -1)
📝 native/smp/README.md (+28 -3)
📝 native/smp/mixins/smp/glue.rs (+69 -3)
📝 native/smp/mixins/smp/horizon-mixin.toml (+13 -1)
➕ native/smp/mixins/smp/smp_bank.rs (+442 -0)
📝 native/smp/mixins/smp/smp_economy.rs (+69 -2)
➕ native/smp/mixins/smp/smp_report.rs (+498 -0)
📝 native/smp/mixins/smp/smp_tax.rs (+20 -3)
📝 native/smp/proof.py (+2 -2)
📝 native/smp/src/lib.rs (+4 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Transparency (smp-econ-1, round 2). Stacked on #131 (the bank): review only the last commit; the diff shrinks when #131 merges.

What

  • /eco stats (anyone): the money supply and where it sits (players' wallets, savings and money held; the Treasury; the insurance fund; each pool), what the server made today (market sales, daily reward) and destroyed (market purchases, /eco take), the day's taxes and fees, the Treasury's spending, and the spread (Gini over players with money, the richest ten's share).
  • New in economy.json: flows (money made/destroyed by kind, today and yesterday, counted in Economy::adjust) and the Treasury's yesterday totals, so the midnight report doesn't depend on who moved money first after 00:00.
  • 00:00 UTC: one line to everyone about the day before (report.daily_report); a snapshot of each day kept 60 days (ext.report).
  • world/horizon-smp/web/economy.json once a minute (report.web_json), built on the tick (aggregates, < 1 ms for 2.5k accounts) and written atomically on a short-lived thread: {"schema":1,"generated","currency","today","pools","minted_today","burned_today","treasury":{balance,insurance,income,spent,income_today,spent_today,log},"taxes":{rates,last_collection},"days":[...],"daily_report"}, as agreed with smp-market-1 (its market.json beside it) for /hub.
  • Discord: horizon-server's relay posts only chat/join/leave/death, so the daily line is in the JSON (daily_report) for Kira to post; no horizon change here.

Tests: cargo test --lib 90 passed (new: Gini/top-10, stats lines, the midnight report once and through a restart, the JSON's fields), clippy -D warnings, fmt. Game build: CI. proof.py: config key report.

Version 0.20.0.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon-mods/pull/132 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/smp-report` --- ### 📝 Commits (2) - [`27bfc9d`](https://github.com/horizon-rust/horizon-mods/commit/27bfc9da13b52a4504ab4ce2744f6dcc275090de) SMP 0.19.0: the bank (/bank), savings paid by the Treasury - [`bb97027`](https://github.com/horizon-rust/horizon-mods/commit/bb97027039b7ebb30527979626d3eb26ab08d499) SMP 0.20.0: /eco stats, the daily economy report, web/economy.json ### 📊 Changes **11 files changed** (+1147 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `native/smp/Cargo.lock` (+1 -1) 📝 `native/smp/Cargo.toml` (+1 -1) 📝 `native/smp/README.md` (+28 -3) 📝 `native/smp/mixins/smp/glue.rs` (+69 -3) 📝 `native/smp/mixins/smp/horizon-mixin.toml` (+13 -1) ➕ `native/smp/mixins/smp/smp_bank.rs` (+442 -0) 📝 `native/smp/mixins/smp/smp_economy.rs` (+69 -2) ➕ `native/smp/mixins/smp/smp_report.rs` (+498 -0) 📝 `native/smp/mixins/smp/smp_tax.rs` (+20 -3) 📝 `native/smp/proof.py` (+2 -2) 📝 `native/smp/src/lib.rs` (+4 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Transparency (smp-econ-1, round 2). Stacked on #131 (the bank): review only the last commit; the diff shrinks when #131 merges. **What** - `/eco stats` (anyone): the money supply and where it sits (players' wallets, savings and money held; the Treasury; the insurance fund; each pool), what the server made today (market sales, daily reward) and destroyed (market purchases, `/eco take`), the day's taxes and fees, the Treasury's spending, and the spread (Gini over players with money, the richest ten's share). - New in `economy.json`: `flows` (money made/destroyed by kind, today and yesterday, counted in `Economy::adjust`) and the Treasury's yesterday totals, so the midnight report doesn't depend on who moved money first after 00:00. - 00:00 UTC: one line to everyone about the day before (`report.daily_report`); a snapshot of each day kept 60 days (`ext.report`). - `world/horizon-smp/web/economy.json` once a minute (`report.web_json`), built on the tick (aggregates, < 1 ms for 2.5k accounts) and written atomically on a short-lived thread: `{"schema":1,"generated","currency","today","pools","minted_today","burned_today","treasury":{balance,insurance,income,spent,income_today,spent_today,log},"taxes":{rates,last_collection},"days":[...],"daily_report"}`, as agreed with smp-market-1 (its `market.json` beside it) for /hub. - Discord: horizon-server's relay posts only chat/join/leave/death, so the daily line is in the JSON (`daily_report`) for Kira to post; no horizon change here. **Tests**: `cargo test --lib` 90 passed (new: Gini/top-10, stats lines, the midnight report once and through a restart, the JSON's fields), clippy -D warnings, fmt. Game build: CI. proof.py: config key `report`. Version 0.20.0. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:03:31 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon-mods#134
No description provided.