/
config.rs
33 lines (30 loc) · 940 Bytes
/
config.rs
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
use anchor_lang::prelude::*;
pub const AMM_CONFIG_SEED: &str = "amm_config";
/// Holds the current owner of the factory
#[account]
#[derive(Default, Debug)]
pub struct AmmConfig {
/// Bump to identify PDA
pub bump: u8,
/// Status to control if new pool can be create
pub disable_create_pool: bool,
/// Config index
pub index: u16,
/// The trade fee, denominated in hundredths of a bip (10^-6)
pub trade_fee_rate: u64,
/// The protocol fee
pub protocol_fee_rate: u64,
/// The fund fee, denominated in hundredths of a bip (10^-6)
pub fund_fee_rate: u64,
/// Fee for create a new pool
pub create_pool_fee: u64,
/// Address of the protocol fee owner
pub protocol_owner: Pubkey,
/// Address of the fund fee owner
pub fund_owner: Pubkey,
/// padding
pub padding: [u64; 16],
}
impl AmmConfig {
pub const LEN: usize = 8 + 1 + 1 + 2 + 4 * 8 + 32 * 2 + 8 * 16;
}