diff --git a/justfile b/justfile index ed514957a..9d38fc0e9 100644 --- a/justfile +++ b/justfile @@ -10,7 +10,7 @@ test TEST_NAME: cargo test-sbf --features enable-gpl -- {{ TEST_NAME }} test-all: - (cd ./programs/openbook-v2 && RUST_LOG=ERROR cargo +1.70.0 test-sbf --features enable-gpl) + (cd ./programs/openbook-v2 && RUST_LOG=ERROR cargo test-sbf --features enable-gpl) test-dev: (find programs) | entr -s 'just test-all' @@ -19,6 +19,7 @@ idl: anchor build --arch sbf -- --features enable-gpl bash {{ justfile_directory() }}/idl-fixup.sh cp -v ./target/types/openbook_v2.ts ./ts/client/src/openbook_v2.ts + yarn lint --fix yarn format fuzz: diff --git a/lib/client/src/client.rs b/lib/client/src/client.rs index aabeb564e..b1eee5adb 100644 --- a/lib/client/src/client.rs +++ b/lib/client/src/client.rs @@ -131,9 +131,17 @@ impl OpenBookClient { Some(tuple) => tuple.1.account_num + 1, None => 0u32, }; - Self::create_open_orders_account(client, market, owner, payer, None, account_num) - .await - .context("Failed to create account...")?; + Self::create_open_orders_account( + client, + market, + owner, + payer, + None, + account_num, + openbook_account_name, + ) + .await + .context("Failed to create account...")?; } let openbook_account_tuples = fetch_openbook_accounts(&rpc, program, owner.pubkey()).await?; @@ -191,6 +199,7 @@ impl OpenBookClient { payer: &Keypair, // pays the SOL for the new account delegate: Option, account_num: u32, + name: &str, ) -> anyhow::Result<(Pubkey, Signature)> { let open_orders_indexer = Pubkey::find_program_address( &[ @@ -206,7 +215,6 @@ impl OpenBookClient { &[ b"OpenOrdersAccount".as_ref(), owner.pubkey().as_ref(), - market.as_ref(), &account_num.to_le_bytes(), ], &openbook_v2::id(), @@ -228,7 +236,9 @@ impl OpenBookClient { None, ), data: anchor_lang::InstructionData::data( - &openbook_v2::instruction::CreateOpenOrdersAccount {}, + &openbook_v2::instruction::CreateOpenOrdersAccount { + name: name.to_string(), + }, ), }; @@ -535,6 +545,7 @@ impl OpenBookClient { anchor_lang::ToAccountMetas::to_account_metas( &openbook_v2::accounts::SettleFunds { owner: self.owner(), + penalty_payer: self.owner(), open_orders_account: self.open_orders_account, market: market_address, market_authority: market.market_authority, diff --git a/lib/client/src/jup.rs b/lib/client/src/jup.rs index 518142996..4c289a54f 100644 --- a/lib/client/src/jup.rs +++ b/lib/client/src/jup.rs @@ -205,6 +205,7 @@ impl Amm for OpenBookMarket { let accounts = PlaceTakeOrder { signer: *user_transfer_authority, + penalty_payer: *user_transfer_authority, market: self.key, market_authority: self.market.market_authority, bids: self.market.bids, diff --git a/programs/openbook-v2/fuzz/src/lib.rs b/programs/openbook-v2/fuzz/src/lib.rs index e854d5bb6..c2d668ee1 100644 --- a/programs/openbook-v2/fuzz/src/lib.rs +++ b/programs/openbook-v2/fuzz/src/lib.rs @@ -200,12 +200,7 @@ impl FuzzContext { .0; let open_orders = Pubkey::find_program_address( - &[ - b"OpenOrders".as_ref(), - owner.as_ref(), - self.market.as_ref(), - &1_u32.to_le_bytes(), - ], + &[b"OpenOrders".as_ref(), owner.as_ref(), &1_u32.to_le_bytes()], &openbook_v2::ID, ) .0; @@ -241,7 +236,9 @@ impl FuzzContext { market: self.market, system_program: system_program::ID, }; - let data = openbook_v2::instruction::CreateOpenOrdersAccount {}; + let data = openbook_v2::instruction::CreateOpenOrdersAccount { + name: "fuzz test".to_string(), + }; process_instruction(&mut self.state, &data, &accounts, &[]).unwrap(); UserAccounts { @@ -472,6 +469,7 @@ impl FuzzContext { let accounts = openbook_v2::accounts::PlaceTakeOrder { signer: user.owner, + penalty_payer: user.owner, user_base_account: user.base_vault, user_quote_account: user.quote_vault, market: self.market, @@ -767,6 +765,7 @@ impl FuzzContext { let accounts = openbook_v2::accounts::SettleFunds { owner: user.owner, + penalty_payer: user.owner, open_orders_account: user.open_orders, user_base_account: user.base_vault, user_quote_account: user.quote_vault, diff --git a/programs/openbook-v2/src/accounts_ix/close_open_orders_account.rs b/programs/openbook-v2/src/accounts_ix/close_open_orders_account.rs index 591fcd100..bf5646bb5 100644 --- a/programs/openbook-v2/src/accounts_ix/close_open_orders_account.rs +++ b/programs/openbook-v2/src/accounts_ix/close_open_orders_account.rs @@ -11,7 +11,7 @@ pub struct CloseOpenOrdersAccount<'info> { seeds = [b"OpenOrdersIndexer".as_ref(), owner.key().as_ref()], bump = open_orders_indexer.bump, realloc = OpenOrdersIndexer::space(open_orders_indexer.addresses.len()-1), - realloc::payer = payer, + realloc::payer = sol_destination, realloc::zero = false, )] pub open_orders_indexer: Account<'info, OpenOrdersIndexer>, diff --git a/programs/openbook-v2/src/accounts_ix/create_market.rs b/programs/openbook-v2/src/accounts_ix/create_market.rs index d1694e1ab..9d1e8a858 100644 --- a/programs/openbook-v2/src/accounts_ix/create_market.rs +++ b/programs/openbook-v2/src/accounts_ix/create_market.rs @@ -48,6 +48,7 @@ pub struct CreateMarket<'info> { )] pub market_quote_vault: Account<'info, TokenAccount>, + #[account(constraint = base_mint.key() != quote_mint.key())] pub base_mint: Box>, pub quote_mint: Box>, diff --git a/programs/openbook-v2/src/accounts_ix/create_open_orders_account.rs b/programs/openbook-v2/src/accounts_ix/create_open_orders_account.rs index c1f2076b4..b366ec431 100644 --- a/programs/openbook-v2/src/accounts_ix/create_open_orders_account.rs +++ b/programs/openbook-v2/src/accounts_ix/create_open_orders_account.rs @@ -20,7 +20,7 @@ pub struct CreateOpenOrdersAccount<'info> { pub open_orders_indexer: Account<'info, OpenOrdersIndexer>, #[account( init, - seeds = [b"OpenOrders".as_ref(), owner.key().as_ref(), market.key().as_ref(), &(open_orders_indexer.created_counter + 1).to_le_bytes()], + seeds = [b"OpenOrders".as_ref(), owner.key().as_ref(), &(open_orders_indexer.created_counter + 1).to_le_bytes()], bump, payer = payer, space = OpenOrdersAccount::space(), diff --git a/programs/openbook-v2/src/accounts_ix/place_take_order.rs b/programs/openbook-v2/src/accounts_ix/place_take_order.rs index 274cb22d4..f41a239ad 100644 --- a/programs/openbook-v2/src/accounts_ix/place_take_order.rs +++ b/programs/openbook-v2/src/accounts_ix/place_take_order.rs @@ -8,6 +8,8 @@ use anchor_spl::token::{Token, TokenAccount}; pub struct PlaceTakeOrder<'info> { #[account(mut)] pub signer: Signer<'info>, + #[account(mut)] + pub penalty_payer: Signer<'info>, #[account( mut, diff --git a/programs/openbook-v2/src/accounts_ix/settle_funds.rs b/programs/openbook-v2/src/accounts_ix/settle_funds.rs index dea24212c..467c9b615 100644 --- a/programs/openbook-v2/src/accounts_ix/settle_funds.rs +++ b/programs/openbook-v2/src/accounts_ix/settle_funds.rs @@ -6,6 +6,9 @@ use anchor_spl::token::{Token, TokenAccount}; pub struct SettleFunds<'info> { #[account(mut)] pub owner: Signer<'info>, + #[account(mut)] + pub penalty_payer: Signer<'info>, + #[account( mut, has_one = owner, diff --git a/programs/openbook-v2/src/accounts_ix/settle_funds_expired.rs b/programs/openbook-v2/src/accounts_ix/settle_funds_expired.rs index d9577cb5f..0181f0228 100644 --- a/programs/openbook-v2/src/accounts_ix/settle_funds_expired.rs +++ b/programs/openbook-v2/src/accounts_ix/settle_funds_expired.rs @@ -8,7 +8,9 @@ use anchor_spl::token::{Token, TokenAccount}; pub struct SettleFundsExpired<'info> { pub close_market_admin: Signer<'info>, #[account(mut)] - pub payer: Signer<'info>, + pub owner: Signer<'info>, + #[account(mut)] + pub penalty_payer: Signer<'info>, #[account( mut, has_one = market, @@ -53,7 +55,8 @@ pub struct SettleFundsExpired<'info> { impl<'info> SettleFundsExpired<'info> { pub fn to_settle_funds_accounts(&self) -> SettleFunds<'info> { SettleFunds { - owner: self.payer.clone(), + owner: self.owner.clone(), + penalty_payer: self.penalty_payer.clone(), open_orders_account: self.open_orders_account.clone(), market: self.market.clone(), market_authority: self.market_authority.clone(), diff --git a/programs/openbook-v2/src/instructions/consume_events.rs b/programs/openbook-v2/src/instructions/consume_events.rs index 6ca974ee1..af05c378f 100644 --- a/programs/openbook-v2/src/instructions/consume_events.rs +++ b/programs/openbook-v2/src/instructions/consume_events.rs @@ -14,11 +14,8 @@ pub const MAX_EVENTS_CONSUME: usize = 8; /// /// Message and return Ok() if it's missing, to lock in successful processing /// of previous events. -/// -/// Special handling for testing, where events for accounts with bad -/// owners (most likely due to force closure of the account) are being skipped. macro_rules! load_open_orders_account { - ($name:ident, $key:expr, $ais:expr, $event_heap:expr) => { + ($name:ident, $key:expr, $ais:expr) => { let loader = match $ais.iter().find(|ai| ai.key == &$key) { None => { msg!( @@ -30,17 +27,8 @@ macro_rules! load_open_orders_account { } Some(ai) => { - if ai.owner != &crate::id() { - msg!( - "OpenOrdersAccount ({}) not owned by openbook program", - stringify!($name) - ); - $event_heap.pop_front()?; - continue; - } - - let mal: AccountLoader = AccountLoader::try_from(ai)?; - mal + let ooa: AccountLoader = AccountLoader::try_from(ai)?; + ooa } }; let mut $name = loader.load_mut()?; @@ -73,12 +61,12 @@ pub fn consume_events( match EventType::try_from(event.event_type).map_err(|_| error!(OpenBookError::SomeError))? { EventType::Fill => { let fill: &FillEvent = cast_ref(event); - load_open_orders_account!(maker, fill.maker, remaining_accs, event_heap); + load_open_orders_account!(maker, fill.maker, remaining_accs); maker.execute_maker(&mut market, fill); } EventType::Out => { let out: &OutEvent = cast_ref(event); - load_open_orders_account!(owner, out.owner, remaining_accs, event_heap); + load_open_orders_account!(owner, out.owner, remaining_accs); owner.cancel_order(out.owner_slot as usize, out.quantity, *market); } } diff --git a/programs/openbook-v2/src/instructions/create_open_orders_account.rs b/programs/openbook-v2/src/instructions/create_open_orders_account.rs index 768f6b9b8..44421fd95 100644 --- a/programs/openbook-v2/src/instructions/create_open_orders_account.rs +++ b/programs/openbook-v2/src/instructions/create_open_orders_account.rs @@ -1,9 +1,13 @@ use crate::accounts_ix::CreateOpenOrdersAccount; use crate::pubkey_option::NonZeroKey; use crate::state::*; +use crate::util::fill_from_str; use anchor_lang::prelude::*; -pub fn create_open_orders_account(ctx: Context) -> Result<()> { +pub fn create_open_orders_account( + ctx: Context, + name: String, +) -> Result<()> { let mut account = ctx.accounts.open_orders_account.load_init()?; let indexer = &mut ctx.accounts.open_orders_indexer; indexer @@ -11,6 +15,7 @@ pub fn create_open_orders_account(ctx: Context) -> Resu .push(ctx.accounts.open_orders_account.key()); indexer.created_counter += 1; + account.name = fill_from_str(&name)?; account.account_num = indexer.created_counter; account.market = ctx.accounts.market.key(); account.bump = *ctx.bumps.get("open_orders_account").unwrap(); diff --git a/programs/openbook-v2/src/instructions/edit_order.rs b/programs/openbook-v2/src/instructions/edit_order.rs index a583de644..762819c4d 100644 --- a/programs/openbook-v2/src/instructions/edit_order.rs +++ b/programs/openbook-v2/src/instructions/edit_order.rs @@ -27,6 +27,7 @@ pub fn edit_order<'info>( )?; let filled_amount = expected_cancel_size - leaf_node_quantity; + // note that order.max_base_lots is checked to be > 0 inside `place_order` if order.max_base_lots > filled_amount { // Do not reduce max_quote_lots_including_fees as implicitly it's limited by max_base_lots. order.max_base_lots -= filled_amount; diff --git a/programs/openbook-v2/src/instructions/place_order.rs b/programs/openbook-v2/src/instructions/place_order.rs index 95ed5de59..15428c5aa 100644 --- a/programs/openbook-v2/src/instructions/place_order.rs +++ b/programs/openbook-v2/src/instructions/place_order.rs @@ -86,10 +86,10 @@ pub fn place_order(ctx: Context, order: Order, limit: u8) -> Result< } Side::Ask => { - let free_assets_native = position.base_free_native; + let free_base = position.base_free_native; let max_base_native = total_base_taken_native + posted_base_native; - let free_qty_to_lock = cmp::min(max_base_native, free_assets_native); + let free_qty_to_lock = cmp::min(max_base_native, free_base); let deposit_amount = max_base_native - free_qty_to_lock; // Update market deposit total diff --git a/programs/openbook-v2/src/instructions/place_take_order.rs b/programs/openbook-v2/src/instructions/place_take_order.rs index 20074559c..2e80b98d7 100644 --- a/programs/openbook-v2/src/instructions/place_take_order.rs +++ b/programs/openbook-v2/src/instructions/place_take_order.rs @@ -93,7 +93,7 @@ pub fn place_take_order<'info>( system_program_transfer( PENALTY_EVENT_HEAP, &ctx.accounts.system_program, - &ctx.accounts.signer, + &ctx.accounts.penalty_payer, &ctx.accounts.market, )?; } diff --git a/programs/openbook-v2/src/instructions/set_delegate.rs b/programs/openbook-v2/src/instructions/set_delegate.rs index bad99d496..a2f25422d 100644 --- a/programs/openbook-v2/src/instructions/set_delegate.rs +++ b/programs/openbook-v2/src/instructions/set_delegate.rs @@ -18,11 +18,7 @@ pub fn set_delegate(ctx: Context) -> Result<()> { emit!(SetDelegateLog { open_orders_account: ctx.accounts.open_orders_account.key(), - delegate: ctx - .accounts - .delegate_account - .as_ref() - .map(|account| account.key()), + delegate: delegate_account.into() }); Ok(()) diff --git a/programs/openbook-v2/src/instructions/settle_funds.rs b/programs/openbook-v2/src/instructions/settle_funds.rs index 0692ff758..7f19b87e8 100644 --- a/programs/openbook-v2/src/instructions/settle_funds.rs +++ b/programs/openbook-v2/src/instructions/settle_funds.rs @@ -38,7 +38,7 @@ pub fn settle_funds<'info>(ctx: Context<'_, '_, '_, 'info, SettleFunds<'info>>) system_program_transfer( pa.penalty_heap_count * PENALTY_EVENT_HEAP, &ctx.accounts.system_program, - &ctx.accounts.owner, + &ctx.accounts.penalty_payer, &ctx.accounts.market, )?; pa.penalty_heap_count = 0; diff --git a/programs/openbook-v2/src/lib.rs b/programs/openbook-v2/src/lib.rs index f758aeef1..df05d33df 100644 --- a/programs/openbook-v2/src/lib.rs +++ b/programs/openbook-v2/src/lib.rs @@ -86,9 +86,12 @@ pub mod openbook_v2 { } /// Create an [`OpenOrdersAccount`](crate::state::OpenOrdersAccount). - pub fn create_open_orders_account(ctx: Context) -> Result<()> { + pub fn create_open_orders_account( + ctx: Context, + name: String, + ) -> Result<()> { #[cfg(feature = "enable-gpl")] - instructions::create_open_orders_account(ctx)?; + instructions::create_open_orders_account(ctx, name)?; Ok(()) } diff --git a/programs/openbook-v2/src/pubkey_option.rs b/programs/openbook-v2/src/pubkey_option.rs index bd0a3871b..e35a957a5 100644 --- a/programs/openbook-v2/src/pubkey_option.rs +++ b/programs/openbook-v2/src/pubkey_option.rs @@ -2,7 +2,7 @@ use anchor_lang::prelude::*; use bytemuck::Zeroable; use std::convert::From; -/// Like `Option`, but implemented for `Pubkey`. +/// Like `Option`, but implemented for `Pubkey` to be used with `zero_copy` #[zero_copy] #[derive(AnchorSerialize, AnchorDeserialize, Debug, Default, PartialEq)] pub struct NonZeroPubkeyOption { diff --git a/programs/openbook-v2/src/state/open_orders_account.rs b/programs/openbook-v2/src/state/open_orders_account.rs index 658367c1f..d8c3211a5 100644 --- a/programs/openbook-v2/src/state/open_orders_account.rs +++ b/programs/openbook-v2/src/state/open_orders_account.rs @@ -375,6 +375,7 @@ impl Position { && self.quote_free_native == 0 && self.locked_maker_fees == 0 && self.referrer_rebates_available == 0 + && self.penalty_heap_count == 0 } } diff --git a/programs/openbook-v2/src/state/open_orders_indexer.rs b/programs/openbook-v2/src/state/open_orders_indexer.rs index af91cfda8..0050a01e9 100644 --- a/programs/openbook-v2/src/state/open_orders_indexer.rs +++ b/programs/openbook-v2/src/state/open_orders_indexer.rs @@ -1,6 +1,4 @@ use anchor_lang::prelude::*; -use static_assertions::const_assert_eq; -use std::mem::size_of; #[account] #[derive(Default)] diff --git a/programs/openbook-v2/tests/cases/test_permissioned.rs b/programs/openbook-v2/tests/cases/test_permissioned.rs index 8afb12a9b..94c70c22f 100644 --- a/programs/openbook-v2/tests/cases/test_permissioned.rs +++ b/programs/openbook-v2/tests/cases/test_permissioned.rs @@ -366,7 +366,7 @@ async fn test_close_market_admin() -> Result<(), TransportError> { let settle_funds_expired_ix = SettleFundsExpiredInstruction { close_market_admin, market, - payer, + owner: payer, open_orders_account: account_2, market_base_vault, market_quote_vault, diff --git a/programs/openbook-v2/tests/program_test/client.rs b/programs/openbook-v2/tests/program_test/client.rs index a9d696b5f..36c434cf8 100644 --- a/programs/openbook-v2/tests/program_test/client.rs +++ b/programs/openbook-v2/tests/program_test/client.rs @@ -184,7 +184,9 @@ impl ClientInstruction for CreateOpenOrdersAccountInstruction { _account_loader: impl ClientAccountLoader + 'async_trait, ) -> (Self::Accounts, instruction::Instruction) { let program_id = openbook_v2::id(); - let instruction = openbook_v2::instruction::CreateOpenOrdersAccount {}; + let instruction = openbook_v2::instruction::CreateOpenOrdersAccount { + name: "test".to_string(), + }; let open_orders_indexer = Pubkey::find_program_address( &[b"OpenOrdersIndexer".as_ref(), self.owner.pubkey().as_ref()], @@ -196,7 +198,6 @@ impl ClientInstruction for CreateOpenOrdersAccountInstruction { &[ b"OpenOrders".as_ref(), self.owner.pubkey().as_ref(), - self.market.as_ref(), &self.account_num.to_le_bytes(), ], &program_id, @@ -250,7 +251,6 @@ impl ClientInstruction for CloseOpenOrdersAccountInstruction { &[ b"OpenOrders".as_ref(), self.owner.pubkey().as_ref(), - self.market.as_ref(), &self.account_num.to_le_bytes(), ], &program_id, @@ -587,6 +587,7 @@ impl ClientInstruction for PlaceTakeOrderInstruction { oracle_a: market.oracle_a.into(), oracle_b: market.oracle_b.into(), signer: self.signer.pubkey(), + penalty_payer: self.signer.pubkey(), user_base_account: self.user_base_account, user_quote_account: self.user_quote_account, market_base_vault: self.market_base_vault, @@ -831,6 +832,7 @@ impl ClientInstruction for SettleFundsInstruction { let market: Market = account_loader.load(&self.market).await.unwrap(); let accounts = Self::Accounts { owner: self.owner.pubkey(), + penalty_payer: self.owner.pubkey(), open_orders_account: self.open_orders_account, market: self.market, market_authority: market.market_authority, @@ -855,7 +857,7 @@ impl ClientInstruction for SettleFundsInstruction { #[derive(Clone)] pub struct SettleFundsExpiredInstruction { pub close_market_admin: TestKeypair, - pub payer: TestKeypair, + pub owner: TestKeypair, pub open_orders_account: Pubkey, pub market: Pubkey, pub market_base_vault: Pubkey, @@ -877,7 +879,8 @@ impl ClientInstruction for SettleFundsExpiredInstruction { let market: Market = account_loader.load(&self.market).await.unwrap(); let accounts = Self::Accounts { close_market_admin: self.close_market_admin.pubkey(), - payer: self.payer.pubkey(), + owner: self.owner.pubkey(), + penalty_payer: self.owner.pubkey(), open_orders_account: self.open_orders_account, market: self.market, market_authority: market.market_authority, @@ -895,7 +898,7 @@ impl ClientInstruction for SettleFundsExpiredInstruction { } fn signers(&self) -> Vec { - vec![self.close_market_admin, self.payer] + vec![self.close_market_admin, self.owner] } } diff --git a/ts/client/src/client.ts b/ts/client/src/client.ts index 5876183d4..f7828f026 100644 --- a/ts/client/src/client.ts +++ b/ts/client/src/client.ts @@ -327,7 +327,6 @@ export class OpenBookV2Client { [ Buffer.from('OpenOrders'), this.walletPk.toBuffer(), - market.toBuffer(), accountIndex.toArrayLike(Buffer, 'le', 4), ], this.programId, diff --git a/ts/client/src/openbook_v2.ts b/ts/client/src/openbook_v2.ts index c0a22a1ec..785e8e3a2 100644 --- a/ts/client/src/openbook_v2.ts +++ b/ts/client/src/openbook_v2.ts @@ -302,7 +302,12 @@ export interface OpenbookV2 { isSigner: false; }, ]; - args: []; + args: [ + { + name: 'name'; + type: 'string'; + }, + ]; }, { name: 'closeOpenOrdersAccount'; @@ -810,6 +815,11 @@ export interface OpenbookV2 { isMut: true; isSigner: true; }, + { + name: 'penaltyPayer'; + isMut: true; + isSigner: true; + }, { name: 'market'; isMut: true; @@ -1246,6 +1256,11 @@ export interface OpenbookV2 { isMut: true; isSigner: true; }, + { + name: 'penaltyPayer'; + isMut: true; + isSigner: true; + }, { name: 'openOrdersAccount'; isMut: true; @@ -1313,7 +1328,12 @@ export interface OpenbookV2 { isSigner: true; }, { - name: 'payer'; + name: 'owner'; + isMut: true; + isSigner: true; + }, + { + name: 'penaltyPayer'; isMut: true; isSigner: true; }, @@ -2006,7 +2026,9 @@ export interface OpenbookV2 { types: [ { name: 'NonZeroPubkeyOption'; - docs: ['Like `Option`, but implemented for `Pubkey`.']; + docs: [ + 'Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`', + ]; type: { kind: 'struct'; fields: [ @@ -3818,7 +3840,12 @@ export const IDL: OpenbookV2 = { isSigner: false, }, ], - args: [], + args: [ + { + name: 'name', + type: 'string', + }, + ], }, { name: 'closeOpenOrdersAccount', @@ -4326,6 +4353,11 @@ export const IDL: OpenbookV2 = { isMut: true, isSigner: true, }, + { + name: 'penaltyPayer', + isMut: true, + isSigner: true, + }, { name: 'market', isMut: true, @@ -4762,6 +4794,11 @@ export const IDL: OpenbookV2 = { isMut: true, isSigner: true, }, + { + name: 'penaltyPayer', + isMut: true, + isSigner: true, + }, { name: 'openOrdersAccount', isMut: true, @@ -4829,7 +4866,12 @@ export const IDL: OpenbookV2 = { isSigner: true, }, { - name: 'payer', + name: 'owner', + isMut: true, + isSigner: true, + }, + { + name: 'penaltyPayer', isMut: true, isSigner: true, }, @@ -5522,7 +5564,9 @@ export const IDL: OpenbookV2 = { types: [ { name: 'NonZeroPubkeyOption', - docs: ['Like `Option`, but implemented for `Pubkey`.'], + docs: [ + 'Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`', + ], type: { kind: 'struct', fields: [