Skip to content

Commit d1d3d89

Browse files
committed
lol
1 parent 8f2d3cf commit d1d3d89

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

rust/src/jitter.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ use async_trait::async_trait;
44
use dashmap::DashMap;
55
use drift::state::user::{OrderStatus, User, UserStats};
66
use drift_sdk::{
7-
auction_subscriber::{AuctionSubscriber, AuctionSubscriberConfig},
8-
constants::PROGRAM_ID as drift_program,
9-
event_emitter::Event,
10-
types::{
7+
auction_subscriber::{AuctionSubscriber, AuctionSubscriberConfig}, constants::PROGRAM_ID as drift_program, event_emitter::Event, slot_subscriber::SlotSubscriber, types::{
118
CommitmentConfig,
129
MarketType,
1310
Order,
@@ -303,6 +300,14 @@ pub struct Shotgun<T: AccountProvider> {
303300
pub jit_proxy_client: JitProxyClient<T>
304301
}
305302

303+
/// Implementing the Sniper is left as an exercise for the reader.
304+
/// The Sniper is a more patient and precise creature, waiting for the perfect moment to strike.
305+
/// It is also a more complex mechanism, requiring intricate logic to implement correctly.
306+
pub struct Sniper<T: AccountProvider> {
307+
pub jit_proxy_client: JitProxyClient<T>,
308+
pub slot_subscriber: SlotSubscriber
309+
}
310+
306311
#[async_trait]
307312
impl<T: AccountProvider> JitterStrategy for Shotgun<T> {
308313
async fn try_fill(

rust/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::{str::FromStr, sync::Arc};
22

33
use solana_sdk::signature::Keypair;
44
use thiserror::Error;
5-
use drift_sdk::{types::{Context, SdkError}, DriftClient, RpcAccountProvider};
5+
use drift_sdk::{types::{CommitmentConfig, Context, SdkError}, DriftClient, RpcAccountProvider};
66
use anchor_client::Cluster;
77

88
pub mod jit_proxy_client;
@@ -55,7 +55,7 @@ async fn main() {
5555

5656
let drift_client = DriftClient::new(
5757
Context::MainNet,
58-
RpcAccountProvider::new(&rpc_url),
58+
RpcAccountProvider::with_commitment(&rpc_url, CommitmentConfig::finalized()),
5959
keypair.into(),
6060
)
6161
.await

0 commit comments

Comments
 (0)