This commit is contained in:
Hardhat Chad
2025-06-05 16:56:03 -07:00
parent 4138fc2b66
commit 8f6a40ea17
16 changed files with 1073 additions and 39 deletions

View File

@@ -1,28 +1,39 @@
use steel::*;
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
pub struct BuryEvent {
pub amount: u64,
pub ts: u64,
}
use crate::state::SwapDirection;
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
pub struct DeployEvent {
pub authority: Pubkey,
pub amount: u64,
pub ts: u64,
#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable)]
pub struct SwapEvent {
/// 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,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
pub struct PayoutEvent {
pub authority: Pubkey,
pub amount: u64,
pub ts: u64,
impl SwapEvent {
pub fn direction(&self) -> SwapDirection {
SwapDirection::try_from(self.direction as u8).unwrap()
}
}
event!(BuryEvent);
event!(DeployEvent);
event!(PayoutEvent);
event!(SwapEvent);