//! This code was AUTOGENERATED using the codama library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun codama to update it.
//!
//! <https://github.com/codama-idl/codama>
//!
syntax = "proto3";

package vixen.parser.raydium_amm_v4;

message InitializeIx {
	InitializeIxAccounts accounts = 1;
	InitializeIxData data = 2;
}

message Initialize2Ix {
	Initialize2IxAccounts accounts = 1;
	Initialize2IxData data = 2;
}

message MonitorStepIx {
	MonitorStepIxAccounts accounts = 1;
	MonitorStepIxData data = 2;
}

message DepositIx {
	DepositIxAccounts accounts = 1;
	DepositIxData data = 2;
}

message WithdrawIx {
	WithdrawIxAccounts accounts = 1;
	WithdrawIxData data = 2;
}

message MigrateToOpenBookIx {
	MigrateToOpenBookIxAccounts accounts = 1;
}

message SetParamsIx {
	SetParamsIxAccounts accounts = 1;
	SetParamsIxData data = 2;
}

message WithdrawPnlIx {
	WithdrawPnlIxAccounts accounts = 1;
}

message WithdrawSrmIx {
	WithdrawSrmIxAccounts accounts = 1;
	WithdrawSrmIxData data = 2;
}

message SwapBaseInIx {
	SwapBaseInIxAccounts accounts = 1;
	SwapBaseInIxData data = 2;
}

message PreInitializeIx {
	PreInitializeIxAccounts accounts = 1;
	PreInitializeIxData data = 2;
}

message SwapBaseOutIx {
	SwapBaseOutIxAccounts accounts = 1;
	SwapBaseOutIxData data = 2;
}

message SimulateInfoIx {
	SimulateInfoIxAccounts accounts = 1;
	SimulateInfoIxData data = 2;
}

message AdminCancelOrdersIx {
	AdminCancelOrdersIxAccounts accounts = 1;
	AdminCancelOrdersIxData data = 2;
}

message CreateConfigAccountIx {
	CreateConfigAccountIxAccounts accounts = 1;
}

message UpdateConfigAccountIx {
	UpdateConfigAccountIxAccounts accounts = 1;
	UpdateConfigAccountIxData data = 2;
}


message WithdrawDestToken {
	uint64 withdraw_amount = 1;
	uint64 coin_amount = 2;
	uint64 pc_amount = 3;
	string dest_token_coin = 4;
	string dest_token_pc = 5;
}

message WithdrawQueue {
	repeated uint64 owner = 1;
	uint64 head = 2;
	uint64 count = 3;
	repeated WithdrawDestToken buf = 4;
}

message TargetOrder {
	uint64 price = 1;
	uint64 vol = 2;
}

message OutPutData {
	uint64 need_take_pnl_coin = 1;
	uint64 need_take_pnl_pc = 2;
	uint64 total_pnl_pc = 3;
	uint64 total_pnl_coin = 4;
	uint64 pool_open_time = 5;
	uint64 punish_pc_amount = 6;
	uint64 punish_coin_amount = 7;
	uint64 orderbook_to_init_time = 8;
	string swap_coin_in_amount = 9;
	string swap_pc_out_amount = 10;
	uint64 swap_take_pc_fee = 11;
	string swap_pc_in_amount = 12;
	string swap_coin_out_amount = 13;
	uint64 swap_take_coin_fee = 14;
}

message LastOrderDistance {
	uint64 last_order_numerator = 1;
	uint64 last_order_denominator = 2;
}

message NeedTake {
	uint64 need_take_pc = 1;
	uint64 need_take_coin = 2;
}

message SwapInstructionBaseIn {
	uint64 amount_in = 1;
	uint64 minimum_amount_out = 2;
}

message SwapInstructionBaseOut {
	uint64 max_amount_in = 1;
	uint64 amount_out = 2;
}

message Fees {
	uint64 min_separate_numerator = 1;
	uint64 min_separate_denominator = 2;
	uint64 trade_fee_numerator = 3;
	uint64 trade_fee_denominator = 4;
	uint64 pnl_numerator = 5;
	uint64 pnl_denominator = 6;
	uint64 swap_fee_numerator = 7;
	uint64 swap_fee_denominator = 8;
}


message TargetOrders {
	repeated uint64 owner = 1;
	repeated TargetOrder buy_orders = 2;
	repeated uint64 padding1 = 3;
	string target_x = 4;
	string target_y = 5;
	string plan_x_buy = 6;
	string plan_y_buy = 7;
	string plan_x_sell = 8;
	string plan_y_sell = 9;
	string placed_x = 10;
	string placed_y = 11;
	string calc_pnl_x = 12;
	string calc_pnl_y = 13;
	repeated TargetOrder sell_orders = 14;
	repeated uint64 padding2 = 15;
	repeated uint64 replace_buy_client_id = 16;
	repeated uint64 replace_sell_client_id = 17;
	uint64 last_order_numerator = 18;
	uint64 last_order_denominator = 19;
	uint64 plan_orders_cur = 20;
	uint64 place_orders_cur = 21;
	uint64 valid_buy_order_num = 22;
	uint64 valid_sell_order_num = 23;
	repeated uint64 padding3 = 24;
	string free_slot_bits = 25;
}

message AmmInfo {
	uint64 status = 1;
	uint64 nonce = 2;
	uint64 order_num = 3;
	uint64 depth = 4;
	uint64 coin_decimals = 5;
	uint64 pc_decimals = 6;
	uint64 state = 7;
	uint64 reset_flag = 8;
	uint64 min_size = 9;
	uint64 vol_max_cut_ratio = 10;
	uint64 amount_wave = 11;
	uint64 coin_lot_size = 12;
	uint64 pc_lot_size = 13;
	uint64 min_price_multiplier = 14;
	uint64 max_price_multiplier = 15;
	uint64 sys_decimal_value = 16;
	Fees fees = 17;
	OutPutData out_put = 18;
	string token_coin = 19;
	string token_pc = 20;
	string coin_mint = 21;
	string pc_mint = 22;
	string lp_mint = 23;
	string open_orders = 24;
	string market = 25;
	string serum_dex = 26;
	string target_orders = 27;
	string withdraw_queue = 28;
	string token_temp_lp = 29;
	string amm_owner = 30;
	uint64 lp_amount = 31;
	uint64 client_order_id = 32;
	repeated uint64 padding = 33;
}

message AmmConfig {
	string pnl_owner = 1;
	string cancel_owner = 2;
	repeated uint64 pending1 = 3;
	repeated uint64 pending2 = 4;
	uint64 create_pool_fee = 5;
}


message InitializeIxAccounts {
	string token_program = 1;
	string system_program = 2;
	string rent = 3;
	string amm = 4;
	string amm_authority = 5;
	string amm_open_orders = 6;
	string lp_mint_address = 7;
	string coin_mint_address = 8;
	string pc_mint_address = 9;
	string pool_coin_token_account = 10;
	string pool_pc_token_account = 11;
	string pool_withdraw_queue = 12;
	string pool_target_orders_account = 13;
	string user_lp_token_account = 14;
	string pool_temp_lp_token_account = 15;
	string serum_program = 16;
	string serum_market = 17;
	string user_wallet = 18;
}

message InitializeIxData {
	uint32 nonce = 1;
	uint64 open_time = 2;
}

message Initialize2IxAccounts {
	string token_program = 1;
	string spl_associated_token_account = 2;
	string system_program = 3;
	string rent = 4;
	string amm = 5;
	string amm_authority = 6;
	string amm_open_orders = 7;
	string lp_mint = 8;
	string coin_mint = 9;
	string pc_mint = 10;
	string pool_coin_token_account = 11;
	string pool_pc_token_account = 12;
	string pool_withdraw_queue = 13;
	string amm_target_orders = 14;
	string pool_temp_lp = 15;
	string serum_program = 16;
	string serum_market = 17;
	string user_wallet = 18;
	string user_token_coin = 19;
	string user_token_pc = 20;
	string user_lp_token_account = 21;
}

message Initialize2IxData {
	uint32 nonce = 1;
	uint64 open_time = 2;
	uint64 init_pc_amount = 3;
	uint64 init_coin_amount = 4;
}

message MonitorStepIxAccounts {
	string token_program = 1;
	string rent = 2;
	string clock = 3;
	string amm = 4;
	string amm_authority = 5;
	string amm_open_orders = 6;
	string amm_target_orders = 7;
	string pool_coin_token_account = 8;
	string pool_pc_token_account = 9;
	string pool_withdraw_queue = 10;
	string serum_program = 11;
	string serum_market = 12;
	string serum_coin_vault_account = 13;
	string serum_pc_vault_account = 14;
	string serum_vault_signer = 15;
	string serum_req_q = 16;
	string serum_event_q = 17;
	string serum_bids = 18;
	string serum_asks = 19;
}

message MonitorStepIxData {
	uint32 plan_order_limit = 1;
	uint32 place_order_limit = 2;
	uint32 cancel_order_limit = 3;
}

message DepositIxAccounts {
	string token_program = 1;
	string amm = 2;
	string amm_authority = 3;
	string amm_open_orders = 4;
	string amm_target_orders = 5;
	string lp_mint_address = 6;
	string pool_coin_token_account = 7;
	string pool_pc_token_account = 8;
	string serum_market = 9;
	string user_coin_token_account = 10;
	string user_pc_token_account = 11;
	string user_lp_token_account = 12;
	string user_owner = 13;
	string serum_event_queue = 14;
}

message DepositIxData {
	uint64 max_coin_amount = 1;
	uint64 max_pc_amount = 2;
	uint64 base_side = 3;
}

message WithdrawIxAccounts {
	string token_program = 1;
	string amm = 2;
	string amm_authority = 3;
	string amm_open_orders = 4;
	string amm_target_orders = 5;
	string lp_mint_address = 6;
	string pool_coin_token_account = 7;
	string pool_pc_token_account = 8;
	string pool_withdraw_queue = 9;
	string pool_temp_lp_token_account = 10;
	string serum_program = 11;
	string serum_market = 12;
	string serum_coin_vault_account = 13;
	string serum_pc_vault_account = 14;
	string serum_vault_signer = 15;
	string user_lp_token_account = 16;
	string uer_coin_token_account = 17;
	string uer_pc_token_account = 18;
	string user_owner = 19;
	string serum_event_q = 20;
	string serum_bids = 21;
	string serum_asks = 22;
}

message WithdrawIxData {
	uint64 amount = 1;
}

message MigrateToOpenBookIxAccounts {
	string token_program = 1;
	string system_program = 2;
	string rent = 3;
	string amm = 4;
	string amm_authority = 5;
	string amm_open_orders = 6;
	string amm_token_coin = 7;
	string amm_token_pc = 8;
	string amm_target_orders = 9;
	string serum_program = 10;
	string serum_market = 11;
	string serum_bids = 12;
	string serum_asks = 13;
	string serum_event_queue = 14;
	string serum_coin_vault = 15;
	string serum_pc_vault = 16;
	string serum_vault_signer = 17;
	string new_amm_open_orders = 18;
	string new_serum_program = 19;
	string new_serum_market = 20;
	string admin = 21;
}


message SetParamsIxAccounts {
	string token_program = 1;
	string amm = 2;
	string amm_authority = 3;
	string amm_open_orders = 4;
	string amm_target_orders = 5;
	string amm_coin_vault = 6;
	string amm_pc_vault = 7;
	string serum_program = 8;
	string serum_market = 9;
	string serum_coin_vault = 10;
	string serum_pc_vault = 11;
	string serum_vault_signer = 12;
	string serum_event_queue = 13;
	string serum_bids = 14;
	string serum_asks = 15;
	string amm_admin_account = 16;
}

message SetParamsIxData {
	uint32 param = 1;
	optional uint64 value = 2;
	optional string new_pubkey = 3;
	optional Fees fees = 4;
	optional LastOrderDistance last_order_distance = 5;
	optional NeedTake need_take_amounts = 6;
}

message WithdrawPnlIxAccounts {
	string token_program = 1;
	string amm = 2;
	string amm_config = 3;
	string amm_authority = 4;
	string amm_open_orders = 5;
	string pool_coin_token_account = 6;
	string pool_pc_token_account = 7;
	string coin_pnl_token_account = 8;
	string pc_pnl_token_account = 9;
	string pnl_owner_account = 10;
	string amm_target_orders = 11;
	string serum_program = 12;
	string serum_market = 13;
	string serum_event_queue = 14;
	string serum_coin_vault_account = 15;
	string serum_pc_vault_account = 16;
	string serum_vault_signer = 17;
}


message WithdrawSrmIxAccounts {
	string token_program = 1;
	string amm = 2;
	string amm_owner_account = 3;
	string amm_authority = 4;
	string srm_token = 5;
	string dest_srm_token = 6;
}

message WithdrawSrmIxData {
	uint64 amount = 1;
}

message SwapBaseInIxAccounts {
	string token_program = 1;
	string amm = 2;
	string amm_authority = 3;
	string amm_open_orders = 4;
	string amm_target_orders = 5;
	string pool_coin_token_account = 6;
	string pool_pc_token_account = 7;
	string serum_program = 8;
	string serum_market = 9;
	string serum_bids = 10;
	string serum_asks = 11;
	string serum_event_queue = 12;
	string serum_coin_vault_account = 13;
	string serum_pc_vault_account = 14;
	string serum_vault_signer = 15;
	string uer_source_token_account = 16;
	string uer_destination_token_account = 17;
	string user_source_owner = 18;
}

message SwapBaseInIxData {
	uint64 amount_in = 1;
	uint64 minimum_amount_out = 2;
}

message PreInitializeIxAccounts {
	string token_program = 1;
	string system_program = 2;
	string rent = 3;
	string amm_target_orders = 4;
	string pool_withdraw_queue = 5;
	string amm_authority = 6;
	string lp_mint_address = 7;
	string coin_mint_address = 8;
	string pc_mint_address = 9;
	string pool_coin_token_account = 10;
	string pool_pc_token_account = 11;
	string pool_temp_lp_token_account = 12;
	string serum_market = 13;
	string user_wallet = 14;
}

message PreInitializeIxData {
	uint32 nonce = 1;
}

message SwapBaseOutIxAccounts {
	string token_program = 1;
	string amm = 2;
	string amm_authority = 3;
	string amm_open_orders = 4;
	string amm_target_orders = 5;
	string pool_coin_token_account = 6;
	string pool_pc_token_account = 7;
	string serum_program = 8;
	string serum_market = 9;
	string serum_bids = 10;
	string serum_asks = 11;
	string serum_event_queue = 12;
	string serum_coin_vault_account = 13;
	string serum_pc_vault_account = 14;
	string serum_vault_signer = 15;
	string uer_source_token_account = 16;
	string uer_destination_token_account = 17;
	string user_source_owner = 18;
}

message SwapBaseOutIxData {
	uint64 max_amount_in = 1;
	uint64 amount_out = 2;
}

message SimulateInfoIxAccounts {
	string amm = 1;
	string amm_authority = 2;
	string amm_open_orders = 3;
	string pool_coin_token_account = 4;
	string pool_pc_token_account = 5;
	string lp_mint_address = 6;
	string serum_market = 7;
	string serum_event_queue = 8;
}

message SimulateInfoIxData {
	uint32 param = 1;
	optional SwapInstructionBaseIn swap_base_in_value = 2;
	optional SwapInstructionBaseOut swap_base_out_value = 3;
}

message AdminCancelOrdersIxAccounts {
	string token_program = 1;
	string amm = 2;
	string amm_authority = 3;
	string amm_open_orders = 4;
	string amm_target_orders = 5;
	string pool_coin_token_account = 6;
	string pool_pc_token_account = 7;
	string amm_owner_account = 8;
	string amm_config = 9;
	string serum_program = 10;
	string serum_market = 11;
	string serum_coin_vault_account = 12;
	string serum_pc_vault_account = 13;
	string serum_vault_signer = 14;
	string serum_event_q = 15;
	string serum_bids = 16;
	string serum_asks = 17;
}

message AdminCancelOrdersIxData {
	uint32 limit = 1;
}

message CreateConfigAccountIxAccounts {
	string admin = 1;
	string amm_config = 2;
	string owner = 3;
	string system_program = 4;
	string rent = 5;
}


message UpdateConfigAccountIxAccounts {
	string admin = 1;
	string amm_config = 2;
}

message UpdateConfigAccountIxData {
	uint32 param = 1;
	string owner = 2;
}


message ProgramState {
    oneof state_oneof {
        	TargetOrders target_orders = 1;
        	AmmInfo amm_info = 2;
        	AmmConfig amm_config = 3;
        }
}

message ProgramIxs {
    oneof ix_oneof {
        	InitializeIx initialize = 1;
        	Initialize2Ix initialize2 = 2;
        	MonitorStepIx monitor_step = 3;
        	DepositIx deposit = 4;
        	WithdrawIx withdraw = 5;
        	MigrateToOpenBookIx migrate_to_open_book = 6;
        	SetParamsIx set_params = 7;
        	WithdrawPnlIx withdraw_pnl = 8;
        	WithdrawSrmIx withdraw_srm = 9;
        	SwapBaseInIx swap_base_in = 10;
        	PreInitializeIx pre_initialize = 11;
        	SwapBaseOutIx swap_base_out = 12;
        	SimulateInfoIx simulate_info = 13;
        	AdminCancelOrdersIx admin_cancel_orders = 14;
        	CreateConfigAccountIx create_config_account = 15;
        	UpdateConfigAccountIx update_config_account = 16;
        }
}

