use anchor_lang::prelude::*;
#[cfg(feature = "local")]
declare_id!("43bYyFn8WBwxXvXh28yQ22SQz1TMY1w5DYnRAzRqpJ1J");
#[cfg(feature = "devnet")]
declare_id!("MD2pPJCjpUT5ttJFUVeP2Xka1ZSvCJMZUoX4XTdPdet");
#[cfg(feature = "mainnet")]
declare_id!("MMkP6WPG4ySTudigPQpKNpranEYBzYRDe8Ua7Dx89Rk");
#[program]
pub mod mayflower {
use super::*;
pub fn version(_ctx: Context<VersionAccounts>) -> Result<()> {
panic!("not implemented")
}
pub fn init_log_account(_ctx: Context<InitLogAccountAccounts>) -> Result<()> {
panic!("not implemented")
}
pub fn receive_log(_ctx: Context<ReceiveLogAccounts>, _log: [u8; 504]) -> Result<()> {
panic!("not implemented")
}
pub fn test_log(_ctx: Context<TestLogAccounts>) -> Result<()> {
panic!("not implemented")
}
pub fn tenant_init(_ctx: Context<TenantInitAccounts>, _fee_micro_bps: u32, _permissionless_group_creation: bool) -> Result<()> {
panic!("not implemented")
}
pub fn tenant_init_with_admin(_ctx: Context<TenantInitWithAdminAccounts>, _fee_micro_bps: u32, _permissionless_group_creation: bool, _admin: Pubkey) -> Result<()> {
panic!("not implemented")
}
pub fn tenant_propose_admin(_ctx: Context<TenantProposeAdminAccounts>, _new_admin: Pubkey) -> Result<TenantProposeAdminEvent> {
panic!("not implemented")
}
pub fn tenant_accept_new_admin(_ctx: Context<TenantAcceptNewAdminAccounts>) -> Result<TenantAcceptNewAdminEvent> {
panic!("not implemented")
}
pub fn tenant_change_fee_mbps(_ctx: Context<TenantChangeFeeMbpsAccounts>, _fee_micro_bps: u32) -> Result<TenantChangeFeeMbpsEvent> {
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 tenant_collect_rev(_ctx: Context<TenantCollectRevAccounts>, _amount: FullOrPartialU64) -> Result<TenantCollectRevEvent> {
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_preserve_area_checked2(_ctx: Context<RaiseFloorPreserveAreaChecked2Accounts>, _args: RaiseFloorPreserveAreaCheckedArgs2) -> Result<RaiseFloorPreserveAreaChecked2Event> {
panic!("not implemented")
}
pub fn raise_floor_from_excess_liquidity(_ctx: Context<RaiseFloorFromExcessLiquidityAccounts>, _floor_increase_ratio: DecimalSerialized) -> Result<RaiseFloorFromExcessLiquidityEvent> {
panic!("not implemented")
}
pub fn raise_floor_from_excess_liquidity_checked(_ctx: Context<RaiseFloorFromExcessLiquidityCheckedAccounts>, _args: RaiseFloorFromExcessLiquidityCheckedArgs) -> Result<RaiseFloorFromExcessLiquidity2Event> {
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 donate_liquidity2(_ctx: Context<DonateLiquidity2Accounts>, _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 buy_with_exact_cash_in_and_deposit_with_debt(_ctx: Context<BuyWithExactCashInAndDepositWithDebtAccounts>, _args: BuyWithExactCashInAndDepositWithDebtArgs) -> Result<BuyWithExactCashInAndDepositWithDebtEvent> {
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 sell_with_exact_token_in_multi(_ctx: Context<SellWithExactTokenInMultiAccounts>, _amount_in: u64, _cash_out_min: u64) -> Result<SellWithExactTokenInEvent> {
panic!("not implemented")
}
pub fn exercise_options_multi(_ctx: Context<ExerciseOptionsMultiAccounts>, _amount: u64) -> Result<ExerciseOptionsEvent> {
panic!("not implemented")
}
pub fn repay_multi(_ctx: Context<RepayMultiAccounts>, _amount: u64) -> Result<RepayEvent> {
panic!("not implemented")
}
pub fn redeem_at_floor_multi(_ctx: Context<RedeemAtFloorMultiAccounts>, _amount_tokens_in: u64) -> Result<RedeemAtFloorEvent> {
panic!("not implemented")
}
pub fn modify_curve_multi(_ctx: Context<ModifyCurveMultiAccounts>, _args: ModifyCurveArgs) -> Result<()> {
panic!("not implemented")
}
}
#[derive(Accounts)]
pub struct VersionAccounts<'info> {
#[account(mut, signer)]
pub payer: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct InitLogAccountAccounts<'info> {
#[account(mut, signer)]
pub payer: AccountInfo<'info>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub system_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct ReceiveLogAccounts<'info> {
#[account(mut, signer)]
pub log_account: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct TestLogAccounts<'info> {
#[account(mut, signer)]
pub payer: AccountInfo<'info>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub self_program: AccountInfo<'info>,
}
#[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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct TenantInitWithAdminAccounts<'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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct TenantProposeAdminAccounts<'info> {
#[account(mut, signer)]
pub admin: AccountInfo<'info>,
#[account(mut)]
pub tenant: AccountInfo<'info>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct TenantAcceptNewAdminAccounts<'info> {
#[account(mut, signer)]
pub new_admin: AccountInfo<'info>,
#[account(mut)]
pub tenant: AccountInfo<'info>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct TenantChangeFeeMbpsAccounts<'info> {
#[account(mut, signer)]
pub payer: AccountInfo<'info>,
#[account(signer)]
pub root: AccountInfo<'info>,
#[account(mut)]
pub tenant: AccountInfo<'info>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct MarketGroupProposeAdminAccounts<'info> {
#[account(mut, signer)]
pub admin: AccountInfo<'info>,
#[account(mut)]
pub market_group: AccountInfo<'info>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct MarketGroupAcceptNewAdminAccounts<'info> {
#[account(mut, signer)]
pub new_admin: AccountInfo<'info>,
#[account(mut)]
pub market_group: AccountInfo<'info>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: 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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: 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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: 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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct TenantCollectRevAccounts<'info> {
#[account(mut, signer)]
pub root: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
pub mint_main: AccountInfo<'info>,
#[account(mut)]
pub rev_escrow_tenant: AccountInfo<'info>,
#[account(mut)]
pub rev_dst: AccountInfo<'info>,
pub token_program_main: AccountInfo<'info>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: 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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: 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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct RaiseFloorPreserveAreaChecked2Accounts<'info> {
#[account(mut, signer)]
pub admin: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: 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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct RaiseFloorFromExcessLiquidityCheckedAccounts<'info> {
#[account(mut, signer)]
pub admin: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: 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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct MarketGroupChangeFeesAccounts<'info> {
#[account(mut, signer)]
pub admin: AccountInfo<'info>,
#[account(mut)]
pub market_group: AccountInfo<'info>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: 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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_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 DonateLiquidity2Accounts<'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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: 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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: 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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct BuyWithExactCashInAndDepositWithDebtAccounts<'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 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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: 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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: 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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: 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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: 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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: 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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct SellWithExactTokenInMultiAccounts<'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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct ExerciseOptionsMultiAccounts<'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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct RepayMultiAccounts<'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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct RedeemAtFloorMultiAccounts<'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>,
#[account(mut)]
pub log_account: AccountInfo<'info>,
pub mayflower_program: AccountInfo<'info>,
}
#[derive(Accounts)]
pub struct ModifyCurveMultiAccounts<'info> {
#[account(mut, signer)]
pub payer: AccountInfo<'info>,
#[account(mut, signer)]
pub admin: AccountInfo<'info>,
pub market_group: AccountInfo<'info>,
pub market_meta: AccountInfo<'info>,
#[account(mut)]
pub market: AccountInfo<'info>,
pub system_program: AccountInfo<'info>,
}
#[account]
pub struct LogAccount {
pub counter: u64,
pub bump: [u8; 1],
}
#[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: u64,
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 net_cash_in: u64,
pub fee_market_group: u64,
pub fee_platform: u64,
pub new_market_price: DecimalSerialized,
pub new_personal_position_balance: u64,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct MarketStateSnapshot {
pub market_metadata_address: Pubkey,
pub total_market_deposited_collateral: u64,
pub total_main_token_in_liquidity_pool: u64,
pub total_market_debt: u64,
pub floor_price: DecimalSerialized,
pub market_price: DecimalSerialized,
pub area_under_curve: u64,
pub token_supply: u64,
pub unix_timestamp: u64,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct SellWithExactTokenInAfterWithdrawEvent {
pub trader: Pubkey,
pub market_meta: Pubkey,
pub token_in: u64,
pub net_cash_out: u64,
pub fee_platform: u64,
pub fee_market_group: u64,
pub new_personal_position_balance: u64,
pub personal_position: Pubkey,
pub new_market_price: DecimalSerialized,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct ModifyCurveArgs {
pub multiplier: f32,
pub new_middle_segment_count: u8,
pub increase: bool,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct MultiMarketInitWithDutchArgs {
pub shoulder_slope_scalar: f64,
pub main_slope: f64,
pub f: f32,
pub start_time: u64,
pub dutch_config: DutchConfigSerialized,
pub permissions: MarketPermissions,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct RaiseFloorPreserveAreaCheckedMultiArgs {
pub floor_increase_ratio: DecimalSerialized,
pub new_shoulder_end: u64,
pub min_liq_ratio: DecimalSerialized,
pub must_backtrack: bool,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct BuyWithExactCashInAndDepositWithDebtArgs {
pub exact_cash_in: u64,
pub min_token_received: u64,
pub new_acquired_debt: u64,
}
#[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: u64,
pub dutch_config: DutchConfigSerialized,
pub permissions: MarketPermissions,
}
#[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 RaiseFloorFromExcessLiquidityCheckedArgs {
pub max_new_floor: DecimalSerialized,
pub increase_ratio_micro_basis_points: u32,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct RaiseFloorPreserveAreaCheckedArgs2 {
pub new_floor: DecimalSerialized,
pub new_shoulder_end: u64,
pub min_liq_ratio: DecimalSerialized,
pub max_area_shrinkage_tolerance_units: u64,
}
#[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 MarketGroupInitArgs {
pub fees: Fees,
pub group_admin: Pubkey,
}
#[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 SegmentSerialized {
pub start: [u8; 16],
pub end: [u8; 16],
pub m: [u8; 16],
pub b: [u8; 16],
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub struct MultiPriceCurveSerialized {
pub floor_height: [u8; 16],
pub shoulder_slope_scalar: [u8; 16],
pub middle_segments: Vec<SegmentSerialized>,
pub final_segment: SegmentSerialized,
}
#[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 MultiMarketInitValidationError {
ShoulderSlopeScalarNotGreaterThanOne,
ShoulderSlopeScalarNotFinite,
MainSlopeNotPositive,
MainSlopeNotFinite,
FloorNotPositive,
FloorNotFinite,
DutchConfigValidationError(),
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub enum MarketLinearInitValidationError {
M2MustBeGreaterThanZero,
M1MustBeGreaterThanM2,
FMustBeGreaterThanZero,
InvalidCurveParameters,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub enum MarketPermission {
CanBuy,
CanSell,
CanBorrow,
CanRepay,
CanMintOptions,
CanExerciseOptions,
CanRaiseFloor,
CanDepositCollateral,
CanWithdrawCollateral,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub enum DutchConfigValidationError {
InitBoostNotPositive,
CurvatureZero,
InitBoostInfinity,
InitBoostNaN,
CurvatureInfinity,
CurvatureNaN,
InitBoostTooLarge,
CurvatureTooLarge,
DurationZero,
}
#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]
pub enum FullOrPartialU64 {
Full,
Partial(u64),
}
pub type MicroBasisPoints = u32;
#[event]
pub struct BorrowEvent {
pub fee_market_group: u64,
pub fee_tenant: u64,
pub net_cash_out: u64,
pub new_debt: u64,
pub personal_position_owner: Pubkey,
pub personal_position_address: Pubkey,
pub market_state_snapshot: MarketStateSnapshot,
}
#[event]
pub struct BuyEvent {
pub trader: Pubkey,
pub token_out: u64,
pub net_cash_in: u64,
pub fee_market_group: u64,
pub fee_tenant: u64,
pub market_state_snapshot: MarketStateSnapshot,
}
#[event]
pub struct DepositEvent {
pub payer: Pubkey,
pub personal_position_address: Pubkey,
pub amount: u64,
pub new_balance: u64,
pub market_state_snapshot: MarketStateSnapshot,
}
#[event]
pub struct ExerciseOptionsEvent {
pub owner: Pubkey,
pub amount: u64,
pub fee_tenant: u64,
pub fee_market_group: u64,
pub market_state_snapshot: MarketStateSnapshot,
}
#[event]
pub struct RedeemAtFloorEvent {
pub trader: Pubkey,
pub token_in: u64,
pub fee_platform: u64,
pub fee_market_group: u64,
pub net_cash_out: u64,
pub market_state_snapshot: MarketStateSnapshot,
}
#[event]
pub struct RepayEvent {
pub repayer: Pubkey,
pub personal_position_owner: Pubkey,
pub personal_position_address: Pubkey,
pub amount: u64,
pub new_debt: u64,
pub market_state_snapshot: MarketStateSnapshot,
}
#[event]
pub struct SellWithExactTokenInEvent {
pub trader: Pubkey,
pub token_in: u64,
pub actual_cash_out: u64,
pub fee_platform: u64,
pub fee_market_group: u64,
pub market_state_snapshot: MarketStateSnapshot,
}
#[event]
pub struct WithdrawEvent {
pub personal_position_owner: Pubkey,
pub personal_position_address: Pubkey,
pub amount: u64,
pub new_balance: u64,
pub market_state_snapshot: MarketStateSnapshot,
}
#[event]
pub struct BuyWithExactCashInAndDepositWithDebtEvent {
pub market_meta: Pubkey,
pub personal_position_owner: Pubkey,
pub personal_position: Pubkey,
pub net_cash_spent: u64,
pub trader_cash_spend: u64,
pub new_acquired_debt: u64,
pub token_out: u64,
pub new_personal_position_collateral: u64,
pub new_personal_position_debt: u64,
pub fee_market_group_borrow: u64,
pub fee_market_group_buy: u64,
pub fee_platform_borrow: u64,
pub fee_platform_buy: u64,
pub market_state_snapshot: MarketStateSnapshot,
}
#[event]
pub struct DonateLiquidityEvent {
pub payer: Pubkey,
pub market_meta: Pubkey,
pub new_cash_balance: u64,
pub amount: u64,
}
#[event]
pub struct MarketLinearInitEvent {
pub market_meta: Pubkey,
pub market_state: Pubkey,
pub group: Pubkey,
}
#[event]
pub struct RaiseFloorFromExcessLiquidity2Event {
pub market_meta: Pubkey,
pub prev_floor: DecimalSerialized,
pub new_floor: DecimalSerialized,
pub new_area_under_curve: u64,
pub prev_area_under_curve: u64,
pub total_liquidity: u64,
}
#[event]
pub struct RaiseFloorFromExcessLiquidityEvent {
pub market_meta: Pubkey,
pub new_floor: DecimalSerialized,
pub new_area_under_curve: u64,
}
#[event]
pub struct RaiseFloorFromTriggerEvent {
pub market_meta: Pubkey,
pub new_floor: DecimalSerialized,
pub new_shoulder_end: u64,
pub new_area: u64,
pub prev_area: u64,
}
#[event]
pub struct RaiseFloorPreserveAreaChecked2Event {
pub market_meta: Pubkey,
pub new_floor: DecimalSerialized,
pub new_shoulder_end: u64,
pub new_liq_ratio: DecimalSerialized,
pub prev_area: u64,
pub new_area: u64,
}
#[event]
pub struct RaiseFloorPreserveAreaCheckedEvent {
pub new_floor: DecimalSerialized,
pub new_shoulder_end: u64,
pub new_liq_ratio: DecimalSerialized,
}
#[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 options_dst: 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 TenantAcceptNewAdminEvent {
pub tenant: Pubkey,
pub new_admin: Pubkey,
}
#[event]
pub struct TenantChangeFeeMbpsEvent {
pub tenant: Pubkey,
pub fee_micro_bps: u32,
}
#[event]
pub struct TenantCollectRevEvent {
pub market_meta: Pubkey,
pub amount: u64,
pub to: Pubkey,
}
#[event]
pub struct TenantInitialized {
pub tenant_seed: Pubkey,
pub admin: Pubkey,
pub fee_micro_bps: u32,
pub permissionless_group_creation: bool,
}
#[event]
pub struct TenantProposeAdminEvent {
pub tenant: Pubkey,
pub new_admin: Pubkey,
}
#[event]
pub struct TestLogEvent {
pub payer: Pubkey,
pub log_account: Pubkey,
pub data: u64,
}