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
//! Crate events

use anchor_lang::prelude::*;

use crate::*;

/// Emitted when an [Aggregate] is created.
#[event]
pub struct NewAggregateEvent {
    /// Aggregate
    #[index]
    pub aggregate: Pubkey,
    /// Curator.
    pub curator: Pubkey,
    /// Timestamp of the event.
    pub timestamp: i64,
}

/// Emitted when a [StakePool] is added.
#[event]
pub struct AddStakePoolEvent {
    /// Aggregate
    #[index]
    pub aggregate: Pubkey,
    /// Stake pool
    #[index]
    pub stake_pool: Pubkey,

    /// The [Aggregate::curator].
    pub curator: Pubkey,
    /// The [Mint].
    pub mint: Pubkey,
    /// The accounting method used.
    pub accounting_method: AccountingMethod,

    /// Timestamp of the event.
    pub timestamp: i64,
}

/// Emitted when an [Aggregate]'s curator is modified.
#[event]
pub struct SetCuratorEvent {
    /// Aggregate
    #[index]
    pub aggregate: Pubkey,

    /// The new [Aggregate::curator].
    pub curator: Pubkey,
    /// The previous [Aggregate::curator].
    pub previous_curator: Pubkey,
    /// The [Aggregate::curator_setter].
    pub curator_setter: Pubkey,

    /// Timestamp of the event.
    pub timestamp: i64,
}

/// Emitted when ASol is minted.
#[event]
pub struct MintASolEvent {
    /// Depositor
    #[index]
    pub depositor: Pubkey,

    /// The mint of the stake pool token deposited.
    #[index]
    pub stake_pool_mint: Pubkey,

    /// Accounting method used.
    #[index]
    pub accounting_method: AccountingMethod,

    /// Amount of stake pool tokens deposited.
    pub deposit_amount: u64,

    /// Amount of aSOL minted.
    pub mint_amount: u64,

    /// Timestamp of the event.
    pub timestamp: i64,
}

/// Information about an aggregate.
#[event]
pub struct AggregateInfoEvent {
    /// Pool snapshot.
    pub snapshot: Snapshot,
    /// Time that the info was fetched.
    pub timestamp: i64,
}