update_targets

Function update_targets 

Source
pub fn update_targets(
    oracle_authority: Pubkey,
    target_weekly_users: u32,
    target_weekly_activity: u32,
    target_retention_rate: u16,
    max_customer_activity_per_epoch: u32,
    max_merchant_activity_per_epoch: u32,
    activity_cap_enabled: u8,
    claim_cap_enabled: u8,
    claim_rewards_threshold: u64,
) -> Instruction
Expand description

Build an UpdateTargets instruction to update community targets and activity limits. This function allows the oracle to update configurable parameters based on community performance.

§Parameters

  • oracle_authority: The oracle authority that can update these parameters
  • target_weekly_users: Target weekly active users (default: 500 for launch)
  • target_weekly_activity: Target weekly activity count (default: 5,000 for launch)
  • target_retention_rate: Target retention rate in basis points (default: 5,000 = 50%)
  • max_customer_activity_per_epoch: Max customer activities per epoch (default: 5)
  • max_merchant_activity_per_epoch: Max merchant activities per epoch (default: 50)
  • activity_cap_enabled: Whether activity capping is enabled (default: 1 = enabled)
  • claim_cap_enabled: Whether claim capping is enabled (default: 1 = enabled)

§Returns

  • Instruction to update community targets and activity limits

§Authority

  • Only the oracle authority can execute this instruction
  • Oracle has the data to make informed decisions about community health

§Benefits

  • Operational Flexibility: Adjust parameters based on real community performance
  • Anti-Gaming: Update activity limits to prevent new gaming strategies
  • Community Adaptation: Adjust targets as community grows and evolves
  • Economic Balance: Fine-tune parameters for sustainable tokenomics
  • Risk Management: Adjust claim rewards threshold based on market conditions

§Example

use miracle_api::sdk;
use solana_program::pubkey::Pubkey;

let oracle_authority = Pubkey::new_unique();
let update_targets_ix = sdk::update_targets(
    oracle_authority,
    1000,   // target_weekly_users
    10000,  // target_weekly_activity
    6000,   // target_retention_rate (60%)
    10,     // max_customer_activity_per_epoch
    100,    // max_merchant_activity_per_epoch
    1,      // activity_cap_enabled
    1,      // claim_cap_enabled
    1000000, // claim_rewards_threshold
);