Treasury Layer
Revenue routing engine for fund allocation across prize pools, staking, and operations.
Purposeβ
The treasury layer is the economic routing system for Monsuta Core. It exists because:
- Multiple revenue sources feed into the system (entry fees, sponsor deposits, marketplace fees)
- These funds must be allocated to different destinations (prize pools, staker rewards, operational costs)
- The allocation rules must be transparent and configurable
- No single entity should have unilateral control over all treasury funds
Architectureβ
INFLOW SOURCES
ββββββββββββββ
Entry Fees ββββββββββββββββ
Marketplace Fees ββββββββββ€
Sponsor Deposits ββββββββββ€
Bridge Fees (future) ββββββ€
β
ββββββββΌβββββββ
β TREASURY β
β CONTRACT β
β β
β Routes β
β funds per β
β allocation β
β rules β
ββββββββ¬βββββββ
β
βββββββββββββββΌββββββββββββββ
βΌ βΌ βΌ
ββββββββββββββ ββββββββββββ βββββββββββββ
βPrize Pools β β Staking β βOperationalβ
β β β Rewards β β Fund β
β tournament β β pool β β β
β funding β β funding β β dev costs β
β β β β β infra β
ββββββββββββββ ββββββββββββ βββββββββββββ
Treasury Allocationβ
Configurationβ
{
allocation: {
prize_pools: 50, // % of inflow directed to prize pool funding
staking_rewards: 30, // % to staking reward pool
operational: 15, // % to operational wallet
reserve: 5 // % held in reserve buffer
},
distribution_frequency: "weekly", // how often accumulated funds are routed
operational_wallet: "0xABCD...",
reserve_wallet: "0xEF01...",
// Override rules
sponsor_deposits: {
// Sponsor deposits bypass allocation β 100% goes to specified pool
routing: "direct_to_pool"
}
}
Allocation Rulesβ
| Source | Default Routing | Override Available? |
|---|---|---|
| Entry fees | Split per allocation config | Yes |
| Marketplace fees | Split per allocation config | Yes |
| Sponsor deposits | 100% to specified prize pool | No β intentional |
| Bridge fees | 100% to operational fund | Yes |
| Direct donations | Split per allocation config | Yes |
Why sponsor deposits bypass allocation: Sponsors fund a specific event. Routing their deposit through the general treasury would break their expectation that 100% goes to the pool they chose to fund.
AVAX Inflow Handlingβ
How AVAX Enters the Systemβ
Player pays 2 AVAX entry fee
β
βΌ
Contract receives 2 AVAX
β
βββ 1.0 AVAX β Prize Pool (50%)
βββ 0.6 AVAX β Staking Rewards (30%)
βββ 0.3 AVAX β Operational (15%)
βββ 0.1 AVAX β Reserve (5%)
Immediate vs Batched Distributionβ
| Mode | How It Works | Trade-off |
|---|---|---|
| Immediate | Every deposit triggers allocation on receipt | Higher gas, simpler logic |
| Batched | Funds accumulate, distributed on schedule | Lower gas, requires keeper |
Recommendation: Batched distribution with a weekly keeper job, unless the game has very low transaction volume.
THC Distribution (Optional)β
The treasury can optionally manage THC distribution for:
- Season rewards
- Event bonuses
- Promotional distributions
THC Sourceβ
THC for distribution can come from:
| Source | Mechanism |
|---|---|
| Pre-minted reserve | THC minted at deployment, held by treasury |
| Bridge inflow | THC bridged from WAX, held by treasury |
| Buy-and-distribute | Treasury uses AVAX to acquire THC, then distributes |
THC Distribution Rulesβ
{
thc_distribution: {
season_reward_pool: 100000, // THC allocated per season
event_bonus_cap: 10000, // max THC per event
distribution_method: "claim", // "claim" or "push"
// claim: players call claim() on contract
// push: server sends THC proactively (costs gas)
cliff: 0, // no cliff β immediately claimable
vesting: 0 // no vesting β full amount at once
}
}
Contract Interfaceβ
interface ITreasury {
// Receive funds
function deposit() external payable;
// View allocation
function getAllocation() external view returns (
uint8 prizePoolPercent,
uint8 stakingPercent,
uint8 operationalPercent,
uint8 reservePercent
);
// Distribute accumulated funds (keeper or admin)
function distribute() external;
// Sponsor direct deposit to a specific pool
function fundPool(uint256 poolId) external payable;
// Admin: update allocation (timelock recommended)
function updateAllocation(
uint8 prizePoolPercent,
uint8 stakingPercent,
uint8 operationalPercent,
uint8 reservePercent
) external;
// View
function pendingBalance() external view returns (uint256);
function totalDistributed() external view returns (uint256);
}
Security Considerationsβ
| Risk | Mitigation |
|---|---|
| Admin changes allocation maliciously | Timelock on updateAllocation() (e.g., 48hr delay) |
| Operational wallet drained | Multi-sig wallet, spending limits per epoch |
| Reserve never used, just accumulates | Periodic review, community visibility into balance |
| THC distribution exceeds budget | Hard cap enforced in contract: thc_distributed <= season_pool |
Integration Guide for Other Gamesβ
Step 1: Define Your Revenue Streamsβ
List all sources of value entering your game economy:
- Entry fees?
- Marketplace commissions?
- Subscription fees?
- Sponsor deposits?
Step 2: Set Allocation Percentagesβ
Decide how revenue is split:
- What percentage funds competitions?
- What percentage rewards stakers?
- What covers operational costs?
- Is there a reserve?
Step 3: Deploy Treasury Contractβ
- Set initial allocation percentages
- Configure distribution frequency
- Set operational and reserve wallet addresses
- Optional: add timelock for allocation changes
Step 4: Connect Revenue Sourcesβ
- Entry fee contracts route payments through the treasury
- Marketplace contracts send commissions to the treasury
- Sponsor deposits bypass to direct pool funding
Step 5: Monitorβ
- Track total inflow vs allocation vs distribution
- Ensure reserve does not grow disproportionately
- Adjust allocation based on economic health metrics