mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-23 07:26:52 +00:00
5x5
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
use steel::*;
|
||||
|
||||
use crate::state::SwapDirection;
|
||||
|
||||
pub enum OreEvent {
|
||||
Reset = 0,
|
||||
Swap = 1,
|
||||
Mine = 2,
|
||||
}
|
||||
|
||||
@@ -30,58 +27,6 @@ pub struct ResetEvent {
|
||||
pub ts: i64,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable)]
|
||||
pub struct SwapEvent {
|
||||
/// The event discriminator.
|
||||
pub disc: u64,
|
||||
|
||||
/// The authority of the swap.
|
||||
pub authority: Pubkey,
|
||||
|
||||
/// The block id.
|
||||
pub block_id: u64,
|
||||
|
||||
/// Swap direction.
|
||||
pub direction: u64,
|
||||
|
||||
/// Amount of base tokens to transfer.
|
||||
pub base_to_transfer: u64,
|
||||
|
||||
/// Amount of quote tokens to transfer.
|
||||
pub quote_to_transfer: u64,
|
||||
|
||||
/// Amount of base tokens swapped via virtual limit order.
|
||||
pub base_via_order: u64,
|
||||
|
||||
/// Amount of quote tokens swapped via virtual limit order.
|
||||
pub quote_via_order: u64,
|
||||
|
||||
/// Amount of base tokens swapped via curve.
|
||||
pub base_via_curve: u64,
|
||||
|
||||
/// Amount of quote tokens swapped via curve.
|
||||
pub quote_via_curve: u64,
|
||||
|
||||
/// Amount of quote tokens taken in fees.
|
||||
pub quote_fee: u64,
|
||||
|
||||
/// Amount of base tokens in the market.
|
||||
pub base_liquidity: u64,
|
||||
|
||||
/// Amount of quote tokens in the market.
|
||||
pub quote_liquidity: u64,
|
||||
|
||||
/// Amount of hashpower the miner now has.
|
||||
pub miner_hashpower: u64,
|
||||
|
||||
/// Amount of hashpower the block now has.
|
||||
pub block_hashpower: u64,
|
||||
|
||||
/// The timestamp of the event.
|
||||
pub ts: i64,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable)]
|
||||
pub struct MineEvent {
|
||||
@@ -107,12 +52,5 @@ pub struct MineEvent {
|
||||
pub ts: i64,
|
||||
}
|
||||
|
||||
impl SwapEvent {
|
||||
pub fn direction(&self) -> SwapDirection {
|
||||
SwapDirection::try_from(self.direction as u8).unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
event!(ResetEvent);
|
||||
event!(SwapEvent);
|
||||
event!(MineEvent);
|
||||
|
||||
Reference in New Issue
Block a user