Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,085 changes: 741 additions & 2,344 deletions Cargo.lock

Large diffs are not rendered by default.

38 changes: 24 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ titan = ["titan-swap-api-client"]
dlob_dbg = []

[dependencies]
abi_stable = { version = "0.11", default-features = false }
ahash = "0.8.12"
anchor-lang = { version = "0.32.1", features = ["derive"] }
anchor-lang = { version = "1.0.0-rc.2", features = ["derive"] }
arrayvec = "0.7.6"
base64 = "0.22"
bytemuck = "1.17"
Expand All @@ -38,31 +37,42 @@ env_logger = "0.11"
futures-util = "0.3"
fxhash = "0.2.1"
hex = "0.4"
jupiter-swap-api-client = { git = "https://github.com/drift-labs/jupiter-swap-api-client", branch = "patch/2025-12-28", package = "jupiter-swap-api-client" }
jupiter-swap-api-client = { git = "https://github.com/drift-labs/jupiter-swap-api-client", rev = "424ad8", package = "jupiter-swap-api-client" }
log = "0.4"
pythnet-sdk = "2"
regex = "1.10"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
solana-account-decoder-client-types = "2"
solana-rpc-client = "2"
solana-rpc-client-api = "2"
solana-sdk = "2"
solana-transaction-status = "2"
spl-associated-token-account = "7.0"
solana-account-decoder-client-types = "3"
solana-account = "3"
solana-commitment-config = "3"
solana-compute-budget-interface = "3"
solana-ed25519-program = "3"
solana-instruction = "3"
solana-keypair = "3"
solana-message = "3"
solana-pubkey = "3"
solana-rpc-client = "3"
solana-rpc-client-api = "3"
solana-signature = "3"
solana-signer = "3"
solana-transaction = "3"
solana-transaction-status = "3"
spl-associated-token-account = "8.0"
thiserror = "1"
titan-swap-api-client = { git = "https://github.com/drift-labs/titan-swap-api-client.git", optional = true }
tokio = { version = "1.48", features = ["full"] }
tokio-stream = "0.1.17"
tokio-tungstenite = { version = "0.28", features = ["native-tls"] }
yellowstone-grpc-client = { git = "https://github.com/rpcpool/yellowstone-grpc", rev = "660797" }
yellowstone-grpc-proto = { git = "https://github.com/rpcpool/yellowstone-grpc", rev = "660797" }
yellowstone-grpc-client = { git = "https://github.com/rpcpool/yellowstone-grpc", branch = "master" }
yellowstone-grpc-proto = { git = "https://github.com/rpcpool/yellowstone-grpc", branch = "master" }
drift-pubsub-client = { version = "0.1.1", path = "crates/pubsub-client" }
titan-swap-api-client = { git = "https://github.com/0xahzam/titan-swap-api-client.git", optional = true }

[dev-dependencies]
bs58 = { version = "0.5.1", default-features = false }
bytes = "1"
hex-literal = "0.4"
solana-account-decoder = "2"
solana-account-decoder = "3"
solana-signature = { version = "3", features = ["rand"] }
toml = "0.8"

[build-dependencies]
Expand Down
5 changes: 3 additions & 2 deletions crates/drift-idl-gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,14 +580,15 @@ fn generate_idl_types(idl: &Idl) -> String {
//!
use anchor_lang::{prelude::{account, AnchorSerialize, AnchorDeserialize, InitSpace, event, error_code, msg, borsh::{self}}, Discriminator};
// use solana-sdk Pubkey, the vendored anchor-lang Pubkey maybe behind
use solana_sdk::{instruction::AccountMeta, pubkey::Pubkey};
use solana_pubkey::Pubkey;
use solana_instruction::AccountMeta;
use serde::{Serialize, Deserialize};

pub const IDL_VERSION: &str = #idl_version;

use self::traits::ToAccountMetas;
pub mod traits {
use solana_sdk::instruction::AccountMeta;
use crate::solana_sdk::instruction::AccountMeta;

/// This is distinct from the anchor_lang version of the trait
/// reimplemented to ensure the types used are from `solana`` crates _not_ the anchor_lang vendored versions which may be lagging behind
Expand Down
8 changes: 5 additions & 3 deletions crates/pubsub-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ gjson = "0.8.1"
log = "0.4"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["raw_value"] }
solana-account-decoder-client-types = "2"
solana-sdk = "2"
solana-rpc-client-api = "2"
solana-account-decoder-client-types = "3"
solana-clock = "3"
solana-pubkey = "3"
solana-signature = "3"
solana-rpc-client-api = "3"
thiserror = "1"
tokio = { version = "1.48", features = ["full"] }
tokio-stream = "0.1"
Expand Down
4 changes: 3 additions & 1 deletion crates/pubsub-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use log::*;
use serde::de::DeserializeOwned;
use serde_json::{json, Value};
use solana_account_decoder_client_types::UiAccount;
use solana_clock::Slot;
use solana_pubkey::Pubkey;
use solana_rpc_client_api::{
config::{
RpcAccountInfoConfig, RpcBlockSubscribeConfig, RpcBlockSubscribeFilter,
Expand All @@ -21,7 +23,7 @@ use solana_rpc_client_api::{
RpcSignatureResult, RpcVote, SlotInfo, SlotUpdate,
},
};
use solana_sdk::{clock::Slot, pubkey::Pubkey, signature::Signature};
use solana_signature::Signature;
use thiserror::Error;
use tokio::{
sync::{
Expand Down
16 changes: 7 additions & 9 deletions crates/src/account_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::{
time::Duration,
};

use crate::solana_sdk::{clock::Slot, commitment_config::CommitmentConfig, pubkey::Pubkey};
use anchor_lang::Discriminator;
use bytemuck::Pod;
use dashmap::DashMap;
Expand All @@ -16,7 +17,6 @@ use solana_rpc_client_api::{
config::{RpcAccountInfoConfig, RpcProgramAccountsConfig},
filter::RpcFilterType,
};
use solana_sdk::{clock::Slot, commitment_config::CommitmentConfig, pubkey::Pubkey};

use crate::{
constants::PROGRAM_ID,
Expand Down Expand Up @@ -239,7 +239,7 @@ impl AccountMap {
.await?;
let stats_sync_result = self
.rpc
.get_program_accounts_with_config(
.get_program_ui_accounts_with_config(
&PROGRAM_ID,
RpcProgramAccountsConfig {
filters: Some(vec![crate::memcmp::get_user_stats_filter()]),
Expand All @@ -255,7 +255,7 @@ impl AccountMap {
for (pubkey, account) in stats_sync_result {
self.on_account_fn()(&AccountUpdate {
pubkey,
data: &account.data,
data: &account.data.decode().unwrap_or_default(),
lamports: account.lamports,
owner: PROGRAM_ID,
rent_epoch: u64::MAX,
Expand All @@ -276,7 +276,7 @@ impl AccountMap {

let sync_result = self
.rpc
.get_program_accounts_with_config(
.get_program_ui_accounts_with_config(
&PROGRAM_ID,
RpcProgramAccountsConfig {
filters: Some(filters),
Expand All @@ -292,7 +292,7 @@ impl AccountMap {
for (pubkey, account) in sync_result {
self.on_account_fn()(&AccountUpdate {
pubkey,
data: &account.data,
data: &account.data.decode().unwrap_or_default(),
lamports: account.lamports,
owner: PROGRAM_ID,
rent_epoch: u64::MAX,
Expand Down Expand Up @@ -456,8 +456,6 @@ impl<T: Pod> Deref for AccountRef<T> {
mod tests {
use std::time::Duration;

use solana_sdk::pubkey;

use super::*;
use crate::{
accounts::User,
Expand All @@ -478,11 +476,11 @@ mod tests {
let rpc = Arc::new(RpcClient::new(mainnet_endpoint()));
let account_map = AccountMap::new(pubsub, rpc, CommitmentConfig::confirmed());
let user_1 = Wallet::derive_user_account(
&pubkey!("DxoRJ4f5XRMvXU9SGuM4ZziBFUxbhB3ubur5sVZEvue2"),
&solana_pubkey::pubkey!("DxoRJ4f5XRMvXU9SGuM4ZziBFUxbhB3ubur5sVZEvue2"),
0,
);
let user_2 = Wallet::derive_user_account(
&pubkey!("Drift7AMLeq3FoKBMpT9wzqyMM3HVvvZFtsn81iSSkWV"),
&solana_pubkey::pubkey!("Drift7AMLeq3FoKBMpT9wzqyMM3HVvvZFtsn81iSSkWV"),
0,
);

Expand Down
2 changes: 1 addition & 1 deletion crates/src/auction_subscriber.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::sync::Mutex;

use crate::solana_sdk::commitment_config::CommitmentConfig;
use solana_account_decoder_client_types::UiAccountEncoding;
use solana_sdk::commitment_config::CommitmentConfig;

use crate::{
drift_idl::accounts::User,
Expand Down
2 changes: 1 addition & 1 deletion crates/src/blockhash_subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use std::{
time::Duration,
};

use crate::solana_sdk::message::Hash;
use log::warn;
use solana_rpc_client::nonblocking::rpc_client::RpcClient;
use solana_sdk::hash::Hash;
use tokio::sync::oneshot;

use crate::UnsubHandle;
Expand Down
Loading
Loading