2022-02-10 01:04:47 -08:00
|
|
|
use crate::state::perp_market_info::PerpMarketInfo;
|
|
|
|
use crate::state::spot_market_info::SpotMarketInfo;
|
|
|
|
use anchor_lang::prelude::*;
|
|
|
|
|
2022-02-10 00:07:34 -08:00
|
|
|
pub struct MangoGroup {
|
|
|
|
pub meta_data: MetaData,
|
|
|
|
pub num_oracles: usize, // incremented every time add_oracle is called
|
|
|
|
|
|
|
|
pub tokens: [TokenInfo; MAX_TOKENS],
|
2022-02-10 01:49:45 -08:00
|
|
|
// todo: make a reference, keep state in this new account
|
2022-02-10 00:07:34 -08:00
|
|
|
pub spot_markets: [SpotMarketInfo; MAX_PAIRS],
|
2022-02-10 01:49:45 -08:00
|
|
|
// todo: make a reference, keep state in this new account
|
2022-02-10 00:07:34 -08:00
|
|
|
pub perp_markets: [PerpMarketInfo; MAX_PAIRS],
|
|
|
|
|
2022-02-10 01:49:45 -08:00
|
|
|
// todo: make a reference, keep state in this new account
|
2022-02-10 00:07:34 -08:00
|
|
|
pub oracles: [Pubkey; MAX_PAIRS],
|
|
|
|
|
|
|
|
pub signer_nonce: u64,
|
|
|
|
pub signer_key: Pubkey,
|
2022-02-10 01:49:45 -08:00
|
|
|
pub admin: Pubkey, // Used to add new markets and adjust risk params
|
|
|
|
// todo: which more dex'es do we want to support? orca for pure swap?
|
|
|
|
pub dex_program_id: Pubkey, // Consider allowing more,
|
2022-02-10 00:07:34 -08:00
|
|
|
pub mango_cache: Pubkey,
|
|
|
|
pub valid_interval: u64,
|
|
|
|
|
2022-02-10 01:49:45 -08:00
|
|
|
// todo: do we need more vaults?
|
2022-02-10 00:07:34 -08:00
|
|
|
// insurance vault is funded by the Mango DAO with USDC and can be withdrawn by the DAO
|
|
|
|
pub insurance_vault: Pubkey,
|
|
|
|
pub srm_vault: Pubkey,
|
|
|
|
pub msrm_vault: Pubkey,
|
|
|
|
pub fees_vault: Pubkey,
|
|
|
|
|
2022-02-10 01:49:45 -08:00
|
|
|
// todo: do we need this limit? afaik this was for ts liquidator to keep on working, maybe
|
|
|
|
// with liquidatable-accounts-feed we have some sort of scaling? maybe we bought
|
|
|
|
// some more breathing space?
|
2022-02-10 00:07:34 -08:00
|
|
|
pub max_mango_accounts: u32, // limits maximum number of MangoAccounts.v1 (closeable) accounts
|
|
|
|
pub num_mango_accounts: u32, // number of MangoAccounts.v1
|
|
|
|
|
|
|
|
pub ref_surcharge_centibps: u32, // 100
|
|
|
|
pub ref_share_centibps: u32, // 80 (must be less than surcharge)
|
|
|
|
pub ref_mngo_required: u64,
|
2022-02-10 01:49:45 -08:00
|
|
|
// todo: padding should be called reserve instead,
|
|
|
|
// padding is misleading in context of zero copy
|
2022-02-10 00:07:34 -08:00
|
|
|
pub padding: [u8; 8], // padding used for future expansions
|
|
|
|
}
|