use carbon_core::{borsh, CarbonDeserialize};
#[derive(
CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Hash,
)]
#[carbon(discriminator = "0x6d2157c3ff240651")]
pub struct UpdateSpotMarketMarginWeights {
pub initial_asset_weight: u32,
pub maintenance_asset_weight: u32,
pub initial_liability_weight: u32,
pub maintenance_liability_weight: u32,
pub imf_factor: u32,
}
pub struct UpdateSpotMarketMarginWeightsInstructionAccounts {
pub admin: solana_pubkey::Pubkey,
pub state: solana_pubkey::Pubkey,
pub spot_market: solana_pubkey::Pubkey,
}
impl carbon_core::deserialize::ArrangeAccounts for UpdateSpotMarketMarginWeights {
type ArrangedAccounts = UpdateSpotMarketMarginWeightsInstructionAccounts;
fn arrange_accounts(
accounts: &[solana_instruction::AccountMeta],
) -> Option<Self::ArrangedAccounts> {
let [admin, state, spot_market, _remaining @ ..] = accounts else {
return None;
};
Some(UpdateSpotMarketMarginWeightsInstructionAccounts {
admin: admin.pubkey,
state: state.pubkey,
spot_market: spot_market.pubkey,
})
}
}