Sell percent
This commit is contained in:
@@ -26,6 +26,16 @@ pub trait Executor {
|
|||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn sell_percent(
|
||||||
|
&self,
|
||||||
|
mint: String,
|
||||||
|
amount: u8,
|
||||||
|
priority: Decimal,
|
||||||
|
slippage: u16,
|
||||||
|
) -> anyhow::Result<()> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Account {
|
impl Account {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ impl PumpDev {
|
|||||||
&self,
|
&self,
|
||||||
action: &str,
|
action: &str,
|
||||||
mint: String,
|
mint: String,
|
||||||
amount: Decimal,
|
amount: String,
|
||||||
priority: Decimal,
|
priority: Decimal,
|
||||||
slippage: u16,
|
slippage: u16,
|
||||||
denominated_in_sol: bool,
|
denominated_in_sol: bool,
|
||||||
@@ -92,7 +92,14 @@ impl Executor for PumpDev {
|
|||||||
priority: Decimal,
|
priority: Decimal,
|
||||||
slippage: u16,
|
slippage: u16,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
self.trade("buy", mint, amount, priority, slippage, true)
|
self.trade(
|
||||||
|
"buy",
|
||||||
|
mint,
|
||||||
|
amount.round_dp(3).to_string(),
|
||||||
|
priority,
|
||||||
|
slippage,
|
||||||
|
true,
|
||||||
|
)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,7 +110,32 @@ impl Executor for PumpDev {
|
|||||||
priority: Decimal,
|
priority: Decimal,
|
||||||
slippage: u16,
|
slippage: u16,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
self.trade("sell", mint, amount, priority, slippage, false)
|
self.trade(
|
||||||
|
"sell",
|
||||||
|
mint,
|
||||||
|
amount.round_dp(3).to_string(),
|
||||||
|
priority,
|
||||||
|
slippage,
|
||||||
|
false,
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn sell_percent(
|
||||||
|
&self,
|
||||||
|
mint: String,
|
||||||
|
amount: u8,
|
||||||
|
priority: Decimal,
|
||||||
|
slippage: u16,
|
||||||
|
) -> anyhow::Result<()> {
|
||||||
|
self.trade(
|
||||||
|
"sell",
|
||||||
|
mint,
|
||||||
|
format!("{amount}%"),
|
||||||
|
priority,
|
||||||
|
slippage,
|
||||||
|
false,
|
||||||
|
)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user