listening add meteora programs ids for a single bundler and saving logs
This commit is contained in:
2
.env
2
.env
@@ -1,5 +1,5 @@
|
||||
YELLOWSTONE_ENDPOINT=https://solana-yellowstone-grpc.publicnode.com:443
|
||||
YELLOWSTONE_COMMITMENT=confirmed
|
||||
YELLOWSTONE_COMMITMENT=processed
|
||||
|
||||
BUNDLER=5jYaYv7HoiFVrY9bAcruj6dH8fCBseky4sBmnTFGSaeW
|
||||
|
||||
|
||||
BIN
logs/frames/bin/1762431002905_slot378294904_23JbNkbMJ3KN_tx.bin
Normal file
BIN
logs/frames/bin/1762431002905_slot378294904_23JbNkbMJ3KN_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762431008458_slot378294917_3ZffbofxBJMq_tx.bin
Normal file
BIN
logs/frames/bin/1762431008458_slot378294917_3ZffbofxBJMq_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762431526242_slot378296227_5UU8eMba7Z9X_tx.bin
Normal file
BIN
logs/frames/bin/1762431526242_slot378296227_5UU8eMba7Z9X_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762431529795_slot378296235_PVCcZDK5EnKR_tx.bin
Normal file
BIN
logs/frames/bin/1762431529795_slot378296235_PVCcZDK5EnKR_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762431532831_slot378296242_fmEg7TMtp2D8_tx.bin
Normal file
BIN
logs/frames/bin/1762431532831_slot378296242_fmEg7TMtp2D8_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762431535600_slot378296249_3fuak8wwdtgG_tx.bin
Normal file
BIN
logs/frames/bin/1762431535600_slot378296249_3fuak8wwdtgG_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432750167_slot378299286_5yZMdyckTdNp_tx.bin
Normal file
BIN
logs/frames/bin/1762432750167_slot378299286_5yZMdyckTdNp_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432753525_slot378299294_62VRGZLACGeb_tx.bin
Normal file
BIN
logs/frames/bin/1762432753525_slot378299294_62VRGZLACGeb_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432756501_slot378299301_3oLor6RS5VGu_tx.bin
Normal file
BIN
logs/frames/bin/1762432756501_slot378299301_3oLor6RS5VGu_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432759919_slot378299310_4RMmVfMTnFLs_tx.bin
Normal file
BIN
logs/frames/bin/1762432759919_slot378299310_4RMmVfMTnFLs_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432761533_slot378299316_36YuRG44j5yn_tx.bin
Normal file
BIN
logs/frames/bin/1762432761533_slot378299316_36YuRG44j5yn_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432764297_slot378299323_5ktceSArUNQK_tx.bin
Normal file
BIN
logs/frames/bin/1762432764297_slot378299323_5ktceSArUNQK_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432767651_slot378299331_53JRuGMFcuwm_tx.bin
Normal file
BIN
logs/frames/bin/1762432767651_slot378299331_53JRuGMFcuwm_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432770974_slot378299339_S5GLLtA4Wbaf_tx.bin
Normal file
BIN
logs/frames/bin/1762432770974_slot378299339_S5GLLtA4Wbaf_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432773982_slot378299346_65suYP3iaRFZ_tx.bin
Normal file
BIN
logs/frames/bin/1762432773982_slot378299346_65suYP3iaRFZ_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432777317_slot378299354_HuV9Y7QN5CFU_tx.bin
Normal file
BIN
logs/frames/bin/1762432777317_slot378299354_HuV9Y7QN5CFU_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432780021_slot378299361_2dRLmf6vZF5D_tx.bin
Normal file
BIN
logs/frames/bin/1762432780021_slot378299361_2dRLmf6vZF5D_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432783536_slot378299369_4dMpRuLSGrRR_tx.bin
Normal file
BIN
logs/frames/bin/1762432783536_slot378299369_4dMpRuLSGrRR_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432786845_slot378299377_22ebV3UZqNiQ_tx.bin
Normal file
BIN
logs/frames/bin/1762432786845_slot378299377_22ebV3UZqNiQ_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432789721_slot378299383_2YdNd6ETVWzG_tx.bin
Normal file
BIN
logs/frames/bin/1762432789721_slot378299383_2YdNd6ETVWzG_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432813478_slot378299444_ptgMmQDqKcB6_tx.bin
Normal file
BIN
logs/frames/bin/1762432813478_slot378299444_ptgMmQDqKcB6_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432816583_slot378299451_46b51dU23bsQ_tx.bin
Normal file
BIN
logs/frames/bin/1762432816583_slot378299451_46b51dU23bsQ_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432819755_slot378299458_5LH57f332b4Z_tx.bin
Normal file
BIN
logs/frames/bin/1762432819755_slot378299458_5LH57f332b4Z_tx.bin
Normal file
Binary file not shown.
BIN
logs/frames/bin/1762432821320_slot378299467_5yBVNsZDfKp1_tx.bin
Normal file
BIN
logs/frames/bin/1762432821320_slot378299467_5yBVNsZDfKp1_tx.bin
Normal file
Binary file not shown.
1416
logs/frames/txt/1762431002905_slot378294904_23JbNkbMJ3KN_tx.txt
Normal file
1416
logs/frames/txt/1762431002905_slot378294904_23JbNkbMJ3KN_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
1416
logs/frames/txt/1762431008458_slot378294917_3ZffbofxBJMq_tx.txt
Normal file
1416
logs/frames/txt/1762431008458_slot378294917_3ZffbofxBJMq_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
2075
logs/frames/txt/1762431526242_slot378296227_5UU8eMba7Z9X_tx.txt
Normal file
2075
logs/frames/txt/1762431526242_slot378296227_5UU8eMba7Z9X_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
2075
logs/frames/txt/1762431529795_slot378296235_PVCcZDK5EnKR_tx.txt
Normal file
2075
logs/frames/txt/1762431529795_slot378296235_PVCcZDK5EnKR_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
1793
logs/frames/txt/1762431532831_slot378296242_fmEg7TMtp2D8_tx.txt
Normal file
1793
logs/frames/txt/1762431532831_slot378296242_fmEg7TMtp2D8_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
1793
logs/frames/txt/1762431535600_slot378296249_3fuak8wwdtgG_tx.txt
Normal file
1793
logs/frames/txt/1762431535600_slot378296249_3fuak8wwdtgG_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
1793
logs/frames/txt/1762432750167_slot378299286_5yZMdyckTdNp_tx.txt
Normal file
1793
logs/frames/txt/1762432750167_slot378299286_5yZMdyckTdNp_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
2075
logs/frames/txt/1762432753525_slot378299294_62VRGZLACGeb_tx.txt
Normal file
2075
logs/frames/txt/1762432753525_slot378299294_62VRGZLACGeb_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
1793
logs/frames/txt/1762432756501_slot378299301_3oLor6RS5VGu_tx.txt
Normal file
1793
logs/frames/txt/1762432756501_slot378299301_3oLor6RS5VGu_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
2075
logs/frames/txt/1762432759919_slot378299310_4RMmVfMTnFLs_tx.txt
Normal file
2075
logs/frames/txt/1762432759919_slot378299310_4RMmVfMTnFLs_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
2075
logs/frames/txt/1762432761533_slot378299316_36YuRG44j5yn_tx.txt
Normal file
2075
logs/frames/txt/1762432761533_slot378299316_36YuRG44j5yn_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
1793
logs/frames/txt/1762432764297_slot378299323_5ktceSArUNQK_tx.txt
Normal file
1793
logs/frames/txt/1762432764297_slot378299323_5ktceSArUNQK_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
2075
logs/frames/txt/1762432767651_slot378299331_53JRuGMFcuwm_tx.txt
Normal file
2075
logs/frames/txt/1762432767651_slot378299331_53JRuGMFcuwm_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
2075
logs/frames/txt/1762432770974_slot378299339_S5GLLtA4Wbaf_tx.txt
Normal file
2075
logs/frames/txt/1762432770974_slot378299339_S5GLLtA4Wbaf_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
1793
logs/frames/txt/1762432773982_slot378299346_65suYP3iaRFZ_tx.txt
Normal file
1793
logs/frames/txt/1762432773982_slot378299346_65suYP3iaRFZ_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
1793
logs/frames/txt/1762432777317_slot378299354_HuV9Y7QN5CFU_tx.txt
Normal file
1793
logs/frames/txt/1762432777317_slot378299354_HuV9Y7QN5CFU_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
1793
logs/frames/txt/1762432780021_slot378299361_2dRLmf6vZF5D_tx.txt
Normal file
1793
logs/frames/txt/1762432780021_slot378299361_2dRLmf6vZF5D_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
2075
logs/frames/txt/1762432783536_slot378299369_4dMpRuLSGrRR_tx.txt
Normal file
2075
logs/frames/txt/1762432783536_slot378299369_4dMpRuLSGrRR_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
2075
logs/frames/txt/1762432786845_slot378299377_22ebV3UZqNiQ_tx.txt
Normal file
2075
logs/frames/txt/1762432786845_slot378299377_22ebV3UZqNiQ_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
1793
logs/frames/txt/1762432789721_slot378299383_2YdNd6ETVWzG_tx.txt
Normal file
1793
logs/frames/txt/1762432789721_slot378299383_2YdNd6ETVWzG_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
2075
logs/frames/txt/1762432813478_slot378299444_ptgMmQDqKcB6_tx.txt
Normal file
2075
logs/frames/txt/1762432813478_slot378299444_ptgMmQDqKcB6_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
2075
logs/frames/txt/1762432816583_slot378299451_46b51dU23bsQ_tx.txt
Normal file
2075
logs/frames/txt/1762432816583_slot378299451_46b51dU23bsQ_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
2075
logs/frames/txt/1762432819755_slot378299458_5LH57f332b4Z_tx.txt
Normal file
2075
logs/frames/txt/1762432819755_slot378299458_5LH57f332b4Z_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
2075
logs/frames/txt/1762432821320_slot378299467_5yBVNsZDfKp1_tx.txt
Normal file
2075
logs/frames/txt/1762432821320_slot378299467_5yBVNsZDfKp1_tx.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -12,11 +12,13 @@ use yellowstone_grpc_proto::geyser::{
|
||||
SubscribeUpdate,
|
||||
SubscribeUpdateTransaction
|
||||
};
|
||||
use bs58;
|
||||
|
||||
pub const METEORA_DBC: &str = "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN";
|
||||
pub const METEORA_DLMM: &str = "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo";
|
||||
pub const METEORA_POOLS: &str = "Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB";
|
||||
pub const METEORA_VAULT: &str = "24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi";
|
||||
|
||||
pub const METEORA_DBC_PROGRAM: &str = "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN";
|
||||
pub const METEORA_DLMM_PROGRAM: &str = "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo";
|
||||
pub const METEORA_POOLS_PROGRAM: &str = "Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB";
|
||||
pub const METEORA_VAULT_PROGRAM: &str = "24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi";
|
||||
|
||||
pub struct YellowstoneSource {
|
||||
stream: Pin<Box<dyn Stream<Item = Result<SubscribeUpdate, yellowstone_grpc_proto::tonic::Status>> + Send>>,
|
||||
@@ -56,20 +58,13 @@ impl YellowstoneSource {
|
||||
};
|
||||
|
||||
tx_filter.account_required.push(bundler.clone());
|
||||
for pid in [
|
||||
METEORA_DBC_PROGRAM,
|
||||
METEORA_DLMM_PROGRAM,
|
||||
METEORA_POOLS_PROGRAM,
|
||||
METEORA_VAULT_PROGRAM,
|
||||
] {
|
||||
tx_filter.account_include.push(pid.to_string());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Determine commitment level for subscriptions
|
||||
let commitment = match commitment.as_deref() {
|
||||
Some("processed") => CommitmentLevel::Processed,
|
||||
Some("confirmed") => CommitmentLevel::Confirmed,
|
||||
Some("finalized") => CommitmentLevel::Finalized,
|
||||
_ => CommitmentLevel::Processed,
|
||||
@@ -106,18 +101,23 @@ impl YellowstoneSource {
|
||||
|
||||
// Wait until the next transaction update is available
|
||||
async fn next(&mut self) -> Result<Option<SubscribeUpdateTransaction>> {
|
||||
// Determine the next update from the stream
|
||||
match self.stream.next().await {
|
||||
None => Ok(None),
|
||||
Some(Err(e)) => Err(e.into()),
|
||||
Some(Ok(update)) => {
|
||||
if let Some(UpdateOneof::Transaction(txu)) = update.update_oneof {
|
||||
tracing::info!("[INFO] received transaction from Yellowstone: \n{:#?}", txu);
|
||||
Ok(Some(txu))
|
||||
loop {
|
||||
let Some(update_res) = self.stream.as_mut().next().await else {
|
||||
return Ok(None);
|
||||
};
|
||||
|
||||
let update = update_res.map_err(anyhow::Error::from)?;
|
||||
|
||||
if let Some(UpdateOneof::Transaction(txu)) = update.update_oneof {
|
||||
if program_key_hit(&txu) {
|
||||
return Ok(Some(txu));
|
||||
} else {
|
||||
Ok(None)
|
||||
// no coincide → sigue leyendo el stream
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// no era una transacción → sigue leyendo
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,4 +137,41 @@ pub async fn yellowstone_forward_source_to_channel(
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
// Ponlo en listener.rs (o en utils.rs si prefieres), en el mismo módulo.
|
||||
fn program_key_hit(txu: &SubscribeUpdateTransaction) -> bool {
|
||||
let Some(msg) = txu
|
||||
.transaction.as_ref()
|
||||
.and_then(|t| t.transaction.as_ref())
|
||||
.and_then(|uv| uv.message.as_ref())
|
||||
else { return false; };
|
||||
|
||||
// account_keys: Vec<Vec<u8>> → Vec<String> (base58)
|
||||
let keys_b58: Vec<String> = msg.account_keys
|
||||
.iter()
|
||||
.map(|k| bs58::encode(k).into_string())
|
||||
.collect();
|
||||
|
||||
// 1) ¿Aparece el programa como key directa?
|
||||
if keys_b58.iter().any(|k| matches!(k.as_str(),
|
||||
METEORA_DBC | METEORA_DLMM | METEORA_POOLS | METEORA_VAULT))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// 2) ¿Aparece como program_id_index en alguna instrucción?
|
||||
for ix in &msg.instructions {
|
||||
let idx = ix.program_id_index as usize;
|
||||
if let Some(pid_bytes) = msg.account_keys.get(idx) {
|
||||
let pid_b58 = bs58::encode(pid_bytes).into_string();
|
||||
if matches!(pid_b58.as_str(),
|
||||
METEORA_DBC | METEORA_DLMM | METEORA_POOLS | METEORA_VAULT)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ use sniper_bot::listener::YellowstoneSource;
|
||||
use sniper_bot::utils::save_tx_update;
|
||||
|
||||
|
||||
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
init_tracing();
|
||||
@@ -48,7 +50,7 @@ async fn main() -> Result<()> {
|
||||
tracing::warn!("No se pudo guardar el frame: {e:?}");
|
||||
}
|
||||
|
||||
tracing::info!("[INFO] received transaction update: \n{:#?}", txu);
|
||||
//tracing::info!("[INFO] received transaction update: \n{:#?}", txu);
|
||||
let sig = txu
|
||||
.transaction
|
||||
.as_ref()
|
||||
|
||||
@@ -7,6 +7,7 @@ use tokio::fs;
|
||||
use yellowstone_grpc_proto::geyser::SubscribeUpdateTransaction;
|
||||
use yellowstone_grpc_proto::prost::Message;
|
||||
|
||||
|
||||
// Save file from tx received
|
||||
pub async fn save_tx_update(txu: &SubscribeUpdateTransaction) -> Result<(PathBuf, PathBuf)> {
|
||||
// 1) Carpetas
|
||||
|
||||
Reference in New Issue
Block a user