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
use anchor_lang::prelude::*;
use fixed::types::I80F48;

use crate::state::{PerpMarketIndex, TokenIndex};

#[event]
pub struct MangoAccountData {
    pub init_health: I80F48,
    pub maint_health: I80F48,
    pub equity: Equity,
}

#[derive(AnchorDeserialize, AnchorSerialize, Debug)]
pub struct Equity {
    pub tokens: Vec<TokenEquity>,
    pub perps: Vec<PerpEquity>,
}

#[derive(AnchorDeserialize, AnchorSerialize, Debug)]
pub struct TokenEquity {
    pub token_index: TokenIndex,
    pub value: I80F48, // in native quote
}

#[derive(AnchorDeserialize, AnchorSerialize, Debug)]
pub struct PerpEquity {
    pub perp_market_index: PerpMarketIndex,
    value: I80F48, // in native quote
}