Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
soundsonacid committed Mar 20, 2024
1 parent c82c205 commit 1687636
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,14 @@ impl<T: AccountProvider> DriftClient<T> {
.map(|x| x.data)
}

pub fn num_perp_markets(&self) -> usize {
self.backend.num_perp_markets()
}

pub fn num_spot_markets(&self) -> usize {
self.backend.num_spot_markets()
}

pub fn get_oracle_price_data_and_slot(
&self,
oracle_pubkey: Pubkey,
Expand Down Expand Up @@ -682,8 +690,7 @@ impl<T: AccountProvider> DriftClientBackend<T> {
true,
);

perp_market_map.sync().await?;
spot_market_map.sync().await?;
tokio::try_join!(perp_market_map.sync(), spot_market_map.sync())?;

let perp_oracles = perp_market_map.oracles();
let spot_oracles = spot_market_map.oracles();
Expand Down Expand Up @@ -763,6 +770,14 @@ impl<T: AccountProvider> DriftClientBackend<T> {
self.spot_market_map.get(&market_index)
}

fn num_perp_markets(&self) -> usize {
self.perp_market_map.size()
}

fn num_spot_markets(&self) -> usize {
self.spot_market_map.size()
}

fn get_oracle_price_data_and_slot(
&self,
oracle_pubkey: Pubkey,
Expand Down

0 comments on commit 1687636

Please sign in to comment.