Skip to main content

streak_api/
consts.rs

1use solana_program::{pubkey, pubkey::Pubkey};
2
3/// Authority for `Initialize`. Replace with your deploy multisig before mainnet.
4pub const ADMIN_ADDRESS: Pubkey = pubkey!("6asgn8Vq8KKSQx4wm5zVfEfB76wqGVpEpWxajGkbQ8yr");
5
6/// Signs executor-gated instructions: `AdminInstantSettlement`, `AdminPayout`. Replace before production.
7pub const EXECUTOR_ADDRESS: Pubkey =
8    pubkey!("3B1WXgrV68V6ayymC7C8eVoCMeqeJLR7HWXkxfQxLUeF");
9
10/// Basis points denominator (100%).
11pub const MAX_BPS: u16 = 10_000;
12
13/// PDA seed for the `Treasury` account.
14pub const TREASURY: &[u8] = b"treasury";
15
16/// Ticket revenue split to daily pool (BPS).
17pub const TICKET_DAILY_BPS: u16 = 7000;
18
19/// Ticket revenue split to weekly pool (BPS).
20pub const TICKET_WEEKLY_BPS: u16 = 1500;
21
22/// Ticket revenue split to buyback reserve (BPS).
23pub const TICKET_BUYBACK_BPS: u16 = 1000;
24
25/// Ticket revenue split to team (BPS).
26pub const TICKET_TEAM_BPS: u16 = 500;
27
28/// SPL USDC recipient for team-fee legs.
29pub const FEE_COLLECTOR: Pubkey = pubkey!("FEeB92JDVmVuuoaoTjKyfDPPrLTWPGg2EJTrY3TmTx3T");
30
31/// SPL USDC mint.
32/// Devnet:  BnqRhrdRSEaVXJRox26CmGfvyK1D8F7rKxaxRdaGFSrD  (custom devnet USDC)
33/// Mainnet: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v  (Circle mainnet)
34pub const USDC_MAINNET_MINT: Pubkey = pubkey!("BnqRhrdRSEaVXJRox26CmGfvyK1D8F7rKxaxRdaGFSrD");
35
36/// Pyth **Receiver** program (pull feeds).
37pub const PYTH_RECEIVER_PROGRAM: Pubkey = pubkey!("rec5EKMGg6MxZYaMdyBfgwp4d5rB9T1VQH5pJv5LtFJ");
38
39/// Pyth **Push Oracle** program (continuously-maintained push feed accounts, ~400 ms heartbeat).
40pub const PYTH_PUSH_ORACLE_PROGRAM: Pubkey =
41    pubkey!("pythWSnswVUd12oZpeFP8e9CVaEqJg25g1Vtc2biRsT");
42
43/// BTC/USD canonical Pyth feed ID.
44pub const PYTH_BTC_USD_FEED_ID: [u8; 32] = [
45    0xe6, 0x2d, 0xf6, 0xc8, 0xb4, 0xa8, 0x5f, 0xe1,
46    0xa6, 0x7d, 0xb4, 0x4d, 0xc1, 0x2d, 0xe5, 0xdb,
47    0x33, 0x0f, 0x7a, 0xc6, 0x6b, 0x72, 0xdc, 0x65,
48    0x8a, 0xfe, 0xdf, 0x0f, 0x4a, 0x41, 0x5b, 0x43,
49];
50
51/// BTC/USD Pyth push feed account (shard 0, identical on mainnet-beta and devnet).
52pub const PYTH_BTC_USD_PRICE_FEED_ACCOUNT: Pubkey =
53    pubkey!("4cSM2e6rvbGQUFiJbqytoVMi5GgghSMr8LwVrT9VPSPo");
54
55/// Maximum age in seconds for a Pyth price to be considered fresh.
56/// Devnet push feeds update infrequently — keep this generous for testing.
57/// Tighten to 60 before mainnet.
58pub const PYTH_MAX_PRICE_AGE_SECS: u64 = 3600;
59
60/// Duration of each 5-minute market bucket in seconds.
61/// `open_ts = period * MARKET_BUCKET_SECS`, `close_ts = open_ts + MARKET_BUCKET_SECS`.
62pub const MARKET_BUCKET_SECS: i64 = 300;