ore_api/
event.rs

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