fix
This commit is contained in:
+1
-1
@@ -87,7 +87,7 @@ tokio-tungstenite = { version = "0.26.1", features = ["native-tls"] }
|
|||||||
indicatif = "0.17.11"
|
indicatif = "0.17.11"
|
||||||
toml = "0.8.20"
|
toml = "0.8.20"
|
||||||
|
|
||||||
pumpfun_program = { version = "4.2.0", package = "pumpfun" }
|
pumpfun_program = { version = "4.3.0", package = "pumpfun" }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -3,7 +3,7 @@ use std::sync::Arc;
|
|||||||
use solana_client::rpc_client::RpcClient;
|
use solana_client::rpc_client::RpcClient;
|
||||||
use solana_sdk::{commitment_config::CommitmentConfig, pubkey::Pubkey, signature::Keypair};
|
use solana_sdk::{commitment_config::CommitmentConfig, pubkey::Pubkey, signature::Keypair};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use crate::{constants::pumpfun::trade::{DEFAULT_BUY_TIP_FEE, DEFAULT_COMPUTE_UNIT_LIMIT, DEFAULT_COMPUTE_UNIT_PRICE, DEFAULT_SELL_TIP_FEE}, swqos::FeeClient};
|
use crate::{constants::pumpfun::trade::{DEFAULT_BUY_TIP_FEE, DEFAULT_COMPUTE_UNIT_LIMIT, DEFAULT_COMPUTE_UNIT_PRICE, DEFAULT_RPC_UNIT_LIMIT, DEFAULT_RPC_UNIT_PRICE, DEFAULT_SELL_TIP_FEE}, swqos::FeeClient};
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub enum FeeType {
|
pub enum FeeType {
|
||||||
@@ -87,8 +87,8 @@ impl Default for PriorityFee {
|
|||||||
Self {
|
Self {
|
||||||
unit_limit: DEFAULT_COMPUTE_UNIT_LIMIT,
|
unit_limit: DEFAULT_COMPUTE_UNIT_LIMIT,
|
||||||
unit_price: DEFAULT_COMPUTE_UNIT_PRICE,
|
unit_price: DEFAULT_COMPUTE_UNIT_PRICE,
|
||||||
rpc_unit_limit: 0,
|
rpc_unit_limit: DEFAULT_RPC_UNIT_LIMIT,
|
||||||
rpc_unit_price: 0,
|
rpc_unit_price: DEFAULT_RPC_UNIT_PRICE,
|
||||||
buy_tip_fee: DEFAULT_BUY_TIP_FEE,
|
buy_tip_fee: DEFAULT_BUY_TIP_FEE,
|
||||||
buy_tip_fees: vec![],
|
buy_tip_fees: vec![],
|
||||||
sell_tip_fee: DEFAULT_SELL_TIP_FEE
|
sell_tip_fee: DEFAULT_SELL_TIP_FEE
|
||||||
|
|||||||
@@ -165,6 +165,8 @@ pub mod trade {
|
|||||||
pub const DEFAULT_COMPUTE_UNIT_PRICE: u64 = 500000;
|
pub const DEFAULT_COMPUTE_UNIT_PRICE: u64 = 500000;
|
||||||
pub const DEFAULT_BUY_TIP_FEE: f64 = 0.0006;
|
pub const DEFAULT_BUY_TIP_FEE: f64 = 0.0006;
|
||||||
pub const DEFAULT_SELL_TIP_FEE: f64 = 0.0001;
|
pub const DEFAULT_SELL_TIP_FEE: f64 = 0.0001;
|
||||||
|
pub const DEFAULT_RPC_UNIT_LIMIT: u32 = 1000000;
|
||||||
|
pub const DEFAULT_RPC_UNIT_PRICE: u64 = 500000;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Symbol;
|
pub struct Symbol;
|
||||||
|
|||||||
@@ -640,6 +640,15 @@ impl PumpFun {
|
|||||||
Ok(actual_sol_reserves)
|
Ok(actual_sol_reserves)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub async fn get_creator(&self, mint: &Pubkey) -> Result<Pubkey, anyhow::Error> {
|
||||||
|
let (bonding_curve, _) = pumpfun::common::get_bonding_curve_account_v2(&self.rpc, mint).await?;
|
||||||
|
|
||||||
|
let creator = bonding_curve.creator;
|
||||||
|
|
||||||
|
Ok(creator)
|
||||||
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub async fn get_current_price_with_pumpswap(&self, pool_address: &Pubkey) -> Result<f64, anyhow::Error> {
|
pub async fn get_current_price_with_pumpswap(&self, pool_address: &Pubkey) -> Result<f64, anyhow::Error> {
|
||||||
let pool = pumpswap::pool::Pool::fetch(&self.rpc, pool_address).await?;
|
let pool = pumpswap::pool::Pool::fetch(&self.rpc, pool_address).await?;
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ impl FeeClientTrait for SolRpcClient {
|
|||||||
Ok(_) => (),
|
Ok(_) => (),
|
||||||
Err(_) => (),
|
Err(_) => (),
|
||||||
}
|
}
|
||||||
|
println!(" signature: {:?}", signature);
|
||||||
println!(" rpc{}确认: {:?}", trade_type, start_time.elapsed());
|
println!(" rpc{}确认: {:?}", trade_type, start_time.elapsed());
|
||||||
|
|
||||||
Ok(signature)
|
Ok(signature)
|
||||||
|
|||||||
Reference in New Issue
Block a user