Let all PDA seeds start with a unique prefix (#166)

This is mostly paranoia. Now it's guaranteed that different PDA types
have unique seeds.
This commit is contained in:
Christian Kamm 2022-08-13 19:30:35 +02:00 committed by GitHub
parent a3067e2448
commit 21815612ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 202 additions and 210 deletions

View File

@ -11,7 +11,7 @@ pub struct AccountCreate<'info> {
#[account(
init,
seeds = [group.key().as_ref(), b"MangoAccount".as_ref(), owner.key().as_ref(), &account_num.to_le_bytes()],
seeds = [b"MangoAccount".as_ref(), group.key().as_ref(), owner.key().as_ref(), &account_num.to_le_bytes()],
bump,
payer = payer,
space = MangoAccount::space(token_count, serum3_count, perp_count, perp_oo_count)?,

View File

@ -22,7 +22,7 @@ pub struct GroupCreate<'info> {
#[account(
init,
seeds = [group.key().as_ref(), b"InsuranceVault".as_ref()],
seeds = [b"InsuranceVault".as_ref(), group.key().as_ref()],
bump,
token::authority = group,
token::mint = insurance_mint,

View File

@ -21,7 +21,7 @@ pub struct PerpCreateMarket<'info> {
#[account(
init,
seeds = [group.key().as_ref(), b"PerpMarket".as_ref(), perp_market_index.to_le_bytes().as_ref()],
seeds = [b"PerpMarket".as_ref(), group.key().as_ref(), perp_market_index.to_le_bytes().as_ref()],
bump,
payer = payer,
space = 8 + std::mem::size_of::<PerpMarket>(),

View File

@ -25,7 +25,7 @@ pub struct Serum3CreateOpenOrders<'info> {
// initialized by this instruction via cpi to serum
#[account(
init,
seeds = [account.key().as_ref(), b"Serum3OO".as_ref(), serum_market.key().as_ref()],
seeds = [b"Serum3OO".as_ref(), account.key().as_ref(), serum_market.key().as_ref()],
bump,
payer = payer,
owner = serum_program.key(),

View File

@ -24,7 +24,7 @@ pub struct Serum3RegisterMarket<'info> {
#[account(
init,
// using the serum_market_external in the seed guards against registering the same market twice
seeds = [group.key().as_ref(), b"Serum3Market".as_ref(), serum_market_external.key().as_ref()],
seeds = [b"Serum3Market".as_ref(), group.key().as_ref(), serum_market_external.key().as_ref()],
bump,
payer = payer,
space = 8 + std::mem::size_of::<Serum3Market>(),

View File

@ -13,7 +13,7 @@ pub struct StubOracleCreate<'info> {
#[account(
init,
seeds = [group.key().as_ref(), b"StubOracle".as_ref(), mint.key().as_ref()],
seeds = [b"StubOracle".as_ref(), group.key().as_ref(), mint.key().as_ref()],
bump,
payer = payer,
space = 8 + std::mem::size_of::<StubOracle>(),

View File

@ -25,7 +25,7 @@ pub struct TokenAddBank<'info> {
#[account(
init,
// using the token_index in this seed guards against reusing it
seeds = [group.key().as_ref(), b"Bank".as_ref(), &token_index.to_le_bytes(), &bank_num.to_le_bytes()],
seeds = [b"Bank".as_ref(), group.key().as_ref(), &token_index.to_le_bytes(), &bank_num.to_le_bytes()],
bump,
payer = payer,
space = 8 + std::mem::size_of::<Bank>(),
@ -34,7 +34,7 @@ pub struct TokenAddBank<'info> {
#[account(
init,
seeds = [group.key().as_ref(), b"Vault".as_ref(), &token_index.to_le_bytes(), &bank_num.to_le_bytes()],
seeds = [b"Vault".as_ref(), group.key().as_ref(), &token_index.to_le_bytes(), &bank_num.to_le_bytes()],
bump,
token::authority = group,
token::mint = mint,
@ -44,7 +44,7 @@ pub struct TokenAddBank<'info> {
#[account(
mut,
seeds = [group.key().as_ref(), b"MintInfo".as_ref(), mint.key().as_ref()],
seeds = [b"MintInfo".as_ref(), group.key().as_ref(), mint.key().as_ref()],
bump
)]
pub mint_info: AccountLoader<'info, MintInfo>,

View File

@ -25,7 +25,7 @@ pub struct TokenRegister<'info> {
#[account(
init,
// using the token_index in this seed guards against reusing it
seeds = [group.key().as_ref(), b"Bank".as_ref(), &token_index.to_le_bytes(), &FIRST_BANK_NUM.to_le_bytes()],
seeds = [b"Bank".as_ref(), group.key().as_ref(), &token_index.to_le_bytes(), &FIRST_BANK_NUM.to_le_bytes()],
bump,
payer = payer,
space = 8 + std::mem::size_of::<Bank>(),
@ -34,7 +34,7 @@ pub struct TokenRegister<'info> {
#[account(
init,
seeds = [group.key().as_ref(), b"Vault".as_ref(), &token_index.to_le_bytes(), &FIRST_BANK_NUM.to_le_bytes()],
seeds = [b"Vault".as_ref(), group.key().as_ref(), &token_index.to_le_bytes(), &FIRST_BANK_NUM.to_le_bytes()],
bump,
token::authority = group,
token::mint = mint,
@ -45,7 +45,7 @@ pub struct TokenRegister<'info> {
#[account(
init,
// using the mint in this seed guards against registering the same mint twice
seeds = [group.key().as_ref(), b"MintInfo".as_ref(), mint.key().as_ref()],
seeds = [b"MintInfo".as_ref(), group.key().as_ref(), mint.key().as_ref()],
bump,
payer = payer,
space = 8 + std::mem::size_of::<MintInfo>(),

View File

@ -23,7 +23,7 @@ pub struct TokenRegisterTrustless<'info> {
#[account(
init,
// using the token_index in this seed guards against reusing it
seeds = [group.key().as_ref(), b"Bank".as_ref(), &token_index.to_le_bytes(), &FIRST_BANK_NUM.to_le_bytes()],
seeds = [b"Bank".as_ref(), group.key().as_ref(), &token_index.to_le_bytes(), &FIRST_BANK_NUM.to_le_bytes()],
bump,
payer = payer,
space = 8 + std::mem::size_of::<Bank>(),
@ -32,7 +32,7 @@ pub struct TokenRegisterTrustless<'info> {
#[account(
init,
seeds = [group.key().as_ref(), b"Vault".as_ref(), &token_index.to_le_bytes(), &FIRST_BANK_NUM.to_le_bytes()],
seeds = [b"Vault".as_ref(), group.key().as_ref(), &token_index.to_le_bytes(), &FIRST_BANK_NUM.to_le_bytes()],
bump,
token::authority = group,
token::mint = mint,
@ -43,7 +43,7 @@ pub struct TokenRegisterTrustless<'info> {
#[account(
init,
// using the mint in this seed guards against registering the same mint twice
seeds = [group.key().as_ref(), b"MintInfo".as_ref(), mint.key().as_ref()],
seeds = [b"MintInfo".as_ref(), group.key().as_ref(), mint.key().as_ref()],
bump,
payer = payer,
space = 8 + std::mem::size_of::<MintInfo>(),

View File

@ -489,8 +489,8 @@ impl Bank {
macro_rules! bank_seeds {
( $bank:expr ) => {
&[
$bank.group.as_ref(),
b"Bank".as_ref(),
$bank.group.as_ref(),
$bank.token_index.to_le_bytes(),
&bank.bank_num.to_le_bytes(),
&[$bank.bump],

View File

@ -354,8 +354,8 @@ const_assert_eq!(size_of::<PerpOpenOrders>() % 8, 0);
macro_rules! account_seeds {
( $account:expr ) => {
&[
$account.group.as_ref(),
b"MangoAccount".as_ref(),
$account.group.as_ref(),
$account.owner.as_ref(),
&$account.account_num.to_le_bytes(),
&[$account.bump],

View File

@ -48,8 +48,8 @@ impl Serum3Market {
macro_rules! serum_market_seeds {
( $acc:expr ) => {
&[
$acc.group.as_ref(),
b"Serum3Market".as_ref(),
$acc.group.as_ref(),
$acc.serum_market_external.as_ref(),
&[$acc.bump],
]

View File

@ -128,8 +128,8 @@ async fn get_mint_info_by_mint(
) -> MintInfo {
let mint_info_pk = Pubkey::find_program_address(
&[
account.fixed.group.as_ref(),
b"MintInfo".as_ref(),
account.fixed.group.as_ref(),
mint.as_ref(),
],
&mango_v4::id(),
@ -145,8 +145,8 @@ async fn get_mint_info_by_token_index(
) -> MintInfo {
let bank_pk = Pubkey::find_program_address(
&[
account.fixed.group.as_ref(),
b"Bank".as_ref(),
account.fixed.group.as_ref(),
&token_index.to_le_bytes(),
&0u32.to_le_bytes(),
],
@ -160,8 +160,8 @@ async fn get_mint_info_by_token_index(
fn get_perp_market_address_by_index(group: Pubkey, perp_market_index: PerpMarketIndex) -> Pubkey {
Pubkey::find_program_address(
&[
group.as_ref(),
b"PerpMarket".as_ref(),
group.as_ref(),
&perp_market_index.to_le_bytes(),
],
&mango_v4::id(),
@ -466,8 +466,8 @@ impl<'keypair> ClientInstruction for TokenWithdrawInstruction<'keypair> {
.unwrap();
let mint_info = Pubkey::find_program_address(
&[
account.fixed.group.as_ref(),
b"MintInfo".as_ref(),
account.fixed.group.as_ref(),
token_account.mint.as_ref(),
],
&program_id,
@ -534,8 +534,8 @@ impl ClientInstruction for TokenDepositInstruction {
.unwrap();
let mint_info = Pubkey::find_program_address(
&[
account.fixed.group.as_ref(),
b"MintInfo".as_ref(),
account.fixed.group.as_ref(),
token_account.mint.as_ref(),
],
&program_id,
@ -633,8 +633,8 @@ impl<'keypair> ClientInstruction for TokenRegisterInstruction<'keypair> {
let bank = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"Bank".as_ref(),
self.group.as_ref(),
&self.token_index.to_le_bytes(),
&0u32.to_le_bytes(),
],
@ -643,8 +643,8 @@ impl<'keypair> ClientInstruction for TokenRegisterInstruction<'keypair> {
.0;
let vault = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"Vault".as_ref(),
self.group.as_ref(),
&self.token_index.to_le_bytes(),
&0u32.to_le_bytes(),
],
@ -653,8 +653,8 @@ impl<'keypair> ClientInstruction for TokenRegisterInstruction<'keypair> {
.0;
let mint_info = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"MintInfo".as_ref(),
self.group.as_ref(),
self.mint.as_ref(),
],
&program_id,
@ -663,8 +663,8 @@ impl<'keypair> ClientInstruction for TokenRegisterInstruction<'keypair> {
// TODO: remove copy pasta of pda derivation, use reference
let oracle = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"StubOracle".as_ref(),
self.group.as_ref(),
self.mint.as_ref(),
],
&program_id,
@ -718,8 +718,8 @@ impl<'keypair> ClientInstruction for TokenAddBankInstruction<'keypair> {
let existing_bank = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"Bank".as_ref(),
self.group.as_ref(),
&self.token_index.to_le_bytes(),
&0u32.to_le_bytes(),
],
@ -728,8 +728,8 @@ impl<'keypair> ClientInstruction for TokenAddBankInstruction<'keypair> {
.0;
let bank = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"Bank".as_ref(),
self.group.as_ref(),
&self.token_index.to_le_bytes(),
&self.bank_num.to_le_bytes(),
],
@ -738,8 +738,8 @@ impl<'keypair> ClientInstruction for TokenAddBankInstruction<'keypair> {
.0;
let vault = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"Vault".as_ref(),
self.group.as_ref(),
&self.token_index.to_le_bytes(),
&self.bank_num.to_le_bytes(),
],
@ -751,7 +751,7 @@ impl<'keypair> ClientInstruction for TokenAddBankInstruction<'keypair> {
let mint = existing_bank_data.mint;
let mint_info = Pubkey::find_program_address(
&[self.group.as_ref(), b"MintInfo".as_ref(), mint.as_ref()],
&[b"MintInfo".as_ref(), self.group.as_ref(), mint.as_ref()],
&program_id,
)
.0;
@ -869,8 +869,8 @@ impl<'keypair> ClientInstruction for StubOracleSetInstruction<'keypair> {
// TODO: remove copy pasta of pda derivation, use reference
let oracle = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"StubOracle".as_ref(),
self.group.as_ref(),
self.mint.as_ref(),
],
&program_id,
@ -915,8 +915,8 @@ impl<'keypair> ClientInstruction for StubOracleCreate<'keypair> {
let oracle = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"StubOracle".as_ref(),
self.group.as_ref(),
self.mint.as_ref(),
],
&program_id,
@ -961,8 +961,8 @@ impl<'keypair> ClientInstruction for StubOracleCloseInstruction<'keypair> {
let oracle = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"StubOracle".as_ref(),
self.group.as_ref(),
self.mint.as_ref(),
],
&program_id,
@ -1017,7 +1017,7 @@ impl<'keypair> ClientInstruction for GroupCreateInstruction<'keypair> {
.0;
let insurance_vault = Pubkey::find_program_address(
&[group.as_ref(), b"InsuranceVault".as_ref()],
&[b"InsuranceVault".as_ref(), group.as_ref()],
&program_id,
)
.0;
@ -1059,7 +1059,7 @@ impl<'keypair> ClientInstruction for GroupCloseInstruction<'keypair> {
let instruction = Self::Instruction {};
let insurance_vault = Pubkey::find_program_address(
&[self.group.as_ref(), b"InsuranceVault".as_ref()],
&[b"InsuranceVault".as_ref(), self.group.as_ref()],
&program_id,
)
.0;
@ -1111,8 +1111,8 @@ impl<'keypair> ClientInstruction for AccountCreateInstruction<'keypair> {
let account = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"MangoAccount".as_ref(),
self.group.as_ref(),
self.owner.pubkey().as_ref(),
&self.account_num.to_le_bytes(),
],
@ -1165,8 +1165,8 @@ impl<'keypair> ClientInstruction for AccountExpandInstruction<'keypair> {
let account = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"MangoAccount".as_ref(),
self.group.as_ref(),
self.owner.pubkey().as_ref(),
&self.account_num.to_le_bytes(),
],
@ -1214,8 +1214,8 @@ impl<'keypair> ClientInstruction for AccountEditInstruction<'keypair> {
let account = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"MangoAccount".as_ref(),
self.group.as_ref(),
self.owner.pubkey().as_ref(),
&self.account_num.to_le_bytes(),
],
@ -1301,8 +1301,8 @@ impl<'keypair> ClientInstruction for Serum3RegisterMarketInstruction<'keypair> {
let serum_market = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"Serum3Market".as_ref(),
self.group.as_ref(),
self.serum_market_external.as_ref(),
],
&program_id,
@ -1349,8 +1349,8 @@ impl<'keypair> ClientInstruction for Serum3DeregisterMarketInstruction<'keypair>
let serum_market = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"Serum3Market".as_ref(),
self.group.as_ref(),
self.serum_market_external.as_ref(),
],
&program_id,
@ -1395,8 +1395,8 @@ impl<'keypair> ClientInstruction for Serum3CreateOpenOrdersInstruction<'keypair>
let serum_market: Serum3Market = account_loader.load(&self.serum_market).await.unwrap();
let open_orders = Pubkey::find_program_address(
&[
self.account.as_ref(),
b"Serum3OO".as_ref(),
self.account.as_ref(),
self.serum_market.as_ref(),
],
&program_id,
@ -1446,8 +1446,8 @@ impl<'keypair> ClientInstruction for Serum3CloseOpenOrdersInstruction<'keypair>
let serum_market: Serum3Market = account_loader.load(&self.serum_market).await.unwrap();
let open_orders = Pubkey::find_program_address(
&[
self.account.as_ref(),
b"Serum3OO".as_ref(),
self.account.as_ref(),
self.serum_market.as_ref(),
],
&program_id,
@ -1996,8 +1996,8 @@ impl<'keypair> ClientInstruction for LiqTokenBankruptcyInstruction<'keypair> {
let quote_mint_info = Pubkey::find_program_address(
&[
liqee.fixed.group.as_ref(),
b"MintInfo".as_ref(),
liqee.fixed.group.as_ref(),
group.insurance_mint.as_ref(),
],
&program_id,
@ -2006,7 +2006,7 @@ impl<'keypair> ClientInstruction for LiqTokenBankruptcyInstruction<'keypair> {
let quote_mint_info: MintInfo = account_loader.load(&quote_mint_info).await.unwrap();
let insurance_vault = Pubkey::find_program_address(
&[group_key.as_ref(), b"InsuranceVault".as_ref()],
&[b"InsuranceVault".as_ref(), group_key.as_ref()],
&program_id,
)
.0;
@ -2097,8 +2097,8 @@ impl<'keypair> ClientInstruction for PerpCreateMarketInstruction<'keypair> {
let perp_market = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"PerpMarket".as_ref(),
self.group.as_ref(),
self.perp_market_index.to_le_bytes().as_ref(),
],
&program_id,

View File

@ -45,15 +45,15 @@ export type MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "InsuranceVault"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
}
]
}
@ -174,16 +174,16 @@ export type MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "Bank"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "arg",
"type": "u16",
@ -203,16 +203,16 @@ export type MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "Vault"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "arg",
"type": "u16",
@ -232,16 +232,16 @@ export type MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "MintInfo"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "account",
"type": "publicKey",
@ -352,16 +352,16 @@ export type MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "Bank"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "arg",
"type": "u16",
@ -381,16 +381,16 @@ export type MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "Vault"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "arg",
"type": "u16",
@ -410,16 +410,16 @@ export type MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "MintInfo"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "account",
"type": "publicKey",
@ -591,16 +591,16 @@ export type MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "Bank"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "arg",
"type": "u16",
@ -620,16 +620,16 @@ export type MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "Vault"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "arg",
"type": "u16",
@ -649,16 +649,16 @@ export type MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "MintInfo"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "account",
"type": "publicKey",
@ -781,16 +781,16 @@ export type MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "MangoAccount"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "account",
"type": "publicKey",
@ -974,16 +974,16 @@ export type MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "StubOracle"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "account",
"type": "publicKey",
@ -1269,16 +1269,16 @@ export type MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "Serum3Market"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "account",
"type": "publicKey",
@ -1389,16 +1389,16 @@ export type MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "account"
},
{
"kind": "const",
"type": "string",
"value": "Serum3OO"
},
{
"kind": "account",
"type": "publicKey",
"path": "account"
},
{
"kind": "account",
"type": "publicKey",
@ -2049,16 +2049,16 @@ export type MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "PerpMarket"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "arg",
"type": "u16",
@ -4011,18 +4011,14 @@ export type MangoV4 = {
}
},
{
"name": "baseEntryLots",
"name": "quoteEntryNative",
"docs": [
"Tracks what the position is to calculate average entry & break even price"
"Tracks what the position is to calculate average entry & break even price"
],
"type": "i64"
},
{
"name": "quoteEntryNative",
"type": "i64"
},
{
"name": "quoteExitNative",
"name": "quoteRunningNative",
"type": "i64"
},
{
@ -5089,15 +5085,15 @@ export const IDL: MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "InsuranceVault"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
}
]
}
@ -5218,16 +5214,16 @@ export const IDL: MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "Bank"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "arg",
"type": "u16",
@ -5247,16 +5243,16 @@ export const IDL: MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "Vault"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "arg",
"type": "u16",
@ -5276,16 +5272,16 @@ export const IDL: MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "MintInfo"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "account",
"type": "publicKey",
@ -5396,16 +5392,16 @@ export const IDL: MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "Bank"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "arg",
"type": "u16",
@ -5425,16 +5421,16 @@ export const IDL: MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "Vault"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "arg",
"type": "u16",
@ -5454,16 +5450,16 @@ export const IDL: MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "MintInfo"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "account",
"type": "publicKey",
@ -5635,16 +5631,16 @@ export const IDL: MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "Bank"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "arg",
"type": "u16",
@ -5664,16 +5660,16 @@ export const IDL: MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "Vault"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "arg",
"type": "u16",
@ -5693,16 +5689,16 @@ export const IDL: MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "MintInfo"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "account",
"type": "publicKey",
@ -5825,16 +5821,16 @@ export const IDL: MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "MangoAccount"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "account",
"type": "publicKey",
@ -6018,16 +6014,16 @@ export const IDL: MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "StubOracle"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "account",
"type": "publicKey",
@ -6313,16 +6309,16 @@ export const IDL: MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "Serum3Market"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "account",
"type": "publicKey",
@ -6433,16 +6429,16 @@ export const IDL: MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "account"
},
{
"kind": "const",
"type": "string",
"value": "Serum3OO"
},
{
"kind": "account",
"type": "publicKey",
"path": "account"
},
{
"kind": "account",
"type": "publicKey",
@ -7093,16 +7089,16 @@ export const IDL: MangoV4 = {
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "const",
"type": "string",
"value": "PerpMarket"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "arg",
"type": "u16",
@ -9055,18 +9051,14 @@ export const IDL: MangoV4 = {
}
},
{
"name": "baseEntryLots",
"name": "quoteEntryNative",
"docs": [
"Tracks what the position is to calculate average entry & break even price"
"Tracks what the position is to calculate average entry & break even price"
],
"type": "i64"
},
{
"name": "quoteEntryNative",
"type": "i64"
},
{
"name": "quoteExitNative",
"name": "quoteRunningNative",
"type": "i64"
},
{