update dir
This commit is contained in:
+3
-7
@@ -6,22 +6,18 @@ use sol_trade_sdk::{
|
|||||||
constants::{pumpfun::global_constants::TOKEN_TOTAL_SUPPLY, trade_type},
|
constants::{pumpfun::global_constants::TOKEN_TOTAL_SUPPLY, trade_type},
|
||||||
event_parser::{
|
event_parser::{
|
||||||
protocols::{
|
protocols::{
|
||||||
pumpfun::{PumpFunCreateTokenEvent, PumpFunTradeEvent},
|
bonk::{BonkPoolCreateEvent, BonkTradeEvent}, pumpfun::{PumpFunCreateTokenEvent, PumpFunTradeEvent}, pumpswap::{
|
||||||
pumpswap::{
|
|
||||||
PumpSwapBuyEvent, PumpSwapCreatePoolEvent, PumpSwapDepositEvent, PumpSwapSellEvent,
|
PumpSwapBuyEvent, PumpSwapCreatePoolEvent, PumpSwapDepositEvent, PumpSwapSellEvent,
|
||||||
PumpSwapWithdrawEvent,
|
PumpSwapWithdrawEvent,
|
||||||
},
|
}
|
||||||
bonk::{BonkPoolCreateEvent, BonkTradeEvent},
|
|
||||||
},
|
},
|
||||||
Protocol, UnifiedEvent,
|
Protocol, UnifiedEvent,
|
||||||
},
|
},
|
||||||
grpc::{ShredStreamGrpc, YellowstoneGrpc},
|
grpc::{ShredStreamGrpc, YellowstoneGrpc},
|
||||||
match_event,
|
match_event,
|
||||||
pumpfun::common::get_bonding_curve_account_v2,
|
|
||||||
swqos::{SwqosConfig, SwqosRegion},
|
swqos::{SwqosConfig, SwqosRegion},
|
||||||
trading::{
|
trading::{
|
||||||
core::params::{PumpFunParams, PumpFunSellParams, PumpSwapParams, BonkParams},
|
core::params::{BonkParams, PumpFunParams, PumpFunSellParams, PumpSwapParams}, pumpfun::common::get_bonding_curve_account_v2, BuyParams, SellParams
|
||||||
BuyParams, SellParams,
|
|
||||||
},
|
},
|
||||||
SolanaTrade,
|
SolanaTrade,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use solana_hash::Hash;
|
use solana_hash::Hash;
|
||||||
use solana_sdk::{pubkey::Pubkey, signature::Keypair};
|
use solana_sdk::{pubkey::Pubkey, signature::Keypair};
|
||||||
|
use solana_sdk::signature::Signer;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use crate::common::{PriorityFee, SolanaRpcClient};
|
use crate::common::{PriorityFee, SolanaRpcClient};
|
||||||
use crate::pumpswap::common::get_token_balance;
|
use crate::trading::bonk::common::get_token_balance;
|
||||||
use crate::swqos::SwqosClient;
|
use crate::swqos::SwqosClient;
|
||||||
use crate::trading::{
|
use crate::trading::{
|
||||||
core::params::BonkParams, factory::Protocol, SellParams, TradeFactory,
|
core::params::BonkParams, factory::Protocol, SellParams, TradeFactory,
|
||||||
@@ -70,7 +71,7 @@ pub async fn sell_by_percent(
|
|||||||
if percent == 0 || percent > 100 {
|
if percent == 0 || percent > 100 {
|
||||||
return Err(anyhow!("Percentage must be between 1 and 100"));
|
return Err(anyhow!("Percentage must be between 1 and 100"));
|
||||||
}
|
}
|
||||||
let (balance_u64, _) = get_token_balance(rpc.as_ref(), payer.as_ref(), &mint).await?;
|
let balance_u64 = get_token_balance(&rpc, &payer.pubkey(), &mint).await?;
|
||||||
let amount = balance_u64 * percent / 100;
|
let amount = balance_u64 * percent / 100;
|
||||||
sell(
|
sell(
|
||||||
rpc,
|
rpc,
|
||||||
@@ -185,7 +186,7 @@ pub async fn sell_by_percent_with_tip(
|
|||||||
return Err(anyhow!("Percentage must be between 1 and 100"));
|
return Err(anyhow!("Percentage must be between 1 and 100"));
|
||||||
}
|
}
|
||||||
|
|
||||||
let (balance_u64, _) = get_token_balance(rpc.as_ref(), payer.as_ref(), &mint).await?;
|
let balance_u64 = get_token_balance(&rpc, &payer.pubkey(), &mint).await?;
|
||||||
let amount = balance_u64 * percent / 100;
|
let amount = balance_u64 * percent / 100;
|
||||||
sell_with_tip(
|
sell_with_tip(
|
||||||
rpc,
|
rpc,
|
||||||
|
|||||||
Reference in New Issue
Block a user