mod position;
mod protocol;
mod stable;
mod vault;
pub use position::*;
pub use protocol::*;
pub use stable::*;
pub use vault::*;
use crate::consts::*;
use steel::*;
#[repr(u8)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)]
pub enum BucksAccount {
Stable = 100,
Vault = 101,
ProtocolRegistry = 102,
StableProtocolPosition = 103,
}
pub fn stable_pda(mint: Pubkey) -> (Pubkey, u8) {
Pubkey::find_program_address(&[STABLE, mint.as_ref()], &crate::ID)
}
pub fn vault_pda() -> (Pubkey, u8) {
Pubkey::find_program_address(&[VAULT], &crate::ID)
}
pub fn protocol_pda(protocol_id: u8) -> (Pubkey, u8) {
Pubkey::find_program_address(&[PROTOCOL, &[protocol_id]], &crate::ID)
}
pub fn position_pda(stable: Pubkey, protocol_id: u8) -> (Pubkey, u8) {
Pubkey::find_program_address(&[POSITION, stable.as_ref(), &[protocol_id]], &crate::ID)
}