|
|
|
|
@@ -1122,6 +1122,8 @@ func parseJupiterPumpAmmRoute(tx VersionedTransaction, instruction Instructions,
|
|
|
|
|
isBuy bool
|
|
|
|
|
isSell bool
|
|
|
|
|
count int
|
|
|
|
|
sellPercent uint8
|
|
|
|
|
buyPercent uint8
|
|
|
|
|
)
|
|
|
|
|
for _, step := range plan {
|
|
|
|
|
if !isInputIdx0(step.InputIdx) {
|
|
|
|
|
@@ -1130,9 +1132,11 @@ func parseJupiterPumpAmmRoute(tx VersionedTransaction, instruction Instructions,
|
|
|
|
|
if isPumpSwapSellKind(step.Swap.Kind) {
|
|
|
|
|
isSell = true
|
|
|
|
|
count++
|
|
|
|
|
sellPercent = step.Percent
|
|
|
|
|
} else if isPumpSwapBuyKind(step.Swap.Kind) {
|
|
|
|
|
isBuy = true
|
|
|
|
|
count++
|
|
|
|
|
buyPercent = step.Percent
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if count == 0 {
|
|
|
|
|
@@ -1154,6 +1158,9 @@ func parseJupiterPumpAmmRoute(tx VersionedTransaction, instruction Instructions,
|
|
|
|
|
if in > 0 {
|
|
|
|
|
token0Amount = formatTokenAmount(in)
|
|
|
|
|
}
|
|
|
|
|
if sellPercent > 0 && sellPercent < 100 {
|
|
|
|
|
token0Amount = token0Amount.Mul(decimal.NewFromInt(int64(sellPercent))).Div(decimal.NewFromInt(100))
|
|
|
|
|
}
|
|
|
|
|
return &TxSignal{
|
|
|
|
|
TxHash: tx.Signatures[0].String(),
|
|
|
|
|
Maker: tx.StaticAccountKeys[0].String(),
|
|
|
|
|
@@ -1189,6 +1196,10 @@ func parseJupiterPumpAmmRoute(tx VersionedTransaction, instruction Instructions,
|
|
|
|
|
if in > 0 {
|
|
|
|
|
token1Amount = formatSolAmount(in)
|
|
|
|
|
}
|
|
|
|
|
if buyPercent > 0 && buyPercent < 100 {
|
|
|
|
|
token1Amount = token1Amount.Mul(decimal.NewFromInt(int64(buyPercent))).Div(decimal.NewFromInt(100))
|
|
|
|
|
token0Amount = token0Amount.Mul(decimal.NewFromInt(int64(buyPercent))).Div(decimal.NewFromInt(100))
|
|
|
|
|
}
|
|
|
|
|
return &TxSignal{
|
|
|
|
|
TxHash: tx.Signatures[0].String(),
|
|
|
|
|
Maker: tx.StaticAccountKeys[0].String(),
|
|
|
|
|
|