This commit is contained in:
Hardhat Chad
2025-06-25 14:52:31 -05:00
parent d03acda291
commit f8a554b29f
6 changed files with 71 additions and 6 deletions

View File

@@ -14,9 +14,10 @@ pub enum OreInstruction {
Withdraw = 7,
// Admin
SetAdmin = 10,
SetFeeCollector = 9,
SetFeeRate = 8,
SetAdmin = 8,
SetBlockLimit = 9,
SetFeeCollector = 10,
SetFeeRate = 11,
}
#[repr(C)]
@@ -76,6 +77,12 @@ pub struct SetAdmin {
pub admin: [u8; 32],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct SetBlockLimit {
pub block_limit: [u8; 8],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct SetFeeCollector {
@@ -97,5 +104,6 @@ instruction!(OreInstruction, Swap);
instruction!(OreInstruction, Uncommit);
instruction!(OreInstruction, Withdraw);
instruction!(OreInstruction, SetAdmin);
instruction!(OreInstruction, SetBlockLimit);
instruction!(OreInstruction, SetFeeCollector);
instruction!(OreInstruction, SetFeeRate);

View File

@@ -7,9 +7,17 @@ use super::OreAccount;
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
pub struct Config {
// The address that can set the admin.
pub admin: Pubkey,
// The address that receives fees.
pub fee_collector: Pubkey,
// The fee rate taken for each swap.
pub fee_rate: u64,
/// Number of blocks that can be open for trading at one time.
pub block_limit: u64,
}
impl Config {