Merge 3d1e8b6984
into f4c6a086c1
This commit is contained in:
commit
4841e11b2b
|
@ -106,7 +106,9 @@ pub async fn runner(
|
|||
let handles1 = mango_client
|
||||
.context
|
||||
.tokens
|
||||
.keys()
|
||||
.values()
|
||||
.filter(|t| !t.closed)
|
||||
.map(|t| &t.token_index)
|
||||
// TODO: grouping tokens whose oracle might have less confidencen e.g. ORCA with the rest, fails whole ix
|
||||
// TokenUpdateIndexAndRate is known to take max 71k cu
|
||||
// from cargo test-bpf local tests
|
||||
|
|
|
@ -28,6 +28,7 @@ use solana_sdk::pubkey::Pubkey;
|
|||
pub struct TokenContext {
|
||||
pub group: Pubkey,
|
||||
pub token_index: TokenIndex,
|
||||
pub closed: bool,
|
||||
pub name: String,
|
||||
pub mint: Pubkey,
|
||||
pub oracle: Pubkey,
|
||||
|
@ -271,6 +272,7 @@ impl MangoGroupContext {
|
|||
name: String::new(),
|
||||
mint_info_address: *pk,
|
||||
decimals: u8::MAX,
|
||||
closed: true,
|
||||
banks: mi.banks,
|
||||
vaults: mi.vaults,
|
||||
oracle: mi.oracle,
|
||||
|
@ -297,6 +299,8 @@ impl MangoGroupContext {
|
|||
let fallback_oracle_accounts = fetch_multiple_accounts(rpc, &fallback_keys[..]).await?;
|
||||
for (index, (_, bank)) in bank_tuples.iter().enumerate() {
|
||||
let token = tokens.get_mut(&bank.token_index).unwrap();
|
||||
token.closed &=
|
||||
bank.native_deposits() == 0 && bank.native_borrows() == 0 && bank.reduce_only == 1;
|
||||
token.name = bank.name().into();
|
||||
token.decimals = bank.mint_decimals;
|
||||
token.oracle_config = bank.oracle_config;
|
||||
|
|
Loading…
Reference in New Issue