use solana_program::{pubkey, pubkey::Pubkey};

/// Authority for `Initialize`. Replace with your deploy multisig before mainnet.
pub const ADMIN_ADDRESS: Pubkey = pubkey!("6asgn8Vq8KKSQx4wm5zVfEfB76wqGVpEpWxajGkbQ8yr");

/// Signs executor-gated instructions: `AdminInstantSettlement`, `AdminPayout`. Replace before production.
pub const EXECUTOR_ADDRESS: Pubkey =
    pubkey!("3B1WXgrV68V6ayymC7C8eVoCMeqeJLR7HWXkxfQxLUeF");

/// Basis points denominator (100%).
pub const MAX_BPS: u16 = 10_000;

/// PDA seed for the `Treasury` account.
pub const TREASURY: &[u8] = b"treasury";

/// Ticket revenue split to daily pool (BPS).
pub const TICKET_DAILY_BPS: u16 = 7000;

/// Ticket revenue split to weekly pool (BPS).
pub const TICKET_WEEKLY_BPS: u16 = 1500;

/// Ticket revenue split to buyback reserve (BPS).
pub const TICKET_BUYBACK_BPS: u16 = 1000;

/// Ticket revenue split to team (BPS).
pub const TICKET_TEAM_BPS: u16 = 500;

/// SPL USDC recipient for team-fee legs.
pub const FEE_COLLECTOR: Pubkey = pubkey!("FEeB92JDVmVuuoaoTjKyfDPPrLTWPGg2EJTrY3TmTx3T");

/// SPL USDC mint.
/// Devnet:  GAmHPNMcgh9BTpe3DWirqMwvYCeDskE2im6fUhZyukJp  (custom devnet USDC)
/// Mainnet: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v  (Circle mainnet)
pub const USDC_MAINNET_MINT: Pubkey = pubkey!("GAmHPNMcgh9BTpe3DWirqMwvYCeDskE2im6fUhZyukJp");

/// Pyth **Receiver** program (pull feeds).
pub const PYTH_RECEIVER_PROGRAM: Pubkey = pubkey!("rec5EKMGg6MxZYaMdyBfgwp4d5rB9T1VQH5pJv5LtFJ");

/// Pyth **Push Oracle** program (continuously-maintained push feed accounts, ~400 ms heartbeat).
pub const PYTH_PUSH_ORACLE_PROGRAM: Pubkey =
    pubkey!("pythWSnswVUd12oZpeFP8e9CVaEqJg25g1Vtc2biRsT");

/// BTC/USD canonical Pyth feed ID.
pub const PYTH_BTC_USD_FEED_ID: [u8; 32] = [
    0xe6, 0x2d, 0xf6, 0xc8, 0xb4, 0xa8, 0x5f, 0xe1,
    0xa6, 0x7d, 0xb4, 0x4d, 0xc1, 0x2d, 0xe5, 0xdb,
    0x33, 0x0f, 0x7a, 0xc6, 0x6b, 0x72, 0xdc, 0x65,
    0x8a, 0xfe, 0xdf, 0x0f, 0x4a, 0x41, 0x5b, 0x43,
];

/// BTC/USD Pyth push feed account (shard 0, identical on mainnet-beta and devnet).
pub const PYTH_BTC_USD_PRICE_FEED_ACCOUNT: Pubkey =
    pubkey!("4cSM2e6rvbGQUFiJbqytoVMi5GgghSMr8LwVrT9VPSPo");

/// Maximum age in seconds for a Pyth price to be considered fresh.
/// Devnet push feeds update infrequently — keep this generous for testing.
/// Tighten to 60 before mainnet.
pub const PYTH_MAX_PRICE_AGE_SECS: u64 = 3600;

/// Duration of each 5-minute market bucket in seconds.
/// `open_ts = period * MARKET_BUCKET_SECS`, `close_ts = open_ts + MARKET_BUCKET_SECS`.
pub const MARKET_BUCKET_SECS: i64 = 300;
