warp-id / solana-trading-bot

Solana Trading Bot - Beta
Microsoft Public License
1.44k stars 676 forks source link

Any way to filter by market cap? #147

Open Ismola opened 3 months ago

Ismola commented 3 months ago

The only way I've found is to use the dexscreener or coingeko api to get the maket cap value, but they don't seem to be fast enough. When a new pool is created, up to 30 seconds (approximately), nothing is returned. It doesn't work when you want to buy and filter in the first seconds of creating a new pool

netbja commented 1 month ago

Hello, gmgm API can provide this information if it helps... Here is an example from 1f1n https://github.com/1f1n/gmgnai-wrapper/blob/main/examples/getTokenInfo.py

Very quick result, look at the end of this json

./getTokenInfo.py | grep -i market {'address': '9eLRcHw2G4Ugrnp1p5165PuZsQ2YSc9GnBpGZS7Cpump', 'symbol': 'FWOG', 'name': 'fwog', 'decimals': 6, 'price': 6.5743990279965e-06, 'logo': 'https://dd.dexscreener.com/ds-data/tokens/solana/9eLRcHw2G4Ugrnp1p5165PuZsQ2YSc9GnBpGZS7Cpump.png', 'price_1m': 6.5743990279965e-06, 'price_5m': 6.5743990279965e-06, 'price_1h': 6.5743990279965e-06, 'price_6h': 6.6588032871675e-06, 'price_24h': 6.17651415714864e-06, 'volume_24h': 1038.532187223431, 'swaps_5m': 0, 'swaps_1h': 0, 'swaps_6h': 2, 'swaps_24h': 11, 'liquidity': 9788.49108877413, 'max_supply': 988070258, 'total_supply': 988070258, 'holder_count': 421, 'biggest_pool_address': 'GwC2UijLKuwHZst2X8hsG393AGDHZRZ7hnhT9Zz6PabX', 'chain': 'sol', 'creation_timestamp': 1717546829, 'open_timestamp': 1717556169, 'circulating_supply': None, 'high_price': None, 'high_price_timestamp': None, 'low_price': None, 'low_price_timestamp': None, 'buys_1m': 0, 'sells_1m': 0, 'swaps_1m': 0, 'volume_1m': 0, 'buy_volume_1m': 0, 'sell_volume_1m': 0, 'net_in_volume_1m': 0, 'buys_5m': 0, 'sells_5m': 0, 'volume_5m': 0, 'buy_volume_5m': 0, 'sell_volume_5m': 0, 'net_in_volume_5m': 0, 'buys_1h': 0, 'sells_1h': 0, 'volume_1h': 0, 'buy_volume_1h': 0, 'sell_volume_1h': 0, 'net_in_volume_1h': 0, 'buys_6h': 1, 'sells_6h': 1, 'volume_6h': 313.72007214509006, 'buy_volume_6h': 157.445, 'sell_volume_6h': 156.2750721450901, 'net_in_volume_6h': 1.16993, 'buys_24h': 3, 'sells_24h': 8, 'buy_volume_24h': 486.6034999985191, 'sell_volume_24h': 551.928687224912, 'net_in_volume_24h': -65.32519, 'fdv': 6495.968143787451, 'market_cap': 6495.968143787451,

outsmartchad commented 1 month ago

@Ismola try this, https://github.com/outsmartchad/solana-trading-cli/blob/typescript-main/src/raydium/token-filters/marketcap.ts, it fetch the token supply and the price of the current pool/token to calculate the pool's market cap, it's fast enough since it fetch using normal rpc.