1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
use ;
/// The authority allowed to invoke [`Initialize`](crate::instruction::Initialize). Replace with your deploy multisig / key before mainnet.
pub const ADMIN_ADDRESS: Pubkey = pubkey!;
/// Must sign executor-gated instructions: [`InitMarket`](crate::instruction::InitMarket), [`AdminInstantSettlement`](crate::instruction::AdminInstantSettlement), [`ExecutorTreasury`](crate::instruction::ExecutorTreasury), [`ClaimPositionFee`](crate::instruction::ClaimPositionFee). Replace before production.
pub const EXECUTOR_ADDRESS: Pubkey =
pubkey!;
/// Meteora DAMM **cp\_amm** program ID (CPI `claim_position_fee`; local tree `damm-v2/programs/cp-amm`).
pub const CP_AMM_PROGRAM_ID: Pubkey =
pubkey!;
/// Basis points denominator (100%).
pub const MAX_BPS: u16 = 10_000;
/// Smallest SPL USDC increment: 10^-6 USD per base unit; ticket purchases and market stakes use whole multiples (1 whole USDC = `TICKET_MICROS` units).
pub const TICKET_MICROS: u64 = 1_000_000;
/// The seed of the ledger account PDA.
pub const LEDGER: & = b"ledger";
/// Maximum supported concurrent **market series** (**`series_id`** ∈ **`0..MAX_MARKET_SERIES`**).
/// **`Treasury::next_period`** is a **monotonic floor cursor** (`max(period+1)` bookkeeping); **`InitMarket`** and **`PlaceBet`** do **not** require matching it.
pub const MAX_MARKET_SERIES: usize = 64;
/// PDA seed for **[`crate::state::Market`]**.
pub const MARKET: & = b"market";
/// PDA seed for **[`crate::state::Position`]**.
pub const POSITION: & = b"position";
/// The seed of the program treasury PDA (owns the protocol USDC ATA).
pub const TREASURY: & = b"treasury";
/// **`ExecutorTreasury`** (**`JACKPOT_PAY`** **`pool`**): debit [`crate::state::Treasury::daily_jackpot`].
pub const EXECUTOR_PAY_DAILY_JACKPOT: u8 = 0;
/// **`ExecutorTreasury`** (**`JACKPOT_PAY`** **`pool`**): debit [`crate::state::Treasury::weekly_jackpot`].
pub const EXECUTOR_PAY_WEEKLY_JACKPOT: u8 = 1;
/// Ticket revenue split to daily pool (`MAX_BPS` scale).
pub const TICKET_DAILY_BPS: u16 = 7000;
/// Ticket revenue split to weekly pool (`MAX_BPS` scale).
pub const TICKET_WEEKLY_BPS: u16 = 1500;
/// Ticket revenue split to buyback reserve (`MAX_BPS` scale).
pub const TICKET_BUYBACK_BPS: u16 = 1000;
/// Ticket revenue split to team (`MAX_BPS` scale).
pub const TICKET_TEAM_BPS: u16 = 500;
/// Hook fee routed to weekly pool (`MAX_BPS` scale).
pub const HOOK_WEEKLY_BPS: u16 = 4000;
/// Hook fee accrued to treasury reserve (`MAX_BPS` scale).
pub const HOOK_RESERVE_BPS: u16 = 3000;
/// Hook fee to buyback (`MAX_BPS` scale).
pub const HOOK_BUYBACK_BPS: u16 = 1000;
/// Hook fee to team (`MAX_BPS` scale).
pub const HOOK_TEAM_BPS: u16 = 2000;
/// Prize-side routing to daily (`MAX_BPS` scale).
pub const PRIZE_DAILY_BPS: u16 = 7000;
/// Prize-side reserve routed into treasury weekly (`MAX_BPS` scale).
pub const PRIZE_RESERVE_BPS: u16 = 2000;
/// Prize-side weekly share (`MAX_BPS` scale).
pub const PRIZE_WEEKLY_BPS: u16 = 1000;
/// SPL USDC mint on Solana **mainnet-beta** (Circle). Token accounts in ix must use this mint (`Initialize` is implicit via consts).
/// EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v - mainnet
pub const USDC_MAINNET_MINT: Pubkey = pubkey!;
/// Pyth **Receiver** program (Hermes pull feeds) — same address on mainnet-beta and devnet.
///
/// Accepts pull-feed `PriceUpdateV2` accounts written by this program.
pub const PYTH_RECEIVER_PROGRAM: Pubkey = pubkey!;
/// Pyth **Push Oracle** program — continuously updates price feed accounts on-chain.
///
/// The Pyth Data Association sponsors push updates for major feeds (BTC/USD, ETH/USD, …) at a
/// ~400 ms heartbeat on both mainnet-beta and devnet. Price feed accounts written by this program
/// have the same `PriceUpdateV2` borsh layout as pull-feed accounts; the only difference is the
/// account owner. Oracle-gated instructions (`InitMarket` anchor, `AdminInstantSettlement`)
/// accept accounts owned by **either** this program or `PYTH_RECEIVER_PROGRAM`.
pub const PYTH_PUSH_ORACLE_PROGRAM: Pubkey =
pubkey!;
/// BTC/USD canonical Pyth price feed ID (Hermes / Pythnet).
///
/// Stored in `Market::pyth_price_feed` (reusing the 32-byte `Pubkey` field).
/// Callers must pass a price account whose `price_message.feed_id` matches this.
pub const PYTH_BTC_USD_FEED_ID: = ;
/// BTC/USD **push feed account** — shard 0, maintained by the Pyth Data Association.
///
/// PDA of [`PYTH_PUSH_ORACLE_PROGRAM`] derived from `[shard_id_le_u16, feed_id]` with
/// `shard_id = 0` and `feed_id = PYTH_BTC_USD_FEED_ID`.
/// The address is deterministic and **identical on mainnet-beta and devnet**.
///
/// Pass this account to oracle-gated instructions instead of a manually posted `PriceUpdateV2`.
/// No `post_update_atomic` call is required — the Pyth Data Association keeps this account fresh.
pub const PYTH_BTC_USD_PRICE_FEED_ACCOUNT: Pubkey =
pubkey!;
/// Maximum age in seconds (vs `Clock::unix_timestamp`) that a Pyth Hermes `PriceUpdateV2`
/// publish_time may lag behind the on-chain clock before it is rejected as stale.
pub const PYTH_MAX_PRICE_AGE_SECS: u64 = 60;
/// Void threshold in basis points of absolute price move (1 bp = 0.01%).
///
/// If `|close – open| / open < 1 bp`, the executor should call `AdminVoidMarket` instead of
/// `AdminInstantSettlement`. Checked off-chain by the bot; recorded here for documentation.
pub const BTC_VOID_THRESHOLD_BPS: u64 = 1;
/// **`InitMarket`** (**open-anchor** crank / tail of **`create`**): **`Clock::unix_timestamp`** must satisfy **`∈ [open_ts, min(open_ts + this constant, close_ts))`** so the open tick aligns with bucket start (fixed-bucket oracle anchor).
pub const MARKET_OPEN_ANCHOR_GRACE_SECS: i64 = 60;
/// SPL USDC recipient for team-fee legs: **`ticket_team_bps`** (`BuyTickets`), **`hook_team_bps`** (`ClaimPositionFee`).
pub const FEE_COLLECTOR: Pubkey = pubkey!;