noahtheprogrammer / soltrade

Python trading bot using the Solana blockchain.
https://discord.gg/WDS9Ya8KvX
GNU General Public License v3.0
188 stars 74 forks source link

Allegedly taking a market position, but not really executing? #21

Closed vrstybit closed 5 months ago

vrstybit commented 6 months ago

Hi, I really like this project, thank you very much for your work.

Whenever Soltrader opens a market position, I can access the API link, but the tokens that are supposedly bought/sold are not actually bought/sold. A transaction ID is created but cannot be found via Solscan. Any idea why this is happening?

Shortened code example 1:

2024-03-15 17:03:49       Soltrade API Link: https://quote-api.jup.ag/v6/quote?inputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&outputMint=EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm&amount=160290000&slippageBps=50
2024-03-15 17:03:51       Soltrade TxID: 4HfPPDysoiv56siLRvpRcTwUgTQJ6iB78ge2eSEwzqgunGmyXgQBs7HgEuBePgsKSSnoVfHpWUghSNsZ6GvaFsdx
2024-03-15 17:03:51       Sold 160.29000000000002 USDC for 56.301835 WIF

Shortened code example 2:

2024-03-15 17:30:19       Soltrade API Link: https://quote-api.jup.ag/v6/quote?inputMint=EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=990000&slippageBps=50
2024-03-15 17:30:20       Soltrade TxID: 2UWx6H9XpSphaSM9bDha3WzeJD7KgVCGqvK753NVE4JwtgJHsNmKd1ghwGsBwaKPDTubqrnYqgkPiESCzYdXmg1K
2024-03-15 17:30:20       Sold 0.99 WIF for 2.90 USDC

json.config:

{
  "api_key": "XXX",
  "private_key": "XXX",
  "custom_rpc_https": "https://api.mainnet-beta.solana.com",
  "other_mint": "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm",
  "other_mint_symbol": "WIF",
  "other_mint_decimals": "6",
  "price_update_seconds": "30",
  "trading_interval_minutes": "1"
}

Arch:

OS: Fedora Linux 39 (Container Image) x86_64 
Kernel: 6.7.6-200.fc39.x86_64
CPU: AMD Ryzen 5 8600G w/ Radeon 760M Graphics (12) @ 5.540GHz 
Memory: 12173MiB / 15602MiB
Python 3.12.2
pip 23.2.1

Python-Modules:

solana  == 0.29.0
solders  == 0.14.4
requests  == 2.28.2
pandas  == 1.5.3
httpx  == 0.23.3
base58  == 2.1.1
backtrader  == 1.9.76.123
APScheduler  == 3.10.1

Help is greatly appreciated, thank you very much!

vrstybit commented 6 months ago

I think I've got it. It's probably the RPC. Failed to look in past issues, sorry! It could be advantageous to specify in the readme that the RPC "https://api.mainnet-beta.solana.com" should be avoided :) Best Regards!

noahtheprogrammer commented 5 months ago

This issue was due to a discrepancy in the verification of transactions during swaps. Error-handling has now been implemented and the documentation has been updated as well.