Skip to main content

streak_api/state/
mod.rs

1//! On-chain accounts. Only `Treasury` lives on-chain in the off-chain-ledger model.
2//! Market pools, positions, balances, and streak stats are tracked in the server DB.
3
4mod treasury;
5
6pub use treasury::*;
7
8use crate::consts::TREASURY;
9
10use num_enum::{IntoPrimitive, TryFromPrimitive};
11use steel::*;
12
13#[repr(u8)]
14#[derive(Clone, Copy, Debug, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)]
15pub enum StreakAccount {
16    Treasury = 1,
17}
18
19pub fn treasury_pda() -> (Pubkey, u8) {
20    Pubkey::find_program_address(&[TREASURY], &crate::ID)
21}