streak-api 0.1.7

API for interacting with the STREAK directional markets protocol on Solana
Documentation
//! On-chain accounts. Only `Treasury` lives on-chain in the off-chain-ledger model.
//! Market pools, positions, balances, and streak stats are tracked in the server DB.

mod treasury;

pub use treasury::*;

use crate::consts::TREASURY;

use num_enum::{IntoPrimitive, TryFromPrimitive};
use steel::*;

#[repr(u8)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)]
pub enum StreakAccount {
    Treasury = 1,
}

pub fn treasury_pda() -> (Pubkey, u8) {
    Pubkey::find_program_address(&[TREASURY], &crate::ID)
}