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
54#[repr(C)]
55#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
56pub struct BuryEvent {
57    /// The event discriminator.
58    pub disc: u64,
59
60    /// The amount of ORE buried.
61    pub ore_buried: u64,
62
63    /// The amount of ORE shared with stakers.
64    pub ore_shared: u64,
65
66    /// The amount of SOL swapped.
67    pub sol_amount: u64,
68
69    /// The new circulating supply of ORE.
70    pub new_circulating_supply: u64,
71
72    /// The timestamp of the event.
73    pub ts: i64,
74}
75
76#[repr(C)]
77#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
78pub struct DeployEvent {
79    /// The event discriminator.
80    pub disc: u64,
81
82    /// The authority of the deployer.
83    pub authority: Pubkey,
84
85    /// The amount of SOL deployed per square.
86    pub amount: u64,
87
88    /// The mask of the squares deployed to.
89    pub mask: u64,
90
91    /// The round id.
92    pub round_id: u64,
93
94    /// The timestamp of the event.
95    pub ts: i64,
96}
97
98#[repr(C)]
99#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
100pub struct LiqEvent {
101    /// The event discriminator.
102    pub disc: u64,
103
104    /// The amount of SOL sent to the liq manager.
105    pub sol_amount: u64,
106
107    /// The recipient of the SOL.
108    pub recipient: Pubkey,
109
110    /// The timestamp of the event.
111    pub ts: i64,
112}
113
114event!(ResetEvent);
115event!(BuryEvent);
116event!(DeployEvent);
117event!(LiqEvent);