1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
use serde::{Deserialize, Serialize};
use steel::*;
pub enum OilEvent {
Reset = 0,
Barrel = 1,
Deploy = 2,
Liq = 3,
Bid = 4,
JoinPool = 5,
ClaimAuctionOIL = 6,
ClaimAuctionSOL = 7,
ClaimRefineryRewards = 8,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
pub struct ResetEvent {
/// The event discriminator.
pub disc: u64,
/// The block that was opened for trading.
pub round_id: u64,
/// The start slot of the next block.
pub start_slot: u64,
/// The end slot of the next block.
pub end_slot: u64,
/// The winning square of the round.
pub winning_square: u64,
/// The top miner of the round.
pub top_miner: Pubkey,
/// The number of miners on the winning square.
pub num_winners: u64,
/// The total amount of SOL prospected in the round.
pub total_deployed: u64,
/// The total amount of SOL put in the OIL vault.
pub total_vaulted: u64,
/// The total amount of SOL won by miners for the round.
pub total_winnings: u64,
/// The total amount of OIL minted for the round.
pub total_minted: u64,
/// The timestamp of the event.
pub ts: i64,
/// The amount of SOL in the gusher.
pub gusher_sol: u64,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
pub struct BarrelEvent {
/// The event discriminator.
pub disc: u64,
/// The amount of OIL barreled.
pub oil_barreled: u64,
/// The amount of OIL shared with stakers.
pub oil_shared: u64,
/// The amount of SOL swapped.
pub sol_amount: u64,
/// The new circulating supply of OIL.
pub new_circulating_supply: u64,
/// The timestamp of the event.
pub ts: i64,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
pub struct DeployEvent {
/// The event discriminator.
pub disc: u64,
/// The authority of the deployer.
pub authority: Pubkey,
/// The amount of SOL deployed per square.
pub amount: u64,
/// The mask of the squares deployed to.
pub mask: u64,
/// The round id.
pub round_id: u64,
/// The signer of the deployer.
pub signer: Pubkey,
/// The strategy used by the autominer (u64::MAX if manual).
pub strategy: u64,
/// The total number of squares deployed to.
pub total_squares: u64,
/// The timestamp of the event.
pub ts: i64,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
pub struct LiqEvent {
/// The event discriminator.
pub disc: u64,
/// The amount of SOL sent to the liq manager.
pub sol_amount: u64,
/// The recipient of the SOL.
pub recipient: Pubkey,
/// The timestamp of the event.
pub ts: i64,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
pub struct BidEvent {
/// The event discriminator.
pub disc: u64,
/// The authority of the bidder.
pub authority: Pubkey,
/// The square ID (well) that was bid on (0-3).
pub square_id: u64,
/// The bid amount in lamports.
pub bid_amount: u64,
/// The current price at time of bid (in lamports).
pub current_price: u64,
/// The previous owner (Pubkey::default() if no previous owner).
pub previous_owner: Pubkey,
/// The accumulated OIL transferred to previous owner (0 if no previous owner).
pub accumulated_oil_transferred: u64,
/// The new starting price for next auction (in lamports).
pub new_start_price: u64,
/// The timestamp of the event.
pub ts: u64,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
pub struct JoinAuctionPoolEvent {
/// The event discriminator.
pub disc: u64,
/// The authority of the contributor.
pub authority: Pubkey,
/// The square ID (well) for this pool contribution (0-3).
pub square_id: u64,
/// The contribution amount in lamports.
pub contribution: u64,
/// The total pool amount after this contribution (in lamports).
pub pool_total: u64,
/// The current price at time of contribution (in lamports).
pub current_price: u64,
/// The timestamp of the event.
pub ts: u64,
/// Whether the pool won the well (auto-bid triggered).
/// 0 = false, 1 = true (using u64 for Pod compatibility and alignment)
pub pool_won: u64,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
pub struct ClaimAuctionOILEvent {
/// The event discriminator.
pub disc: u64,
/// The authority of the claimant.
pub authority: Pubkey,
/// The total OIL claimed (after refining fees).
pub oil_claimed: u64,
/// The refining fee charged (10%).
pub refining_fee: u64,
/// The timestamp of the event.
pub ts: u64,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
pub struct ClaimAuctionSOLEvent {
/// The event discriminator.
pub disc: u64,
/// The authority of the claimant.
pub authority: Pubkey,
/// The total SOL claimed (rewards + refunds).
pub sol_claimed: u64,
/// The SOL from auction rewards (being outbid).
pub rewards_sol: u64,
/// The SOL from pool refunds.
pub refunds_sol: u64,
/// The timestamp of the event.
pub ts: u64,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
pub struct ClaimRefineryRewardsEvent {
/// The event discriminator.
pub disc: u64,
/// The authority (plot owner) that claimed.
pub authority: Pubkey,
/// OIL claimed (atomic units).
pub oil_claimed: u64,
/// Claim fee paid in lamports (35% of claim value).
pub fee_lamports: u64,
/// Portion to fee collector (15%).
pub fee_collector_lamports: u64,
/// Portion to staking rewards (15%).
pub staking_lamports: u64,
/// Portion to treasury balance for buybacks (5%).
pub buyback_lamports: u64,
/// The timestamp of the event.
pub ts: i64,
}
event!(ResetEvent);
event!(BarrelEvent);
event!(DeployEvent);
event!(LiqEvent);
event!(BidEvent);
event!(JoinAuctionPoolEvent);
event!(ClaimAuctionOILEvent);
event!(ClaimAuctionSOLEvent);
event!(ClaimRefineryRewardsEvent);