ore_api/
event.rs

1use serde::{Deserialize, Serialize};
2use steel::*;
3pub enum OreEvent {
4    Reset = 0,
5    Bury = 1,
6    Motherlode = 2,
7}
8
9#[repr(C)]
10#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
11pub struct ResetEvent {
12    /// The event discriminator.
13    pub disc: u64,
14
15    /// The block that was opened for trading.
16    pub round_id: u64,
17
18    /// The start slot of the next block.
19    pub start_slot: u64,
20
21    /// The end slot of the next block.
22    pub end_slot: u64,
23
24    /// The winning square of the round.
25    pub winning_square: u64,
26
27    /// The top miner of the round.
28    pub top_miner: Pubkey,
29
30    /// The number of miners on the winning square.
31    pub num_winners: u64,
32
33    /// The amount of ORE payout for the motherlode.
34    pub motherlode: u64,
35
36    /// The total amount of SOL prospected in the round.
37    pub total_deployed: u64,
38
39    /// The total amount of SOL put in the ORE vault.
40    pub total_vaulted: u64,
41
42    /// The total amount of SOL won by miners for the round.
43    pub total_winnings: u64,
44
45    /// The total amount of ORE minted for the round.
46    pub total_minted: u64,
47
48    /// The timestamp of the event.
49    pub ts: i64,
50}
51
52#[repr(C)]
53#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
54pub struct BuryEvent {
55    /// The event discriminator.
56    pub disc: u64,
57
58    /// The amount of ORE buried.
59    pub ore_buried: u64,
60
61    /// The amount of ORE shared with stakers.
62    pub ore_shared: u64,
63
64    /// The amount of SOL swapped.
65    pub sol_amount: u64,
66
67    /// The new circulating supply of ORE.
68    pub new_circulating_supply: u64,
69
70    /// The timestamp of the event.
71    pub ts: i64,
72}
73
74#[repr(C)]
75#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
76pub struct MotherlodeEvent {
77    /// The event discriminator.
78    pub disc: u64,
79
80    /// The amount of ORE minted to the motherlode.
81    pub amount: u64,
82
83    /// The round id.
84    pub round_id: u64,
85
86    /// The number of winners.
87    pub num_miners: u64,
88
89    /// The timestamp of the event.
90    pub ts: i64,
91}
92
93event!(ResetEvent);
94event!(BuryEvent);
95event!(MotherlodeEvent);