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:
parent
a3067e2448
commit
21815612ae
|
@ -11,7 +11,7 @@ pub struct AccountCreate<'info> {
|
||||||
|
|
||||||
#[account(
|
#[account(
|
||||||
init,
|
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,
|
bump,
|
||||||
payer = payer,
|
payer = payer,
|
||||||
space = MangoAccount::space(token_count, serum3_count, perp_count, perp_oo_count)?,
|
space = MangoAccount::space(token_count, serum3_count, perp_count, perp_oo_count)?,
|
||||||
|
|
|
@ -22,7 +22,7 @@ pub struct GroupCreate<'info> {
|
||||||
|
|
||||||
#[account(
|
#[account(
|
||||||
init,
|
init,
|
||||||
seeds = [group.key().as_ref(), b"InsuranceVault".as_ref()],
|
seeds = [b"InsuranceVault".as_ref(), group.key().as_ref()],
|
||||||
bump,
|
bump,
|
||||||
token::authority = group,
|
token::authority = group,
|
||||||
token::mint = insurance_mint,
|
token::mint = insurance_mint,
|
||||||
|
|
|
@ -21,7 +21,7 @@ pub struct PerpCreateMarket<'info> {
|
||||||
|
|
||||||
#[account(
|
#[account(
|
||||||
init,
|
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,
|
bump,
|
||||||
payer = payer,
|
payer = payer,
|
||||||
space = 8 + std::mem::size_of::<PerpMarket>(),
|
space = 8 + std::mem::size_of::<PerpMarket>(),
|
||||||
|
|
|
@ -25,7 +25,7 @@ pub struct Serum3CreateOpenOrders<'info> {
|
||||||
// initialized by this instruction via cpi to serum
|
// initialized by this instruction via cpi to serum
|
||||||
#[account(
|
#[account(
|
||||||
init,
|
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,
|
bump,
|
||||||
payer = payer,
|
payer = payer,
|
||||||
owner = serum_program.key(),
|
owner = serum_program.key(),
|
||||||
|
|
|
@ -24,7 +24,7 @@ pub struct Serum3RegisterMarket<'info> {
|
||||||
#[account(
|
#[account(
|
||||||
init,
|
init,
|
||||||
// using the serum_market_external in the seed guards against registering the same market twice
|
// 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,
|
bump,
|
||||||
payer = payer,
|
payer = payer,
|
||||||
space = 8 + std::mem::size_of::<Serum3Market>(),
|
space = 8 + std::mem::size_of::<Serum3Market>(),
|
||||||
|
|
|
@ -13,7 +13,7 @@ pub struct StubOracleCreate<'info> {
|
||||||
|
|
||||||
#[account(
|
#[account(
|
||||||
init,
|
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,
|
bump,
|
||||||
payer = payer,
|
payer = payer,
|
||||||
space = 8 + std::mem::size_of::<StubOracle>(),
|
space = 8 + std::mem::size_of::<StubOracle>(),
|
||||||
|
|
|
@ -25,7 +25,7 @@ pub struct TokenAddBank<'info> {
|
||||||
#[account(
|
#[account(
|
||||||
init,
|
init,
|
||||||
// using the token_index in this seed guards against reusing it
|
// 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,
|
bump,
|
||||||
payer = payer,
|
payer = payer,
|
||||||
space = 8 + std::mem::size_of::<Bank>(),
|
space = 8 + std::mem::size_of::<Bank>(),
|
||||||
|
@ -34,7 +34,7 @@ pub struct TokenAddBank<'info> {
|
||||||
|
|
||||||
#[account(
|
#[account(
|
||||||
init,
|
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,
|
bump,
|
||||||
token::authority = group,
|
token::authority = group,
|
||||||
token::mint = mint,
|
token::mint = mint,
|
||||||
|
@ -44,7 +44,7 @@ pub struct TokenAddBank<'info> {
|
||||||
|
|
||||||
#[account(
|
#[account(
|
||||||
mut,
|
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
|
bump
|
||||||
)]
|
)]
|
||||||
pub mint_info: AccountLoader<'info, MintInfo>,
|
pub mint_info: AccountLoader<'info, MintInfo>,
|
||||||
|
|
|
@ -25,7 +25,7 @@ pub struct TokenRegister<'info> {
|
||||||
#[account(
|
#[account(
|
||||||
init,
|
init,
|
||||||
// using the token_index in this seed guards against reusing it
|
// 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,
|
bump,
|
||||||
payer = payer,
|
payer = payer,
|
||||||
space = 8 + std::mem::size_of::<Bank>(),
|
space = 8 + std::mem::size_of::<Bank>(),
|
||||||
|
@ -34,7 +34,7 @@ pub struct TokenRegister<'info> {
|
||||||
|
|
||||||
#[account(
|
#[account(
|
||||||
init,
|
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,
|
bump,
|
||||||
token::authority = group,
|
token::authority = group,
|
||||||
token::mint = mint,
|
token::mint = mint,
|
||||||
|
@ -45,7 +45,7 @@ pub struct TokenRegister<'info> {
|
||||||
#[account(
|
#[account(
|
||||||
init,
|
init,
|
||||||
// using the mint in this seed guards against registering the same mint twice
|
// 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,
|
bump,
|
||||||
payer = payer,
|
payer = payer,
|
||||||
space = 8 + std::mem::size_of::<MintInfo>(),
|
space = 8 + std::mem::size_of::<MintInfo>(),
|
||||||
|
|
|
@ -23,7 +23,7 @@ pub struct TokenRegisterTrustless<'info> {
|
||||||
#[account(
|
#[account(
|
||||||
init,
|
init,
|
||||||
// using the token_index in this seed guards against reusing it
|
// 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,
|
bump,
|
||||||
payer = payer,
|
payer = payer,
|
||||||
space = 8 + std::mem::size_of::<Bank>(),
|
space = 8 + std::mem::size_of::<Bank>(),
|
||||||
|
@ -32,7 +32,7 @@ pub struct TokenRegisterTrustless<'info> {
|
||||||
|
|
||||||
#[account(
|
#[account(
|
||||||
init,
|
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,
|
bump,
|
||||||
token::authority = group,
|
token::authority = group,
|
||||||
token::mint = mint,
|
token::mint = mint,
|
||||||
|
@ -43,7 +43,7 @@ pub struct TokenRegisterTrustless<'info> {
|
||||||
#[account(
|
#[account(
|
||||||
init,
|
init,
|
||||||
// using the mint in this seed guards against registering the same mint twice
|
// 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,
|
bump,
|
||||||
payer = payer,
|
payer = payer,
|
||||||
space = 8 + std::mem::size_of::<MintInfo>(),
|
space = 8 + std::mem::size_of::<MintInfo>(),
|
||||||
|
|
|
@ -489,8 +489,8 @@ impl Bank {
|
||||||
macro_rules! bank_seeds {
|
macro_rules! bank_seeds {
|
||||||
( $bank:expr ) => {
|
( $bank:expr ) => {
|
||||||
&[
|
&[
|
||||||
$bank.group.as_ref(),
|
|
||||||
b"Bank".as_ref(),
|
b"Bank".as_ref(),
|
||||||
|
$bank.group.as_ref(),
|
||||||
$bank.token_index.to_le_bytes(),
|
$bank.token_index.to_le_bytes(),
|
||||||
&bank.bank_num.to_le_bytes(),
|
&bank.bank_num.to_le_bytes(),
|
||||||
&[$bank.bump],
|
&[$bank.bump],
|
||||||
|
|
|
@ -354,8 +354,8 @@ const_assert_eq!(size_of::<PerpOpenOrders>() % 8, 0);
|
||||||
macro_rules! account_seeds {
|
macro_rules! account_seeds {
|
||||||
( $account:expr ) => {
|
( $account:expr ) => {
|
||||||
&[
|
&[
|
||||||
$account.group.as_ref(),
|
|
||||||
b"MangoAccount".as_ref(),
|
b"MangoAccount".as_ref(),
|
||||||
|
$account.group.as_ref(),
|
||||||
$account.owner.as_ref(),
|
$account.owner.as_ref(),
|
||||||
&$account.account_num.to_le_bytes(),
|
&$account.account_num.to_le_bytes(),
|
||||||
&[$account.bump],
|
&[$account.bump],
|
||||||
|
|
|
@ -48,8 +48,8 @@ impl Serum3Market {
|
||||||
macro_rules! serum_market_seeds {
|
macro_rules! serum_market_seeds {
|
||||||
( $acc:expr ) => {
|
( $acc:expr ) => {
|
||||||
&[
|
&[
|
||||||
$acc.group.as_ref(),
|
|
||||||
b"Serum3Market".as_ref(),
|
b"Serum3Market".as_ref(),
|
||||||
|
$acc.group.as_ref(),
|
||||||
$acc.serum_market_external.as_ref(),
|
$acc.serum_market_external.as_ref(),
|
||||||
&[$acc.bump],
|
&[$acc.bump],
|
||||||
]
|
]
|
||||||
|
|
|
@ -128,8 +128,8 @@ async fn get_mint_info_by_mint(
|
||||||
) -> MintInfo {
|
) -> MintInfo {
|
||||||
let mint_info_pk = Pubkey::find_program_address(
|
let mint_info_pk = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
account.fixed.group.as_ref(),
|
|
||||||
b"MintInfo".as_ref(),
|
b"MintInfo".as_ref(),
|
||||||
|
account.fixed.group.as_ref(),
|
||||||
mint.as_ref(),
|
mint.as_ref(),
|
||||||
],
|
],
|
||||||
&mango_v4::id(),
|
&mango_v4::id(),
|
||||||
|
@ -145,8 +145,8 @@ async fn get_mint_info_by_token_index(
|
||||||
) -> MintInfo {
|
) -> MintInfo {
|
||||||
let bank_pk = Pubkey::find_program_address(
|
let bank_pk = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
account.fixed.group.as_ref(),
|
|
||||||
b"Bank".as_ref(),
|
b"Bank".as_ref(),
|
||||||
|
account.fixed.group.as_ref(),
|
||||||
&token_index.to_le_bytes(),
|
&token_index.to_le_bytes(),
|
||||||
&0u32.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 {
|
fn get_perp_market_address_by_index(group: Pubkey, perp_market_index: PerpMarketIndex) -> Pubkey {
|
||||||
Pubkey::find_program_address(
|
Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
group.as_ref(),
|
|
||||||
b"PerpMarket".as_ref(),
|
b"PerpMarket".as_ref(),
|
||||||
|
group.as_ref(),
|
||||||
&perp_market_index.to_le_bytes(),
|
&perp_market_index.to_le_bytes(),
|
||||||
],
|
],
|
||||||
&mango_v4::id(),
|
&mango_v4::id(),
|
||||||
|
@ -466,8 +466,8 @@ impl<'keypair> ClientInstruction for TokenWithdrawInstruction<'keypair> {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let mint_info = Pubkey::find_program_address(
|
let mint_info = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
account.fixed.group.as_ref(),
|
|
||||||
b"MintInfo".as_ref(),
|
b"MintInfo".as_ref(),
|
||||||
|
account.fixed.group.as_ref(),
|
||||||
token_account.mint.as_ref(),
|
token_account.mint.as_ref(),
|
||||||
],
|
],
|
||||||
&program_id,
|
&program_id,
|
||||||
|
@ -534,8 +534,8 @@ impl ClientInstruction for TokenDepositInstruction {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let mint_info = Pubkey::find_program_address(
|
let mint_info = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
account.fixed.group.as_ref(),
|
|
||||||
b"MintInfo".as_ref(),
|
b"MintInfo".as_ref(),
|
||||||
|
account.fixed.group.as_ref(),
|
||||||
token_account.mint.as_ref(),
|
token_account.mint.as_ref(),
|
||||||
],
|
],
|
||||||
&program_id,
|
&program_id,
|
||||||
|
@ -633,8 +633,8 @@ impl<'keypair> ClientInstruction for TokenRegisterInstruction<'keypair> {
|
||||||
|
|
||||||
let bank = Pubkey::find_program_address(
|
let bank = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.group.as_ref(),
|
|
||||||
b"Bank".as_ref(),
|
b"Bank".as_ref(),
|
||||||
|
self.group.as_ref(),
|
||||||
&self.token_index.to_le_bytes(),
|
&self.token_index.to_le_bytes(),
|
||||||
&0u32.to_le_bytes(),
|
&0u32.to_le_bytes(),
|
||||||
],
|
],
|
||||||
|
@ -643,8 +643,8 @@ impl<'keypair> ClientInstruction for TokenRegisterInstruction<'keypair> {
|
||||||
.0;
|
.0;
|
||||||
let vault = Pubkey::find_program_address(
|
let vault = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.group.as_ref(),
|
|
||||||
b"Vault".as_ref(),
|
b"Vault".as_ref(),
|
||||||
|
self.group.as_ref(),
|
||||||
&self.token_index.to_le_bytes(),
|
&self.token_index.to_le_bytes(),
|
||||||
&0u32.to_le_bytes(),
|
&0u32.to_le_bytes(),
|
||||||
],
|
],
|
||||||
|
@ -653,8 +653,8 @@ impl<'keypair> ClientInstruction for TokenRegisterInstruction<'keypair> {
|
||||||
.0;
|
.0;
|
||||||
let mint_info = Pubkey::find_program_address(
|
let mint_info = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.group.as_ref(),
|
|
||||||
b"MintInfo".as_ref(),
|
b"MintInfo".as_ref(),
|
||||||
|
self.group.as_ref(),
|
||||||
self.mint.as_ref(),
|
self.mint.as_ref(),
|
||||||
],
|
],
|
||||||
&program_id,
|
&program_id,
|
||||||
|
@ -663,8 +663,8 @@ impl<'keypair> ClientInstruction for TokenRegisterInstruction<'keypair> {
|
||||||
// TODO: remove copy pasta of pda derivation, use reference
|
// TODO: remove copy pasta of pda derivation, use reference
|
||||||
let oracle = Pubkey::find_program_address(
|
let oracle = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.group.as_ref(),
|
|
||||||
b"StubOracle".as_ref(),
|
b"StubOracle".as_ref(),
|
||||||
|
self.group.as_ref(),
|
||||||
self.mint.as_ref(),
|
self.mint.as_ref(),
|
||||||
],
|
],
|
||||||
&program_id,
|
&program_id,
|
||||||
|
@ -718,8 +718,8 @@ impl<'keypair> ClientInstruction for TokenAddBankInstruction<'keypair> {
|
||||||
|
|
||||||
let existing_bank = Pubkey::find_program_address(
|
let existing_bank = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.group.as_ref(),
|
|
||||||
b"Bank".as_ref(),
|
b"Bank".as_ref(),
|
||||||
|
self.group.as_ref(),
|
||||||
&self.token_index.to_le_bytes(),
|
&self.token_index.to_le_bytes(),
|
||||||
&0u32.to_le_bytes(),
|
&0u32.to_le_bytes(),
|
||||||
],
|
],
|
||||||
|
@ -728,8 +728,8 @@ impl<'keypair> ClientInstruction for TokenAddBankInstruction<'keypair> {
|
||||||
.0;
|
.0;
|
||||||
let bank = Pubkey::find_program_address(
|
let bank = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.group.as_ref(),
|
|
||||||
b"Bank".as_ref(),
|
b"Bank".as_ref(),
|
||||||
|
self.group.as_ref(),
|
||||||
&self.token_index.to_le_bytes(),
|
&self.token_index.to_le_bytes(),
|
||||||
&self.bank_num.to_le_bytes(),
|
&self.bank_num.to_le_bytes(),
|
||||||
],
|
],
|
||||||
|
@ -738,8 +738,8 @@ impl<'keypair> ClientInstruction for TokenAddBankInstruction<'keypair> {
|
||||||
.0;
|
.0;
|
||||||
let vault = Pubkey::find_program_address(
|
let vault = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.group.as_ref(),
|
|
||||||
b"Vault".as_ref(),
|
b"Vault".as_ref(),
|
||||||
|
self.group.as_ref(),
|
||||||
&self.token_index.to_le_bytes(),
|
&self.token_index.to_le_bytes(),
|
||||||
&self.bank_num.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 = existing_bank_data.mint;
|
||||||
|
|
||||||
let mint_info = Pubkey::find_program_address(
|
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,
|
&program_id,
|
||||||
)
|
)
|
||||||
.0;
|
.0;
|
||||||
|
@ -869,8 +869,8 @@ impl<'keypair> ClientInstruction for StubOracleSetInstruction<'keypair> {
|
||||||
// TODO: remove copy pasta of pda derivation, use reference
|
// TODO: remove copy pasta of pda derivation, use reference
|
||||||
let oracle = Pubkey::find_program_address(
|
let oracle = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.group.as_ref(),
|
|
||||||
b"StubOracle".as_ref(),
|
b"StubOracle".as_ref(),
|
||||||
|
self.group.as_ref(),
|
||||||
self.mint.as_ref(),
|
self.mint.as_ref(),
|
||||||
],
|
],
|
||||||
&program_id,
|
&program_id,
|
||||||
|
@ -915,8 +915,8 @@ impl<'keypair> ClientInstruction for StubOracleCreate<'keypair> {
|
||||||
|
|
||||||
let oracle = Pubkey::find_program_address(
|
let oracle = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.group.as_ref(),
|
|
||||||
b"StubOracle".as_ref(),
|
b"StubOracle".as_ref(),
|
||||||
|
self.group.as_ref(),
|
||||||
self.mint.as_ref(),
|
self.mint.as_ref(),
|
||||||
],
|
],
|
||||||
&program_id,
|
&program_id,
|
||||||
|
@ -961,8 +961,8 @@ impl<'keypair> ClientInstruction for StubOracleCloseInstruction<'keypair> {
|
||||||
|
|
||||||
let oracle = Pubkey::find_program_address(
|
let oracle = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.group.as_ref(),
|
|
||||||
b"StubOracle".as_ref(),
|
b"StubOracle".as_ref(),
|
||||||
|
self.group.as_ref(),
|
||||||
self.mint.as_ref(),
|
self.mint.as_ref(),
|
||||||
],
|
],
|
||||||
&program_id,
|
&program_id,
|
||||||
|
@ -1017,7 +1017,7 @@ impl<'keypair> ClientInstruction for GroupCreateInstruction<'keypair> {
|
||||||
.0;
|
.0;
|
||||||
|
|
||||||
let insurance_vault = Pubkey::find_program_address(
|
let insurance_vault = Pubkey::find_program_address(
|
||||||
&[group.as_ref(), b"InsuranceVault".as_ref()],
|
&[b"InsuranceVault".as_ref(), group.as_ref()],
|
||||||
&program_id,
|
&program_id,
|
||||||
)
|
)
|
||||||
.0;
|
.0;
|
||||||
|
@ -1059,7 +1059,7 @@ impl<'keypair> ClientInstruction for GroupCloseInstruction<'keypair> {
|
||||||
let instruction = Self::Instruction {};
|
let instruction = Self::Instruction {};
|
||||||
|
|
||||||
let insurance_vault = Pubkey::find_program_address(
|
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,
|
&program_id,
|
||||||
)
|
)
|
||||||
.0;
|
.0;
|
||||||
|
@ -1111,8 +1111,8 @@ impl<'keypair> ClientInstruction for AccountCreateInstruction<'keypair> {
|
||||||
|
|
||||||
let account = Pubkey::find_program_address(
|
let account = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.group.as_ref(),
|
|
||||||
b"MangoAccount".as_ref(),
|
b"MangoAccount".as_ref(),
|
||||||
|
self.group.as_ref(),
|
||||||
self.owner.pubkey().as_ref(),
|
self.owner.pubkey().as_ref(),
|
||||||
&self.account_num.to_le_bytes(),
|
&self.account_num.to_le_bytes(),
|
||||||
],
|
],
|
||||||
|
@ -1165,8 +1165,8 @@ impl<'keypair> ClientInstruction for AccountExpandInstruction<'keypair> {
|
||||||
|
|
||||||
let account = Pubkey::find_program_address(
|
let account = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.group.as_ref(),
|
|
||||||
b"MangoAccount".as_ref(),
|
b"MangoAccount".as_ref(),
|
||||||
|
self.group.as_ref(),
|
||||||
self.owner.pubkey().as_ref(),
|
self.owner.pubkey().as_ref(),
|
||||||
&self.account_num.to_le_bytes(),
|
&self.account_num.to_le_bytes(),
|
||||||
],
|
],
|
||||||
|
@ -1214,8 +1214,8 @@ impl<'keypair> ClientInstruction for AccountEditInstruction<'keypair> {
|
||||||
|
|
||||||
let account = Pubkey::find_program_address(
|
let account = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.group.as_ref(),
|
|
||||||
b"MangoAccount".as_ref(),
|
b"MangoAccount".as_ref(),
|
||||||
|
self.group.as_ref(),
|
||||||
self.owner.pubkey().as_ref(),
|
self.owner.pubkey().as_ref(),
|
||||||
&self.account_num.to_le_bytes(),
|
&self.account_num.to_le_bytes(),
|
||||||
],
|
],
|
||||||
|
@ -1301,8 +1301,8 @@ impl<'keypair> ClientInstruction for Serum3RegisterMarketInstruction<'keypair> {
|
||||||
|
|
||||||
let serum_market = Pubkey::find_program_address(
|
let serum_market = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.group.as_ref(),
|
|
||||||
b"Serum3Market".as_ref(),
|
b"Serum3Market".as_ref(),
|
||||||
|
self.group.as_ref(),
|
||||||
self.serum_market_external.as_ref(),
|
self.serum_market_external.as_ref(),
|
||||||
],
|
],
|
||||||
&program_id,
|
&program_id,
|
||||||
|
@ -1349,8 +1349,8 @@ impl<'keypair> ClientInstruction for Serum3DeregisterMarketInstruction<'keypair>
|
||||||
|
|
||||||
let serum_market = Pubkey::find_program_address(
|
let serum_market = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.group.as_ref(),
|
|
||||||
b"Serum3Market".as_ref(),
|
b"Serum3Market".as_ref(),
|
||||||
|
self.group.as_ref(),
|
||||||
self.serum_market_external.as_ref(),
|
self.serum_market_external.as_ref(),
|
||||||
],
|
],
|
||||||
&program_id,
|
&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 serum_market: Serum3Market = account_loader.load(&self.serum_market).await.unwrap();
|
||||||
let open_orders = Pubkey::find_program_address(
|
let open_orders = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.account.as_ref(),
|
|
||||||
b"Serum3OO".as_ref(),
|
b"Serum3OO".as_ref(),
|
||||||
|
self.account.as_ref(),
|
||||||
self.serum_market.as_ref(),
|
self.serum_market.as_ref(),
|
||||||
],
|
],
|
||||||
&program_id,
|
&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 serum_market: Serum3Market = account_loader.load(&self.serum_market).await.unwrap();
|
||||||
let open_orders = Pubkey::find_program_address(
|
let open_orders = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.account.as_ref(),
|
|
||||||
b"Serum3OO".as_ref(),
|
b"Serum3OO".as_ref(),
|
||||||
|
self.account.as_ref(),
|
||||||
self.serum_market.as_ref(),
|
self.serum_market.as_ref(),
|
||||||
],
|
],
|
||||||
&program_id,
|
&program_id,
|
||||||
|
@ -1996,8 +1996,8 @@ impl<'keypair> ClientInstruction for LiqTokenBankruptcyInstruction<'keypair> {
|
||||||
|
|
||||||
let quote_mint_info = Pubkey::find_program_address(
|
let quote_mint_info = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
liqee.fixed.group.as_ref(),
|
|
||||||
b"MintInfo".as_ref(),
|
b"MintInfo".as_ref(),
|
||||||
|
liqee.fixed.group.as_ref(),
|
||||||
group.insurance_mint.as_ref(),
|
group.insurance_mint.as_ref(),
|
||||||
],
|
],
|
||||||
&program_id,
|
&program_id,
|
||||||
|
@ -2006,7 +2006,7 @@ impl<'keypair> ClientInstruction for LiqTokenBankruptcyInstruction<'keypair> {
|
||||||
let quote_mint_info: MintInfo = account_loader.load("e_mint_info).await.unwrap();
|
let quote_mint_info: MintInfo = account_loader.load("e_mint_info).await.unwrap();
|
||||||
|
|
||||||
let insurance_vault = Pubkey::find_program_address(
|
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,
|
&program_id,
|
||||||
)
|
)
|
||||||
.0;
|
.0;
|
||||||
|
@ -2097,8 +2097,8 @@ impl<'keypair> ClientInstruction for PerpCreateMarketInstruction<'keypair> {
|
||||||
|
|
||||||
let perp_market = Pubkey::find_program_address(
|
let perp_market = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
self.group.as_ref(),
|
|
||||||
b"PerpMarket".as_ref(),
|
b"PerpMarket".as_ref(),
|
||||||
|
self.group.as_ref(),
|
||||||
self.perp_market_index.to_le_bytes().as_ref(),
|
self.perp_market_index.to_le_bytes().as_ref(),
|
||||||
],
|
],
|
||||||
&program_id,
|
&program_id,
|
||||||
|
|
|
@ -45,15 +45,15 @@ export type MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "InsuranceVault"
|
"value": "InsuranceVault"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -174,16 +174,16 @@ export type MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Bank"
|
"value": "Bank"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "arg",
|
"kind": "arg",
|
||||||
"type": "u16",
|
"type": "u16",
|
||||||
|
@ -203,16 +203,16 @@ export type MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Vault"
|
"value": "Vault"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "arg",
|
"kind": "arg",
|
||||||
"type": "u16",
|
"type": "u16",
|
||||||
|
@ -232,16 +232,16 @@ export type MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "MintInfo"
|
"value": "MintInfo"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "account",
|
"kind": "account",
|
||||||
"type": "publicKey",
|
"type": "publicKey",
|
||||||
|
@ -352,16 +352,16 @@ export type MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Bank"
|
"value": "Bank"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "arg",
|
"kind": "arg",
|
||||||
"type": "u16",
|
"type": "u16",
|
||||||
|
@ -381,16 +381,16 @@ export type MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Vault"
|
"value": "Vault"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "arg",
|
"kind": "arg",
|
||||||
"type": "u16",
|
"type": "u16",
|
||||||
|
@ -410,16 +410,16 @@ export type MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "MintInfo"
|
"value": "MintInfo"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "account",
|
"kind": "account",
|
||||||
"type": "publicKey",
|
"type": "publicKey",
|
||||||
|
@ -591,16 +591,16 @@ export type MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Bank"
|
"value": "Bank"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "arg",
|
"kind": "arg",
|
||||||
"type": "u16",
|
"type": "u16",
|
||||||
|
@ -620,16 +620,16 @@ export type MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Vault"
|
"value": "Vault"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "arg",
|
"kind": "arg",
|
||||||
"type": "u16",
|
"type": "u16",
|
||||||
|
@ -649,16 +649,16 @@ export type MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "MintInfo"
|
"value": "MintInfo"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "account",
|
"kind": "account",
|
||||||
"type": "publicKey",
|
"type": "publicKey",
|
||||||
|
@ -781,16 +781,16 @@ export type MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "MangoAccount"
|
"value": "MangoAccount"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "account",
|
"kind": "account",
|
||||||
"type": "publicKey",
|
"type": "publicKey",
|
||||||
|
@ -974,16 +974,16 @@ export type MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "StubOracle"
|
"value": "StubOracle"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "account",
|
"kind": "account",
|
||||||
"type": "publicKey",
|
"type": "publicKey",
|
||||||
|
@ -1269,16 +1269,16 @@ export type MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Serum3Market"
|
"value": "Serum3Market"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "account",
|
"kind": "account",
|
||||||
"type": "publicKey",
|
"type": "publicKey",
|
||||||
|
@ -1389,16 +1389,16 @@ export type MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "account"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Serum3OO"
|
"value": "Serum3OO"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "account"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "account",
|
"kind": "account",
|
||||||
"type": "publicKey",
|
"type": "publicKey",
|
||||||
|
@ -2049,16 +2049,16 @@ export type MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "PerpMarket"
|
"value": "PerpMarket"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "arg",
|
"kind": "arg",
|
||||||
"type": "u16",
|
"type": "u16",
|
||||||
|
@ -4011,18 +4011,14 @@ export type MangoV4 = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "baseEntryLots",
|
"name": "quoteEntryNative",
|
||||||
"docs": [
|
"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"
|
"type": "i64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "quoteEntryNative",
|
"name": "quoteRunningNative",
|
||||||
"type": "i64"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "quoteExitNative",
|
|
||||||
"type": "i64"
|
"type": "i64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -5089,15 +5085,15 @@ export const IDL: MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "InsuranceVault"
|
"value": "InsuranceVault"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -5218,16 +5214,16 @@ export const IDL: MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Bank"
|
"value": "Bank"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "arg",
|
"kind": "arg",
|
||||||
"type": "u16",
|
"type": "u16",
|
||||||
|
@ -5247,16 +5243,16 @@ export const IDL: MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Vault"
|
"value": "Vault"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "arg",
|
"kind": "arg",
|
||||||
"type": "u16",
|
"type": "u16",
|
||||||
|
@ -5276,16 +5272,16 @@ export const IDL: MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "MintInfo"
|
"value": "MintInfo"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "account",
|
"kind": "account",
|
||||||
"type": "publicKey",
|
"type": "publicKey",
|
||||||
|
@ -5396,16 +5392,16 @@ export const IDL: MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Bank"
|
"value": "Bank"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "arg",
|
"kind": "arg",
|
||||||
"type": "u16",
|
"type": "u16",
|
||||||
|
@ -5425,16 +5421,16 @@ export const IDL: MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Vault"
|
"value": "Vault"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "arg",
|
"kind": "arg",
|
||||||
"type": "u16",
|
"type": "u16",
|
||||||
|
@ -5454,16 +5450,16 @@ export const IDL: MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "MintInfo"
|
"value": "MintInfo"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "account",
|
"kind": "account",
|
||||||
"type": "publicKey",
|
"type": "publicKey",
|
||||||
|
@ -5635,16 +5631,16 @@ export const IDL: MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Bank"
|
"value": "Bank"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "arg",
|
"kind": "arg",
|
||||||
"type": "u16",
|
"type": "u16",
|
||||||
|
@ -5664,16 +5660,16 @@ export const IDL: MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Vault"
|
"value": "Vault"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "arg",
|
"kind": "arg",
|
||||||
"type": "u16",
|
"type": "u16",
|
||||||
|
@ -5693,16 +5689,16 @@ export const IDL: MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "MintInfo"
|
"value": "MintInfo"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "account",
|
"kind": "account",
|
||||||
"type": "publicKey",
|
"type": "publicKey",
|
||||||
|
@ -5825,16 +5821,16 @@ export const IDL: MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "MangoAccount"
|
"value": "MangoAccount"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "account",
|
"kind": "account",
|
||||||
"type": "publicKey",
|
"type": "publicKey",
|
||||||
|
@ -6018,16 +6014,16 @@ export const IDL: MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "StubOracle"
|
"value": "StubOracle"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "account",
|
"kind": "account",
|
||||||
"type": "publicKey",
|
"type": "publicKey",
|
||||||
|
@ -6313,16 +6309,16 @@ export const IDL: MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Serum3Market"
|
"value": "Serum3Market"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "account",
|
"kind": "account",
|
||||||
"type": "publicKey",
|
"type": "publicKey",
|
||||||
|
@ -6433,16 +6429,16 @@ export const IDL: MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "account"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Serum3OO"
|
"value": "Serum3OO"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "account"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "account",
|
"kind": "account",
|
||||||
"type": "publicKey",
|
"type": "publicKey",
|
||||||
|
@ -7093,16 +7089,16 @@ export const IDL: MangoV4 = {
|
||||||
"isSigner": false,
|
"isSigner": false,
|
||||||
"pda": {
|
"pda": {
|
||||||
"seeds": [
|
"seeds": [
|
||||||
{
|
|
||||||
"kind": "account",
|
|
||||||
"type": "publicKey",
|
|
||||||
"path": "group"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "PerpMarket"
|
"value": "PerpMarket"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "account",
|
||||||
|
"type": "publicKey",
|
||||||
|
"path": "group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "arg",
|
"kind": "arg",
|
||||||
"type": "u16",
|
"type": "u16",
|
||||||
|
@ -9055,18 +9051,14 @@ export const IDL: MangoV4 = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "baseEntryLots",
|
"name": "quoteEntryNative",
|
||||||
"docs": [
|
"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"
|
"type": "i64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "quoteEntryNative",
|
"name": "quoteRunningNative",
|
||||||
"type": "i64"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "quoteExitNative",
|
|
||||||
"type": "i64"
|
"type": "i64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue