Skip to main content

bucks_api/
consts.rs

1use const_crypto::ed25519;
2use solana_program::{pubkey, pubkey::Pubkey};
3
4/// The authority allowed to initialize the program.
5pub const ADMIN_ADDRESS: Pubkey = pubkey!("HBUh9g46wk2X89CvaNN15UmsznP59rh6od1h8JwYAopk");
6
7/// The seed of the mint account PDA.
8pub const MINT: &[u8] = b"mint";
9
10/// The seed of the stable account PDA.
11pub const STABLE: &[u8] = b"stable";
12
13/// The seed of the vault account PDA.
14pub const VAULT: &[u8] = b"vault";
15
16/// The seed of the protocol account PDA.
17pub const PROTOCOL: &[u8] = b"protocol";
18
19/// The seed of the position account PDA.
20pub const POSITION: &[u8] = b"position";
21
22/// The address of the Bucks vault account.
23pub const VAULT_ADDRESS: Pubkey = pubkey!("9znvhq6ae8nTsSW2VU49pQnq1or3Ne12q7ehRYXf8YTw");
24
25/// The address of the USDC token.
26pub const USDC_ADDRESS: Pubkey = pubkey!("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
27
28/// The number of decimals for the token.
29pub const TOKEN_DECIMALS: u8 = 6;
30
31/// The default platform fee in basis points (1000 = 10%).
32pub const DEFAULT_PLATFORM_FEE_BPS: u16 = 1000;
33
34/// Denominator for fee calculations (10000 = 100%).
35pub const DENOMINATOR_BPS: u64 = 10_000;
36
37/// Shares per USDC for share calculations (1000 shares per USDC).
38pub const SHARES_PER_USDC: u64 = 1000;
39
40/// Exchange rate precision (1e9).
41pub const EXCHANGE_RATE_PRECISION: u64 = 1_000_000_000;
42
43// =============================================================================
44// Protocol IDs
45// =============================================================================
46
47/// Protocol ID for Kamino.
48pub const PROTOCOL_KAMINO: u8 = 0;
49
50/// Protocol ID for Perena.
51pub const PROTOCOL_PERENA: u8 = 1;
52
53// =============================================================================
54// Kamino Lending Integration
55// =============================================================================
56
57pub const LENDING_MARKET_ADDRESS: Pubkey = pubkey!("DxXdAyU3kCjnyggvHmY5nAwg5cRbbmdyX3npfDMjjMek");
58
59pub const LENDING_MARKET_AUTHORITY_ADDRESS: Pubkey =
60    pubkey!("B9spsrMK6pJicYtukaZzDyzsUQLgc3jbx5gHVwdDxb6y");
61
62pub const RESERVE_ADDRESS: Pubkey = pubkey!("Ga4rZytCpq1unD4DbEJ5bkHeUz9g3oh9AAFEi6vSauXp");
63
64pub const RESERVE_LIQUIDITY_SUPPLY_ADDRESS: Pubkey =
65    pubkey!("GENey8es3EgGiNTM8H8gzA3vf98haQF8LHiYFyErjgrv");
66
67/// The address of the reserve's ctoken account.
68pub const RESERVE_CTOKEN_ADDRESS: Pubkey = pubkey!("6WnymZBTAekuHf9DgsaDKJ397oEZ3qMApNMHg9qjqhgm");
69
70/// The address of the reserve farm account.
71pub const RESERVE_FARM_STATE_ADDRESS: Pubkey =
72    pubkey!("EGDhupegCXLtonYDSY67c4dzw86S9eMxsntQ1yxWSoHv");
73
74/// Address for price oracle.
75pub const SCOPE_PRICES_ADDRESS: Pubkey = pubkey!("3t4JZcueEzTbVP6kLxXrL3VpWx45jDer4eqysweBchNH");
76
77/// The mint address of the Kamino ctoken.
78pub const CTOKEN_ADDRESS: Pubkey = pubkey!("32XLsweyeQwWgLKRVAzS72nxHGU1JmmNQQZ3C3q6fBjJ");
79
80/// The address of the Kamino lending program.
81pub const KLEND_PROGRAM_ID: Pubkey = pubkey!("KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD");
82
83/// The address of the KFarms program.
84pub const KFARMS_PROGRAM_ID: Pubkey = pubkey!("FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr");
85
86/// The address of the Kamino lending obligation account.
87pub const OBLIGATION_ADDRESS: Pubkey = Pubkey::new_from_array(
88    ed25519::derive_program_address(
89        &[
90            &2u8.to_le_bytes(),
91            &0u8.to_le_bytes(),
92            unsafe { &*(&VAULT_ADDRESS as *const Pubkey as *const [u8; 32]) },
93            unsafe { &*(&LENDING_MARKET_ADDRESS as *const Pubkey as *const [u8; 32]) },
94            unsafe { &*(&USDC_ADDRESS as *const Pubkey as *const [u8; 32]) },
95            unsafe { &*(&USDC_ADDRESS as *const Pubkey as *const [u8; 32]) },
96        ],
97        unsafe { &*(&KLEND_PROGRAM_ID as *const Pubkey as *const [u8; 32]) },
98    )
99    .0,
100);
101
102/// The address of the reserve farm user state account.
103pub const RESERVE_FARM_USER_STATE_ADDRESS: Pubkey = Pubkey::new_from_array(
104    ed25519::derive_program_address(
105        &[
106            b"user",
107            unsafe { &*(&RESERVE_FARM_STATE_ADDRESS as *const Pubkey as *const [u8; 32]) },
108            unsafe { &*(&OBLIGATION_ADDRESS as *const Pubkey as *const [u8; 32]) },
109        ],
110        unsafe { &*(&KFARMS_PROGRAM_ID as *const Pubkey as *const [u8; 32]) },
111    )
112    .0,
113);
114
115// =============================================================================
116// Perena Integration (bankineco)
117// =============================================================================
118
119/// The address of the Perena bankineco program.
120pub const PERENA_PROGRAM_ID: Pubkey = pubkey!("save8RQVPMWNTzU18t3GBvBkN9hT7jsGjiCQ28FpD9H");
121
122/// The address of the USD* mint (Perena receipt token / bank_mint).
123pub const USD_STAR_MINT: Pubkey = pubkey!("star9agSpjiFe3M49B3RniVU4CMBBEK3Qnaqn3RGiFM");
124
125/// The address of the Perena bank_state account (BankGenState).
126pub const PERENA_BANK_STATE: Pubkey = pubkey!("sM6P4mh53CnG4faN4Fo3seY7wMSAiHdy8o6gKjwQF7A");
127
128/// The address of the Perena vault_state account (VaultGenState).
129pub const PERENA_VAULT_STATE: Pubkey = pubkey!("3bZ1qY6wfzyDH7QMPiRKLr6k8p1asdtyjvJyJsJBdv23");
130
131/// The address of the Perena oracle_state account (OracleGenState).
132pub const PERENA_ORACLE_STATE: Pubkey = pubkey!("CmKFP4YJg5QpAryUm9xk5QD611bccYMzZvpvQDJkMwt6");
133
134/// The address of the Perena team_state account (TeamState).
135pub const PERENA_TEAM_STATE: Pubkey = pubkey!("6tqLkhbqJSx4KG616VhNCvsaFqcDPok7wdbzU2DmEAub");
136
137/// The address of the Perena USDC vault (yielding_vault_ata).
138pub const PERENA_YIELDING_VAULT: Pubkey = pubkey!("HvG7HSrNHVAcjzgwt3UVtnY9srkrY7qnMG4zS1SnPQT2");
139
140/// The address of the Perena fee team ATA.
141pub const PERENA_FEE_TEAM_ATA: Pubkey = pubkey!("3msJbxNbSeosztbNEB1eFPitMFnP8ogCszegPUswipdL");
142
143// =============================================================================
144// Address Lookup Table
145// =============================================================================
146
147/// The address of the lookup table for multi-protocol transactions.
148pub const LUT_ADDRESS: Pubkey = pubkey!("4JhHm4zoyoUZdyVqx2ogA2VstnebQVjWDNfNS7uXzd8Y");