Skip to content

Conversation

@sean-kuzco
Copy link
Contributor

@sean-kuzco sean-kuzco commented Oct 30, 2025

Summary

Add protocol support for operating in "USDC-only" mode.

Details

This adds the following two new fields to the PoolOverview account:

pub is_token_mint_usdc: bool,
pub token_rewards_enabled: bool,
  • These fields must be set when the PoolOverview is created and cannot be updated.
  • If is_token_mint_usdc is true, the protocol will enforce that the native token mint equals the USDC mint.
  • If token_rewards_enabled is false, staking for delegators and other reward functionality will be disabled. Operator pool commission rates must be 100%, and token amounts in reward payouts must be zero.

Testing

All existing tests, and one new test suite for the USDC-only behavior, pass.


Note

Introduce USDC-only mode with new PoolOverview flags that disable token rewards and delegator staking, updating instruction constraints, emissions, IDL, and tests.

  • Protocol/State
    • Add immutable PoolOverview flags: is_token_mint_usdc and token_rewards_enabled.
    • Enforce USDC-only mode: if is_token_mint_usdc, mint must equal USDC mint; if !token_rewards_enabled, disable token rewards and delegator staking.
  • Instruction Changes/Validation
    • create_pool_overview now takes args; wire-through in program and IDL.
    • create_operator_pool/update_operator_pool: require 100% commission when rewards disabled; validate USDC mint in USDC mode.
    • create_staking_record/stake: block delegators when rewards disabled (operators only).
    • create_reward_record/accrue_reward: require zero token rewards when disabled; update emissions check signature to accept PoolOverview.
  • Emissions
    • get_expected_reward_emissions_for_epoch(epoch, &PoolOverview) returns 0 when rewards disabled; tests updated.
  • Errors
    • New codes: TokenRewardsDisabled, DelegatorStakingDisabled, InvalidMintForUsdcMode, InvalidCommissionRateForDisabledRewards.
  • SDK/IDL
    • Update IDL types, accounts, and args (notably createPoolOverviewArgs; add poolOverview to createStakingRecord).
  • Tests/Tooling
    • Add tests/usdc-only-mode.test.ts; update existing tests to pass new args/accounts.
    • Extend scripts/test-all.sh and Anchor configs to include USDC-only test.
  • Docs
    • README: clarify protocol description and add "USDC-only mode" to features.

Written by Cursor Bugbot for commit e87cbff. This will update automatically on new commits. Configure here.

@sean-kuzco sean-kuzco marked this pull request as ready for review October 30, 2025 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants