use anchor_lang::prelude::*;
#[cfg(feature = "local")]
declare_id!("43bYyFn8WBwxXvXh28yQ22SQz1TMY1w5DYnRAzRqpJ1J");
#[cfg(feature = "devnet")]
declare_id!("MDKJQPtnnJob8bJhs8eNXDBuS3Q7RWsbpPNg1FjEXxv");
#[cfg(feature = "mainnet")]
declare_id!("MMkP6WPG4ySTudigPQpKNpranEYBzYRDe8Ua7Dx89Rk");
#[program]
pub mod mayflower {
use super::*;
pub fn tenant_init(_ctx: Context<TenantInitAccounts>, _fee_micro_bps: u32, _permissionless_group_creation: bool) -> Result<()> {
panic!("not implemented")
}
pub fn market_group_init(_ctx: Context<MarketGroupInitAccounts>, _args: MarketGroupInitArgs) -> Result<()> {
panic!("not implemented")
}
pub fn market_group_propose_admin(_ctx: Context<MarketGroupProposeAdminAccounts>, _new_admin: Pubkey) -> Result<MarketGroupProposeAdminEvent> {
panic!("not implemented")
}
pub fn market_group_accept_new_admin(_ctx: Context<MarketGroupAcceptNewAdminAccounts>) -> Result<MarketGroupAcceptNewAdminEvent> {
panic!("not implemented")
}
pub fn market_linear_init(_ctx: Context<MarketLinearInitAccounts>, _market_linear_args: MarketLinearArgs) -> Result<()> {
panic!("not implemented")
}
pub fn market_linear_init_with_dutch(_ctx: Context<MarketLinearInitWithDutchAccounts>, _market_linear_init_with_dutch_args: MarketLinearInitWithDutchArgs) -> Result<()> {
panic!("not implemented")
}
pub fn mint_options(_ctx: Context<MintOptionsAccounts>, _amount: u64) -> Result<MintOptionsEvent> {
panic!("not implemented")
}
pub fn market_group_collect_rev(_ctx: Context<MarketGroupCollectRevAccounts>, _amount: FullOrPartialU64) -> Result<MarketGroupCollectRevEvent> {
panic!("not implemented")
}
pub fn raise_floor_preserve_area(_ctx: Context<RaiseFloorPreserveAreaAccounts>, _new_floor: DecimalSerialized, _new_shoulder_end: u64) -> Result<RaiseFloorFromTriggerEvent> {
panic!("not implemented")
}
pub fn raise_floor_preserve_area_checked(_ctx: Context<RaiseFloorPreserveAreaCheckedAccounts>, _args: RaiseFloorPreserveAreaCheckedArgs) -> Result<RaiseFloorPreserveAreaCheckedEvent> {
panic!("not implemented")
}
pub fn raise_floor_from_excess_liquidity(_ctx: Context<RaiseFloorFromExcessLiquidityAccounts>, _floor_increase_ratio: DecimalSerialized) -> Result<RaiseFloorFromExcessLiquidityEvent> {
panic!("not implemented")
}
pub fn market_flags_change(_ctx: Context<MarketFlagsChangeAccounts>, _new_flags: MarketPermissions) -> Result<MarketFlagsChangeEvent> {
panic!("not implemented")
}
pub fn market_group_change_fees(_ctx: Context<MarketGroupChangeFeesAccounts>, _new_fees: Fees) -> Result<MarketGroupChangeFeesEvent> {
panic!("not implemented")
}
pub fn personal_position_init(_ctx: Context<PersonalPositionInitAccounts>) -> Result<PersonalPositionInitEvent> {
panic!("not implemented")
}
pub fn donate_liquidity(_ctx: Context<DonateLiquidityAccounts>, _amount: u64) -> Result<DonateLiquidityEvent> {
panic!("not implemented")
}
pub fn buy_with_exact_cash_in(_ctx: Context<BuyWithExactCashInAccounts>, _cash_in: u64, _min_token_out: u64) -> Result<BuyEvent> {
panic!("not implemented")
}
pub fn buy_with_exact_cash_in_and_deposit(_ctx: Context<BuyWithExactCashInAndDepositAccounts>, _cash_in: u64, _min_token_out: u64) -> Result<BuyWithExactCashInAndDepositEvent> {
panic!("not implemented")
}
pub fn sell_with_exact_token_in(_ctx: Context<SellWithExactTokenInAccounts>, _amount_in: u64, _cash_out_min: u64) -> Result<SellWithExactTokenInEvent> {
panic!("not implemented")
}
pub fn sell_with_exact_token_in_after_withdraw(_ctx: Context<SellWithExactTokenInAfterWithdrawAccounts>, _amount_in: u64, _cash_out_min: u64) -> Result<SellWithExactTokenInAfterWithdrawEvent> {
panic!("not implemented")
}
pub fn deposit(_ctx: Context<DepositAccounts>, _amount: u64) -> Result<DepositEvent> {
panic!("not implemented")
}
pub fn withdraw(_ctx: Context<WithdrawAccounts>, _amount: u64) -> Result<WithdrawEvent> {
panic!("not implemented")
}
pub fn borrow(_ctx: Context<BorrowAccounts>, _amount: u64) -> Result<BorrowEvent> {
panic!("not implemented")
}
pub fn repay(_ctx: Context<RepayAccounts>, _amount: u64) -> Result<RepayEvent> {
panic!("not implemented")
}
pub fn exercise_options(_ctx: Context<ExerciseOptionsAccounts>, _amount: u64) -> Result<ExerciseOptionsEvent> {
panic!("not implemented")
}
pub fn redeem_at_floor(_ctx: Context<RedeemAtFloorAccounts>, _amount_tokens_in: u64) -> Result<RedeemAtFloorEvent> {
panic!("not implemented")
}
pub fn multi_market_init_with_dutch(_ctx: Context<MultiMarketInitWithDutchAccounts>, _args: MultiMarketInitWithDutchArgs) -> Result<()> {
panic!("not implemented")
}
pub fn raise_floor_preserve_area_checked_multi(_ctx: Context<RaiseFloorPreserveAreaCheckedMultiAccounts>, _args: RaiseFloorPreserveAreaCheckedMultiArgs) -> Result<RaiseFloorPreserveAreaCheckedEvent> {
panic!("not implemented")
}
pub fn buy_with_exact_cash_in_and_deposit_multi(_ctx: Context<BuyWithExactCashInAndDepositMultiAccounts>, _cash_in: u64, _min_token_out: u64) -> Result<BuyWithExactCashInAndDepositEvent> {
panic!("not implemented")
}
pub fn buy_with_exact_cash_in_multi(_ctx: Context<BuyWithExactCashInMultiAccounts>, _cash_in: u64, _min_token_out: u64) -> Result<BuyEvent> {
panic!("not implemented")
}
pub fn realloc_market_meta(_ctx: Context<ReallocMarketMetaAccounts>) -> Result<()> {
panic!("not implemented")
}
}
#[derive(Accounts)]
pub struct TenantInitAccounts<'info> {
#[account(mut, signer)]
pub payer: AccountInfo<'info>,
#[account(signer)]
pub root: AccountInfo<'info>,
#[account(signer)]
pub tenant_seed: AccountInfo<'info>,
#[account(mut)]
pub tenant: AccountInfo<'info>,
pub system_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct MarketGroupInitAccounts<'info> {
#[account(mut, signer)]
pub payer: AccountInfo<'info>,
pub tenant: AccountInfo<'info>,
#[account(signer)]
pub tenant_admin: AccountInfo<'info>,
#[account(signer)]
pub seed: AccountInfo<'info>,
#[account(mut)]
pub market_group: AccountInfo<'info>,
pub system_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct MarketGroupProposeAdminAccounts<'info> {
#[account(mut, signer)]
pub admin: AccountInfo<'info>,
#[account(mut)]
pub market_group: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct MarketGroupAcceptNewAdminAccounts<'info> {
#[account(mut, signer)]
pub new_admin: AccountInfo<'info>,
#[account(mut)]
pub market_group: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct MarketLinearInitAccounts<'info> {
#[account(mut, signer)]
pub payer: AccountInfo<'info>,
#[account(mut, signer)]
pub group_admin: AccountInfo<'info>,
#[account(signer)]
pub seed: AccountInfo<'info>,
pub tenant: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub mint_main: AccountInfo<'info>,
pub mint_token: AccountInfo<'info>,
#[account(mut)]
pub mint_options: AccountInfo<'info>,
#[account(mut)]
pub liq_vault_main: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_group: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_tenant: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub market_meta: AccountInfo<'info>,
pub system_program: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
pub token_program_main: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct MarketLinearInitWithDutchAccounts<'info> {
#[account(mut, signer)]
pub payer: AccountInfo<'info>,
#[account(mut, signer)]
pub group_admin: AccountInfo<'info>,
#[account(signer)]
pub seed: AccountInfo<'info>,
pub tenant: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub mint_main: AccountInfo<'info>,
pub mint_token: AccountInfo<'info>,
#[account(mut)]
pub mint_options: AccountInfo<'info>,
#[account(mut)]
pub liq_vault_main: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_group: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_tenant: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub market_meta: AccountInfo<'info>,
pub system_program: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
pub token_program_main: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct MintOptionsAccounts<'info> {
#[account(mut, signer)]
pub admin: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
#[account(mut)]
pub mint_options: AccountInfo<'info>,
#[account(mut)]
pub options_dst: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct MarketGroupCollectRevAccounts<'info> {
#[account(mut, signer)]
pub group_admin: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
pub mint_main: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_group: AccountInfo<'info>,
#[account(mut)]
pub rev_dst: AccountInfo<'info>,
pub token_program_main: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct RaiseFloorPreserveAreaAccounts<'info> {
#[account(mut, signer)]
pub admin: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct RaiseFloorPreserveAreaCheckedAccounts<'info> {
#[account(mut, signer)]
pub admin: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct RaiseFloorFromExcessLiquidityAccounts<'info> {
#[account(mut, signer)]
pub admin: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct MarketFlagsChangeAccounts<'info> {
#[account(mut, signer)]
pub admin: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
#[account(mut)]
pub market_meta: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct MarketGroupChangeFeesAccounts<'info> {
#[account(mut, signer)]
pub admin: AccountInfo<'info>,
#[account(mut)]
pub market_group: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct PersonalPositionInitAccounts<'info> {
#[account(mut, signer)]
pub payer: AccountInfo<'info>,
pub owner: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
pub mint_token: AccountInfo<'info>,
#[account(mut)]
pub personal_position: AccountInfo<'info>,
#[account(mut)]
pub escrow: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
pub system_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct DonateLiquidityAccounts<'info> {
#[account(mut, signer)]
pub payer: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub main_src: AccountInfo<'info>,
#[account(mut)]
pub liq_vault_main: AccountInfo<'info>,
pub mint_main: AccountInfo<'info>,
pub token_program_main: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct BuyWithExactCashInAccounts<'info> {
#[account(mut, signer)]
pub signer: AccountInfo<'info>,
pub tenant: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub mint_token: AccountInfo<'info>,
pub mint_main: AccountInfo<'info>,
#[account(mut)]
pub token_dst: AccountInfo<'info>,
#[account(mut)]
pub main_src: AccountInfo<'info>,
#[account(mut)]
pub liq_vault_main: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_group: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_tenant: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
pub token_program_main: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct BuyWithExactCashInAndDepositAccounts<'info> {
#[account(mut, signer)]
pub owner: AccountInfo<'info>,
pub tenant: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub personal_position: AccountInfo<'info>,
#[account(mut)]
pub escrow: AccountInfo<'info>,
#[account(mut)]
pub mint_token: AccountInfo<'info>,
pub mint_main: AccountInfo<'info>,
#[account(mut)]
pub token_dst: AccountInfo<'info>,
#[account(mut)]
pub main_src: AccountInfo<'info>,
#[account(mut)]
pub liq_vault_main: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_group: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_tenant: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
pub token_program_main: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct SellWithExactTokenInAccounts<'info> {
#[account(mut, signer)]
pub user: AccountInfo<'info>,
pub tenant: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_group: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_tenant: AccountInfo<'info>,
#[account(mut)]
pub liq_vault_main: AccountInfo<'info>,
#[account(mut)]
pub mint_token: AccountInfo<'info>,
pub mint_main: AccountInfo<'info>,
#[account(mut)]
pub main_dst: AccountInfo<'info>,
#[account(mut)]
pub token_src: AccountInfo<'info>,
pub token_program_main: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct SellWithExactTokenInAfterWithdrawAccounts<'info> {
#[account(mut, signer)]
pub owner: AccountInfo<'info>,
pub tenant: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub personal_position: AccountInfo<'info>,
#[account(mut)]
pub liq_vault_main: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_group: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_tenant: AccountInfo<'info>,
#[account(mut)]
pub mint_token: AccountInfo<'info>,
pub mint_main: AccountInfo<'info>,
#[account(mut)]
pub main_dst: AccountInfo<'info>,
#[account(mut)]
pub token_src: AccountInfo<'info>,
#[account(mut)]
pub escrow: AccountInfo<'info>,
pub token_program_main: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct DepositAccounts<'info> {
#[account(mut, signer)]
pub payer: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
pub mint_token: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub personal_position: AccountInfo<'info>,
#[account(mut)]
pub escrow: AccountInfo<'info>,
#[account(mut)]
pub token_src: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct WithdrawAccounts<'info> {
#[account(mut, signer)]
pub owner: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
pub mint_token: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub personal_position: AccountInfo<'info>,
#[account(mut)]
pub escrow: AccountInfo<'info>,
#[account(mut)]
pub token_dst: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct BorrowAccounts<'info> {
#[account(mut, signer)]
pub owner: AccountInfo<'info>,
pub tenant: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub liq_vault_main: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_group: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_tenant: AccountInfo<'info>,
pub mint_main: AccountInfo<'info>,
#[account(mut)]
pub main_dst: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub personal_position: AccountInfo<'info>,
pub token_program_main: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct RepayAccounts<'info> {
#[account(mut, signer)]
pub repayer: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub personal_position: AccountInfo<'info>,
pub mint_main: AccountInfo<'info>,
#[account(mut)]
pub main_src: AccountInfo<'info>,
#[account(mut)]
pub liq_vault_main: AccountInfo<'info>,
pub token_program_main: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct ExerciseOptionsAccounts<'info> {
#[account(mut, signer)]
pub payer: AccountInfo<'info>,
pub tenant: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub main_src: AccountInfo<'info>,
#[account(mut)]
pub options_src: AccountInfo<'info>,
#[account(mut)]
pub token_dst: AccountInfo<'info>,
#[account(mut)]
pub liq_vault_main: AccountInfo<'info>,
#[account(mut)]
pub mint_options: AccountInfo<'info>,
#[account(mut)]
pub mint_token: AccountInfo<'info>,
pub mint_main: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_tenant: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_group: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
pub token_program_main: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct RedeemAtFloorAccounts<'info> {
#[account(mut, signer)]
pub payer: AccountInfo<'info>,
pub tenant: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_group: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_tenant: AccountInfo<'info>,
#[account(mut)]
pub liq_vault_main: AccountInfo<'info>,
#[account(mut)]
pub mint_token: AccountInfo<'info>,
pub mint_main: AccountInfo<'info>,
#[account(mut)]
pub main_dst: AccountInfo<'info>,
#[account(mut)]
pub token_src: AccountInfo<'info>,
pub token_program_main: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct MultiMarketInitWithDutchAccounts<'info> {
#[account(mut, signer)]
pub payer: AccountInfo<'info>,
#[account(signer)]
pub group_admin: AccountInfo<'info>,
#[account(signer)]
pub seed: AccountInfo<'info>,
pub tenant: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub mint_main: AccountInfo<'info>,
pub mint_token: AccountInfo<'info>,
#[account(mut)]
pub mint_options: AccountInfo<'info>,
#[account(mut)]
pub liq_vault_main: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_group: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_tenant: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub market_meta: AccountInfo<'info>,
pub system_program: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
pub token_program_main: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct RaiseFloorPreserveAreaCheckedMultiAccounts<'info> {
#[account(mut, signer)]
pub admin: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct BuyWithExactCashInAndDepositMultiAccounts<'info> {
#[account(mut, signer)]
pub owner: AccountInfo<'info>,
pub tenant: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub personal_position: AccountInfo<'info>,
#[account(mut)]
pub escrow: AccountInfo<'info>,
#[account(mut)]
pub mint_token: AccountInfo<'info>,
pub mint_main: AccountInfo<'info>,
#[account(mut)]
pub token_dst: AccountInfo<'info>,
#[account(mut)]
pub main_src: AccountInfo<'info>,
#[account(mut)]
pub liq_vault_main: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_group: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_tenant: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
pub token_program_main: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct BuyWithExactCashInMultiAccounts<'info> {
#[account(mut, signer)]
pub signer: AccountInfo<'info>,
pub tenant: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub mint_token: AccountInfo<'info>,
pub mint_main: AccountInfo<'info>,
#[account(mut)]
pub token_dst: AccountInfo<'info>,
#[account(mut)]
pub main_src: AccountInfo<'info>,
#[account(mut)]
pub liq_vault_main: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_group: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_tenant: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
pub token_program_main: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct ReallocMarketMetaAccounts<'info> {
#[account(mut, signer)]
pub payer: AccountInfo<'info>,
#[account(mut)]
pub market_meta: AccountInfo<'info>,
pub system_program: AccountInfo<'info>,
}
#[account]
pub struct MarketGroup {
pub tenant: Pubkey,
pub admin: Pubkey,
pub proposed_admin: Option<Pubkey>,
pub pda_meta: PdaMeta,
pub fees: Fees,
}
#[account]
pub struct MarketLinear {
pub market_meta: Pubkey,
pub state: MarketState,
pub price_curve: LinearPriceCurveSerialized,
}
#[account]
pub struct MarketMeta {
pub mint_main: Pubkey,
pub mint_token: Pubkey,
pub mint_options: Pubkey,
pub market_group: Pubkey,
pub market: Pubkey,
pub token_program_main: Pubkey,
pub liq_vault_main: Pubkey,
pub rev_escrow_group: Pubkey,
pub rev_escrow_tenant: Pubkey,
pub pda_meta: PdaMeta,
pub decimals: u8,
pub permissions: MarketPermissions,
pub start_time: u32,
pub dutch_config: DutchConfigSerialized,
}
#[account]
pub struct MarketMultiCurve {
pub market_meta: Pubkey,
pub state: MarketState,
pub price_curve: MultiPriceCurveSerialized,
}
#[account]
pub struct PersonalPosition {
pub market_meta: Pubkey,
pub owner: Pubkey,
pub escrow: Pubkey,
pub deposited_token_balance: u64,
pub debt: u64,
pub bump: [u8; 1],
}
#[account]
pub struct Tenant {
pub seed: Pubkey,
pub bump: [u8; 1],
pub admin: Pubkey,
pub proposed_admin: Option<Pubkey>,
pub platform_fee_micro_bps: u32,
pub permissionless_group_creation: bool,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct BuyWithExactCashInAndDepositEvent {
pub trader: Pubkey,
pub market_meta: Pubkey,
pub personal_position: Pubkey,
pub token_out: u64,
pub new_personal_position_balance: u64,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct MarketGroupInitArgs {
pub fees: Fees,
pub group_admin: Pubkey,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct MarketLinearInitWithDutchArgs {
pub x2: u64,
pub m2: DecimalSerialized,
pub m1: DecimalSerialized,
pub f: DecimalSerialized,
pub b2: DecimalSerialized,
pub start_time: u32,
pub dutch_config: DutchConfigSerialized,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct MarketLinearArgs {
pub x2: u64,
pub m2: DecimalSerialized,
pub m1: DecimalSerialized,
pub f: DecimalSerialized,
pub b2: DecimalSerialized,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct MultiMarketInitWithDutchArgs {
pub shoulder_slope_scalar: f64,
pub main_slope: f64,
pub f: f32,
pub start_time: u32,
pub dutch_config: DutchConfigSerialized,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct RaiseFloorPreserveAreaCheckedMultiArgs {
pub floor_increase_ratio: DecimalSerialized,
pub new_shoulder_end: u64,
pub min_liq_ratio: DecimalSerialized,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct RaiseFloorPreserveAreaCheckedArgs {
pub floor_increase_ratio: DecimalSerialized,
pub new_shoulder_end: u64,
pub min_liq_ratio: DecimalSerialized,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct SellWithExactTokenInAfterWithdrawEvent {
pub trader: Pubkey,
pub market_meta: Pubkey,
pub token_in: u64,
pub actual_cash_out: u64,
pub fee_platform: u64,
pub fee_market_group: u64,
pub new_token_balance: u64,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct DecimalSerialized {
pub val: [u8; 16],
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct PdaMeta {
pub bump: [u8; 1],
pub seed: Pubkey,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct Fees {
pub buy: u32,
pub sell: u32,
pub borrow: u32,
pub exercise_option: u32,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct LinearPriceCurveSerialized {
pub floor: [u8; 16],
pub m1: [u8; 16],
pub m2: [u8; 16],
pub x2: u64,
pub b2: [u8; 16],
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct MarketPermissions {
pub val: u16,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct DutchConfigSerialized {
pub init_boost: f64,
pub duration: u32,
pub curvature: f64,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct MultiPriceCurveSerialized {
pub floor: [u8; 16],
pub floor_end: u64,
pub shoulder_slope_scalar: [u8; 16],
pub middle_vertices: Vec<Vertex>,
pub final_vertex: Vertex,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct Vertex {
pub x: u64,
pub m: [u8; 16],
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct MarketState {
pub token_supply: u64,
pub total_cash_liquidity: u64,
pub total_debt: u64,
pub total_collateral: u64,
pub cumulative_revenue_market: u128,
pub cumulative_revenue_tenant: u128,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub enum MarketPermission {
CanBuy,
CanSell,
CanBorrow,
CanRepay,
CanMintOptions,
CanExerciseOptions,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub enum FullOrPartialU64 {
Full,
Partial(u64),
}
pub type MicroBasisPoints = u32;
#[event]
pub struct BorrowEvent {
pub market_meta: Pubkey,
pub personal_position: Pubkey,
pub fee_market_group: u64,
pub fee_tenant: u64,
pub net_cash_out: u64,
}
#[event]
pub struct BuyEvent {
pub trader: Pubkey,
pub market_meta: Pubkey,
pub token_out: u64,
pub net_cash_in: u64,
pub fee_market: u64,
pub fee_tenant: u64,
}
#[event]
pub struct DepositEvent {
pub payer: Pubkey,
pub market: Pubkey,
pub personal_position: Pubkey,
pub amount: u64,
pub new_balance: u64,
}
#[event]
pub struct DonateLiquidityEvent {
pub payer: Pubkey,
pub market: Pubkey,
pub new_cash_balance: u64,
pub amount: u64,
}
#[event]
pub struct ExerciseOptionsEvent {
pub owner: Pubkey,
pub market_meta: Pubkey,
pub amount: u64,
pub fee_tenant: u64,
pub fee_market: u64,
}
#[event]
pub struct MarketFlagsChangeEvent {
pub market_meta: Pubkey,
pub new_flags: MarketPermissions,
}
#[event]
pub struct MarketGroupAcceptNewAdminEvent {
pub market_group: Pubkey,
pub new_admin: Pubkey,
}
#[event]
pub struct MarketGroupChangeFeesEvent {
pub market_group: Pubkey,
pub new_fees: Fees,
}
#[event]
pub struct MarketGroupCollectRevEvent {
pub market_meta: Pubkey,
pub amount: u64,
pub to: Pubkey,
}
#[event]
pub struct MarketGroupInitialized {
pub tenant: Pubkey,
pub market_group_seed: Pubkey,
pub group_admin: Pubkey,
pub fees: Fees,
}
#[event]
pub struct MarketGroupProposeAdminEvent {
pub market_group: Pubkey,
pub new_admin: Pubkey,
}
#[event]
pub struct MintOptionsEvent {
pub market_meta: Pubkey,
pub amount: u64,
}
#[event]
pub struct PersonalPositionInitEvent {
pub market_meta: Pubkey,
pub payer: Pubkey,
pub owner: Pubkey,
pub personal_position: Pubkey,
}
#[event]
pub struct RaiseFloorFromExcessLiquidityEvent {
pub market_meta: Pubkey,
pub new_floor: DecimalSerialized,
}
#[event]
pub struct RaiseFloorFromTriggerEvent {
pub market: Pubkey,
pub new_floor: DecimalSerialized,
pub new_shoulder_end: u64,
pub new_area: u64,
pub prev_area: u64,
}
#[event]
pub struct RaiseFloorPreserveAreaCheckedEvent {
pub new_floor: DecimalSerialized,
pub new_shoulder_end: u64,
pub new_liq_ratio: DecimalSerialized,
}
#[event]
pub struct RedeemAtFloorEvent {
pub trader: Pubkey,
pub market_meta: Pubkey,
pub token_in: u64,
pub fee_platform: u64,
pub fee_market_group: u64,
pub net_cash_out: u64,
}
#[event]
pub struct RepayEvent {
pub repayer: Pubkey,
pub market: Pubkey,
pub amount: u64,
pub new_debt: u64,
}
#[event]
pub struct SellWithExactTokenInEvent {
pub trader: Pubkey,
pub market_meta: Pubkey,
pub token_in: u64,
pub actual_cash_out: u64,
pub fee_platform: u64,
pub fee_market_group: u64,
}
#[event]
pub struct TenantInitialized {
pub tenant_seed: Pubkey,
pub admin: Pubkey,
pub fee_micro_bps: u32,
pub permissionless_group_creation: bool,
}
#[event]
pub struct WithdrawEvent {
pub owner: Pubkey,
pub market_meta: Pubkey,
pub personal_position: Pubkey,
pub amount: u64,
pub new_balance: u64,
}