Skip to content

Commit

Permalink
Changes to activate all raydium pools on production
Browse files Browse the repository at this point in the history
  • Loading branch information
godmodegalactus committed Oct 9, 2024
1 parent dd34dbf commit 3f50ef5
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 30 deletions.
11 changes: 9 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ stable-swap = { version = "1.8.1", features = ["no-entrypoint", "client"] }
stable-swap-client = { version = "1.8.1" }
stable-swap-math = { version = "1.8.1" }
uint = { version = "0.9.1" }
quic-geyser-client = { git = "https://github.com/blockworks-foundation/quic_geyser_plugin.git", branch = "router_v1.17.29" }
quic-geyser-common = { git = "https://github.com/blockworks-foundation/quic_geyser_plugin.git", branch = "router_v1.17.29" }
quic-geyser-client = { git = "https://github.com/blockworks-foundation/quic_geyser_plugin.git", branch = "router_new_streaming" }
quic-geyser-common = { git = "https://github.com/blockworks-foundation/quic_geyser_plugin.git", branch = "router_new_streaming" }

[profile.release]
overflow-checks = true
Expand Down
18 changes: 1 addition & 17 deletions bin/autobahn-router/src/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ impl EdgeState {
}

pub fn cached_price_exact_out_for(&self, out_amount: u64) -> Option<(f64, f64)> {
if !self.is_valid_out() {
if !self.is_valid() {
return None;
}

Expand Down Expand Up @@ -304,22 +304,6 @@ impl EdgeState {
true
}

pub fn is_valid_out(&self) -> bool {
if !self.is_valid {
return false;
}

if self.cooldown_until.is_some() {
// Do not check time here !
// We will reset "cooldown until" on first account update coming after cooldown
// So if this is not reset yet, it means that we didn't change anything
// No reason to be working again
return false;
}

true
}

pub fn reset_cooldown(&mut self) {
self.cooldown_event += 0;
self.cooldown_until = None;
Expand Down
15 changes: 10 additions & 5 deletions bin/autobahn-router/src/edge_updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::time::{Duration, Instant};
use tokio::sync::broadcast;
use tokio::sync::broadcast::error::RecvError;
use tokio::task::JoinHandle;
use tracing::{debug, error, info, trace, warn};
use tracing::{debug, error, info, warn};

#[derive(Clone)]
pub struct Dex {
Expand Down Expand Up @@ -241,15 +241,18 @@ impl EdgeUpdater {
None => state.slot_excessive_lagging_since = Some(Instant::now()),
Some(since) => {
if since.elapsed() > max_lag_duration {
panic!(
"Lagging a lot {} for more than {}s, exiting..",
error!(
"Lagging a lot {} for more than {}s, for dex {}..",
lag,
max_lag_duration.as_secs()
max_lag_duration.as_secs(),
self.dex.name,
);
}
}
}
return;
} else if state.slot_excessive_lagging_since.is_some() {
state.slot_excessive_lagging_since = None;
}
}
}
Expand Down Expand Up @@ -333,7 +336,9 @@ impl EdgeUpdater {
};

state.received_account.insert(pk);
state.latest_slot_pending = slot;
if state.latest_slot_pending < slot {
state.latest_slot_pending = slot;
}

self.check_readiness();

Expand Down
14 changes: 12 additions & 2 deletions bin/autobahn-router/template-config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
snapshot_timeout_in_seconds = 900

[infinity]
enabled = true

Expand All @@ -22,8 +24,8 @@ add_mango_tokens = false
[raydium]
enabled = true
mints = []
take_all_mints = false
add_mango_tokens = true
take_all_mints = true
add_mango_tokens = false

[raydium_cp]
enabled = true
Expand Down Expand Up @@ -77,6 +79,7 @@ dedup_queue_size = 50000
rpc_http_url = "$RPC_HTTP_URL"
rpc_support_compression = true
re_snapshot_interval_secs = 1200
request_timeout_in_seconds = 300

[[sources.grpc_sources]]
name = "router-other"
Expand All @@ -90,13 +93,20 @@ dedup_queue_size = 50000
rpc_http_url = "$AMS_RPC_HTTP_URL"
rpc_support_compression = true
re_snapshot_interval_secs = 1200
request_timeout_in_seconds = 300

[[sources.grpc_sources]]
name = "router-ams"
connection_string = "$AMS_RPC_HTTP_URL_WITHOUT_TOKEN"
token = "$AMS_RPC_TOKEN"
retry_connection_sleep_secs = 30

[[sources.quic_sources]]
name = "quic-client"
connection_string = "$AMS_RPC_QUIC_URL"
retry_connection_sleep_secs = 1
enable_gso = false

[price_feed]
birdeye_token = "$BIRDEYE_TOKEN"
refresh_interval_secs = 1200 # every 20 min
Expand Down
4 changes: 2 additions & 2 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ kill_timeout = "30s"
cmd = ["autobahn-router", "/usr/local/bin/template-config.toml"]

[[vm]]
size = "shared-cpu-4x"
memory = "8gb"
size = "performance-4x"
memory = "16gb"

[[restart]]
policy = "always"
Expand Down
1 change: 1 addition & 0 deletions lib/router-config-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub struct GrpcSourceConfig {
#[derive(Clone, Debug, Default, serde_derive::Deserialize)]
pub struct QuicSourceConfig {
pub name: String,
#[serde(deserialize_with = "serde_string_or_env")]
pub connection_string: String,
pub retry_connection_sleep_secs: u64,
pub enable_gso: Option<bool>,
Expand Down

0 comments on commit 3f50ef5

Please sign in to comment.