ore_api/
event.rs

1use serde::{Deserialize, Serialize};
2use steel::*;
3
4pub enum OreEvent {
5    Reset = 0,
6    Bury = 1,
7    Deploy = 2,
8    Liq = 3,
9}
10
11#[repr(C)]
12#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
13pub struct ResetEvent {
14    /// The event discriminator.
15    pub disc: u64,
16
17    /// The block that was opened for trading.
18    pub round_id: u64,
19
20    /// The start slot of the next block.
21    pub start_slot: u64,
22
23    /// The end slot of the next block.
24    pub end_slot: u64,
25
26    /// The winning square of the round.
27    pub winning_square: u64,
28
29    /// The top miner of the round.
30    pub top_miner: Pubkey,
31
32    /// The number of miners on the winning square.
33    pub num_winners: u64,
34
35    /// The amount of ORE payout for the motherlode.
36    pub motherlode: u64,
37
38    /// The total amount of SOL prospected in the round.
39    pub total_deployed: u64,
40
41    /// The total amount of SOL put in the ORE vault.
42    pub total_vaulted: u64,
43
44    /// The total amount of SOL won by miners for the round.
45    pub total_winnings: u64,
46
47    /// The total amount of ORE minted for the round.
48    pub total_minted: u64,
49
50    /// The timestamp of the event.
51    pub ts: i64,
52
53    /// The rng value of the round.
54    pub rng: u64,
55
56    /// The amount deployed on the winning square.
57    pub deployed_winning_square: u64,
58}
59
60#[repr(C)]
61#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
62pub struct BuryEvent {
63    /// The event discriminator.
64    pub disc: u64,
65
66    /// The amount of ORE buried.
67    pub ore_buried: u64,
68
69    /// The amount of ORE shared with stakers.
70    pub ore_shared: u64,
71
72    /// The amount of SOL swapped.
73    pub sol_amount: u64,
74
75    /// The new circulating supply of ORE.
76    pub new_circulating_supply: u64,
77
78    /// The timestamp of the event.
79    pub ts: i64,
80}
81
82#[repr(C)]
83#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
84pub struct DeployEvent {
85    /// The event discriminator.
86    pub disc: u64,
87
88    /// The authority of the deployer.
89    pub authority: Pubkey,
90
91    /// The amount of SOL deployed per square.
92    pub amount: u64,
93
94    /// The mask of the squares deployed to.
95    pub mask: u64,
96
97    /// The round id.
98    pub round_id: u64,
99
100    /// The signer of the deployer.
101    pub signer: Pubkey,
102
103    /// The strategy used by the autominer (u64::MAX if manual).
104    pub strategy: u64,
105
106    /// The total number of squares deployed to.
107    pub total_squares: u64,
108
109    /// The timestamp of the event.
110    pub ts: i64,
111}
112
113#[repr(C)]
114#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
115pub struct LiqEvent {
116    /// The event discriminator.
117    pub disc: u64,
118
119    /// The amount of SOL sent to the liq manager.
120    pub sol_amount: u64,
121
122    /// The recipient of the SOL.
123    pub recipient: Pubkey,
124
125    /// The timestamp of the event.
126    pub ts: i64,
127}
128
129event!(ResetEvent);
130event!(BuryEvent);
131event!(DeployEvent);
132event!(LiqEvent);