triad_protocol/
events.rs

1use anchor_lang::prelude::*;
2
3#[event]
4pub struct OpenPositionRecord {
5    pub amount: u64,
6    pub ticker: Pubkey,
7    pub entry_price: u64,
8    pub ts: i64,
9    pub is_long: bool,
10    pub user: Pubkey,
11}
12
13#[event]
14pub struct ClosePositionRecord {
15    pub amount: u64,
16    pub ticker: Pubkey,
17    pub close_price: u64,
18    pub ts: i64,
19    pub is_long: bool,
20    pub pnl: i64,
21    pub user: Pubkey,
22}
23
24#[event]
25pub struct TickerPriceUpdateRecord {
26    pub price: u64,
27    pub ts: i64,
28    pub ticker: Pubkey,
29}