triad_protocol/state/
ticker.rs1use anchor_lang::prelude::*;
2
3#[account]
4pub struct Ticker {
5 pub init_ts: i64,
6 pub updated_ts: i64,
7 pub bump: u8,
8 pub authority: Pubkey,
9 pub name: String,
10 pub protocol_program_id: Pubkey,
11 pub price: u64,
12 pub vault: Pubkey,
13}
14
15#[derive(AnchorSerialize, AnchorDeserialize)]
16pub struct CreateTickerArgs {
17 pub name: String,
18 pub protocol_program_id: Pubkey,
19}
20
21#[derive(AnchorSerialize, AnchorDeserialize)]
22pub struct UpdateTickerPriceArgs {
23 pub price: u64,
24}
25
26impl Ticker {
27 pub const PREFIX_SEED: &'static [u8] = b"ticker";
28
29 pub const SPACE: usize = 8 + std::mem::size_of::<Self>();
30}