diff --git a/programs/mango-v4/src/instructions/perp_settle_pnl.rs b/programs/mango-v4/src/instructions/perp_settle_pnl.rs index a79375fc4..07ff21432 100644 --- a/programs/mango-v4/src/instructions/perp_settle_pnl.rs +++ b/programs/mango-v4/src/instructions/perp_settle_pnl.rs @@ -27,6 +27,7 @@ pub struct PerpSettlePnl<'info> { #[account(mut, has_one = group)] pub account_b: AccountLoaderDynamic<'info, MangoAccount>, + /// CHECK: Oracle can have different account types, constrained by address in perp_market pub oracle: UncheckedAccount<'info>, #[account(mut, has_one = group)] diff --git a/programs/mango-v4/src/instructions/token_edit.rs b/programs/mango-v4/src/instructions/token_edit.rs index 6e907cfc1..894bcb183 100644 --- a/programs/mango-v4/src/instructions/token_edit.rs +++ b/programs/mango-v4/src/instructions/token_edit.rs @@ -12,7 +12,6 @@ use crate::state::*; /// In addition to these accounts, all banks must be passed as remaining_accounts /// in MintInfo order. #[derive(Accounts)] -#[instruction(bank_num: u64)] pub struct TokenEdit<'info> { #[account( has_one = admin, @@ -31,7 +30,6 @@ pub struct TokenEdit<'info> { #[allow(clippy::too_many_arguments)] pub fn token_edit( ctx: Context, - bank_num: u64, oracle_opt: Option, oracle_config_opt: Option, group_insurance_fund_opt: Option, diff --git a/programs/mango-v4/src/lib.rs b/programs/mango-v4/src/lib.rs index 4b5cc28d2..2a05f52b2 100644 --- a/programs/mango-v4/src/lib.rs +++ b/programs/mango-v4/src/lib.rs @@ -101,7 +101,6 @@ pub mod mango_v4 { #[allow(clippy::too_many_arguments)] pub fn token_edit( ctx: Context, - bank_num: u64, oracle_opt: Option, oracle_config_opt: Option, group_insurance_fund_opt: Option, @@ -116,7 +115,6 @@ pub mod mango_v4 { ) -> Result<()> { instructions::token_edit( ctx, - bank_num, oracle_opt, oracle_config_opt, group_insurance_fund_opt, diff --git a/ts/client/src/client.ts b/ts/client/src/client.ts index deeb5a56c..191c6b855 100644 --- a/ts/client/src/client.ts +++ b/ts/client/src/client.ts @@ -294,7 +294,6 @@ export class MangoClient { return await this.program.methods .tokenEdit( - new BN(0), oracle, oracleConf, groupInsuranceFund, diff --git a/ts/client/src/mango_v4.ts b/ts/client/src/mango_v4.ts index c53f1ee96..6a18b20e0 100644 --- a/ts/client/src/mango_v4.ts +++ b/ts/client/src/mango_v4.ts @@ -502,10 +502,6 @@ export type MangoV4 = { } ], "args": [ - { - "name": "bankNum", - "type": "u64" - }, { "name": "oracleOpt", "type": { @@ -2692,6 +2688,49 @@ export type MangoV4 = { ], "args": [] }, + { + "name": "perpSettlePnl", + "accounts": [ + { + "name": "group", + "isMut": false, + "isSigner": false + }, + { + "name": "perpMarket", + "isMut": false, + "isSigner": false + }, + { + "name": "accountA", + "isMut": true, + "isSigner": false + }, + { + "name": "accountB", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": false, + "isSigner": false + }, + { + "name": "quoteBank", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "maxSettleAmount", + "type": { + "defined": "I80F48" + } + } + ] + }, { "name": "computeAccountData", "accounts": [ @@ -5308,6 +5347,31 @@ export type MangoV4 = { "code": 6016, "name": "BeingLiquidated", "msg": "account is currently being liquidated" + }, + { + "code": 6017, + "name": "InvalidBank", + "msg": "invalid bank" + }, + { + "code": 6018, + "name": "ProfitabilityMismatch", + "msg": "account profitability is mismatched" + }, + { + "code": 6019, + "name": "CannotSettleWithSelf", + "msg": "cannot settle with self" + }, + { + "code": 6020, + "name": "PerpPositionDoesNotExist", + "msg": "perp position does not exist" + }, + { + "code": 6021, + "name": "MaxSettleAmountMustBeGreaterThanZero", + "msg": "max settle amount must be greater than zero" } ] }; @@ -5816,10 +5880,6 @@ export const IDL: MangoV4 = { } ], "args": [ - { - "name": "bankNum", - "type": "u64" - }, { "name": "oracleOpt", "type": { @@ -8006,6 +8066,49 @@ export const IDL: MangoV4 = { ], "args": [] }, + { + "name": "perpSettlePnl", + "accounts": [ + { + "name": "group", + "isMut": false, + "isSigner": false + }, + { + "name": "perpMarket", + "isMut": false, + "isSigner": false + }, + { + "name": "accountA", + "isMut": true, + "isSigner": false + }, + { + "name": "accountB", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": false, + "isSigner": false + }, + { + "name": "quoteBank", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "maxSettleAmount", + "type": { + "defined": "I80F48" + } + } + ] + }, { "name": "computeAccountData", "accounts": [ @@ -10622,6 +10725,31 @@ export const IDL: MangoV4 = { "code": 6016, "name": "BeingLiquidated", "msg": "account is currently being liquidated" + }, + { + "code": 6017, + "name": "InvalidBank", + "msg": "invalid bank" + }, + { + "code": 6018, + "name": "ProfitabilityMismatch", + "msg": "account profitability is mismatched" + }, + { + "code": 6019, + "name": "CannotSettleWithSelf", + "msg": "cannot settle with self" + }, + { + "code": 6020, + "name": "PerpPositionDoesNotExist", + "msg": "perp position does not exist" + }, + { + "code": 6021, + "name": "MaxSettleAmountMustBeGreaterThanZero", + "msg": "max settle amount must be greater than zero" } ] };