outsmartchad / solana-trading-cli

High-performance modules for develop Solana Trading Bots: CLI, gRPC bots, and low-latency integrations with Jito, bloXroute, Jupiter, and DEXes
MIT License
227 stars 107 forks source link

Initiating transactions on copy trading is slow #7

Open skybl1ue opened 4 months ago

skybl1ue commented 4 months ago

It takes 20 seconds from detecting address transactions to completing copying transactions. How can I optimize the process to be as fast as possible?

outsmartchad commented 4 months ago

@skybl1ue It depends some factors, 1. the distance between the rpc provider host locations to your host locations. 2. the distance between the jito block engine host location and the ur host (if you are using jito bundles), This two could be fixed by hosting a server that is near to them. 3. Higher priority fee 4. Higher jito fee, i am using >=0.005 sol jito and 0.007 sol for priority fees when the network is congested.

outsmartchad commented 4 months ago

We might also try to build a new websocket to fetch the real-time data using Geyser-enhanced Websockets (grpc method) (https://github.com/rpcpool/yellowstone-grpc), now we are using the rpc method (onProgramAccountChange) provided by solana web3.js library

skybl1ue commented 4 months ago

We might also try to build a new websocket to fetch the real-time data using Geyser-enhanced Websockets (grpc method) (https://github.com/rpcpool/yellowstone-grpc), now we are using the rpc method (onProgramAccountChange) provided by solana web3.js library @outsmartchad The detection speed is fast, but the transaction processing speed has been delayed. Could it be that accessing Jito is too slow?

outsmartchad commented 4 months ago

yes! it could be, study these jito block engine endpoints in this file ( https://github.com/outsmartchad/solana-memecoin-cli/blob/main/src/Transactions/jito_tips_tx_executor.js), choose one that is nearest to your location, and uncomment others and try again.

skybl1ue @.***> 於 2024年6月26日 週三 下午4:40寫道:

We might also try to build a new websocket to fetch the real-time data using Geyser-enhanced Websockets (grpc method) ( https://github.com/rpcpool/yellowstone-grpc), now we are using the rpc method (onProgramAccountChange) provided by solana web3.js library @outsmartchad https://github.com/outsmartchad The detection speed is fast, but the transaction processing speed has been delayed. Could it be that accessing Jito is too slow?

— Reply to this email directly, view it on GitHub https://github.com/outsmartchad/solana-memecoin-cli/issues/7#issuecomment-2191142064, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVC7H376KMOBUHY3ATH54RTZJJ5BBAVCNFSM6AAAAABJ5JSQWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJRGE2DEMBWGQ . You are receiving this because you were mentioned.Message ID: @.***>

outsmartchad commented 4 months ago

[image: image.png]

wang chi @.***> 於 2024年6月26日 週三 下午4:42寫道:

yes! it could be, study these jito block engine endpoints in this file ( https://github.com/outsmartchad/solana-memecoin-cli/blob/main/src/Transactions/jito_tips_tx_executor.js), choose one that is nearest to your location, and uncomment others and try again.

skybl1ue @.***> 於 2024年6月26日 週三 下午4:40寫道:

We might also try to build a new websocket to fetch the real-time data using Geyser-enhanced Websockets (grpc method) ( https://github.com/rpcpool/yellowstone-grpc), now we are using the rpc method (onProgramAccountChange) provided by solana web3.js library @outsmartchad https://github.com/outsmartchad The detection speed is fast, but the transaction processing speed has been delayed. Could it be that accessing Jito is too slow?

— Reply to this email directly, view it on GitHub https://github.com/outsmartchad/solana-memecoin-cli/issues/7#issuecomment-2191142064, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVC7H376KMOBUHY3ATH54RTZJJ5BBAVCNFSM6AAAAABJ5JSQWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJRGE2DEMBWGQ . You are receiving this because you were mentioned.Message ID: @.***>

skybl1ue commented 4 months ago

[image: image.png] wang chi @.> 於 2024年6月26日 週三 下午4:42寫道: yes! it could be, study these jito block engine endpoints in this file ( https://github.com/outsmartchad/solana-memecoin-cli/blob/main/src/Transactions/jito_tips_tx_executor.js), choose one that is nearest to your location, and uncomment others and try again. skybl1ue @.> 於 2024年6月26日 週三 下午4:40寫道: > We might also try to build a new websocket to fetch the real-time data > using Geyser-enhanced Websockets (grpc method) ( > https://github.com/rpcpool/yellowstone-grpc), now we are using the rpc > method (onProgramAccountChange) provided by solana web3.js library > @outsmartchad https://github.com/outsmartchad The detection speed is > fast, but the transaction processing speed has been delayed. Could it be > that accessing Jito is too slow? > > — > Reply to this email directly, view it on GitHub > <#7 (comment)>, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/AVC7H376KMOBUHY3ATH54RTZJJ5BBAVCNFSM6AAAAABJ5JSQWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJRGE2DEMBWGQ > . > You are receiving this because you were mentioned.Message ID: > @.***> >

I cant see this picture TnT

outsmartchad commented 4 months ago

[image: image.png] wang chi @._> 於 2024年6月26日 週三 下午4:42寫道: yes! it could be, study these jito block engine endpoints in this file ( https://github.com/outsmartchad/solana-memecoin-cli/blob/main/src/Transactions/jito_tips_tx_executor.js), choose one that is nearest to your location, and uncomment others and try again. skybl1ue _@_.> 於 2024年6月26日 週三 下午4:40寫道: > We might also try to build a new websocket to fetch the real-time data > using Geyser-enhanced Websockets (grpc method) ( > https://github.com/rpcpool/yellowstone-grpc), now we are using the rpc > method (onProgramAccountChange) provided by solana web3.js library > @outsmartchad https://github.com/outsmartchad The detection speed is > fast, but the transaction processing speed has been delayed. Could it be > that accessing Jito is too slow? > > — > Reply to this email directly, view it on GitHub > <#7 (comment)>, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/AVC7H376KMOBUHY3ATH54RTZJJ5BBAVCNFSM6AAAAABJ5JSQWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJRGE2DEMBWGQ > . > You are receiving this because you were mentioned.Message ID: > @_.***> >

I cant see this picture TnT

image

outsmartchad commented 4 months ago

There is an issue in copy-buy.js, sometimes the code doesn't know the trader is buying(idk why), if you have time, please help us to refine the logic of it.;(((

skybl1ue @.***> 於 2024年6月26日 週三 下午4:52寫道:

[image: image.png] wang chi @.

> 於 2024年6月26日 週三 下午4:42寫道: … <#m564610719300031922> yes! it could be, study these jito block engine endpoints in this file ( https://github.com/outsmartchad/solana-memecoin-cli/blob/main/src/Transactions/jito_tips_tx_executor.js https://github.com/outsmartchad/solana-memecoin-cli/blob/main/src/Transactions/jito_tips_tx_executor.js), choose one that is nearest to your location, and uncomment others and try again. skybl1ue @.> 於 2024年6月26日 週三 下午4:40寫道: > We might also try to build a new websocket to fetch the real-time data > using Geyser-enhanced Websockets (grpc method) ( > https://github.com/rpcpool/yellowstone-grpc), now we are using the rpc > method (onProgramAccountChange) provided by solana web3.js library > @outsmartchad https://github.com/outsmartchad https://github.com/outsmartchad The detection speed is > fast, but the transaction processing speed has been delayed. Could it be > that accessing Jito is too slow? > > — > Reply to this email directly, view it on GitHub > <#7 (comment) https://github.com/outsmartchad/solana-memecoin-cli/issues/7#issuecomment-2191142064>,

or unsubscribe > https://github.com/notifications/unsubscribe-auth/AVC7H376KMOBUHY3ATH54RTZJJ5BBAVCNFSM6AAAAABJ5JSQWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJRGE2DEMBWGQ . > You are receiving this because you were mentioned.Message ID: > @.***>

I cant see this picture TnT

— Reply to this email directly, view it on GitHub https://github.com/outsmartchad/solana-memecoin-cli/issues/7#issuecomment-2191164983, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVC7H326AWYUKQK73LVABXLZJJ6NHAVCNFSM6AAAAABJ5JSQWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJRGE3DIOJYGM . You are receiving this because you were mentioned.Message ID: @.***>

outsmartchad commented 4 months ago

@skybl1ue you could try to use jup swap instead, I will update two different code, 1. Swap using jup 2. Swap using raydium

skybl1ue commented 4 months ago

您可以尝试使用 jup swap,我将更新两个不同的代码,1。使用 jup 2 进行交换。使用 raydium 进行交换

ok,thanks!:-D

sneljeroen commented 4 months ago

It's slow for me as well on copytrading, i get the error "TransactionExpiredBlockheightExceededError:". Any idea on how to fix? My fee is 0.005 sol, and im using the closest endpoint.

skybl1ue commented 4 months ago

您可以尝试使用 jup swap,我将更新两个不同的代码,1。使用 jup 2 进行交换。使用 raydium 进行交换

微信截圖_20240628104150 At the red line position in the picture, the transaction experiences a delay, resulting in a 5-10 second completion time. How can this be optimized? ;(((

outsmartchad commented 4 months ago

5-10 seconds completion time is fast already bro, from fetching the pool, to building a swap tx, to send tx to jito block engine, the only thing could be optimized is the paid tool(RPC, hosted server's location), of course, the higher priority fee (if you willing to pay), please have a try the JUP swap api, the project have code to do it just like what we are using right now (Raydium swap)

您可以尝试使用 jup swap,我将更新两个不同的代码,1。使用 jup 2 进行交换。使用 raydium 进行交换

微信截圖_20240628104150 At the red line position in the picture, the transaction experiences a delay, resulting in a 5-10 second completion time. How can this be optimized? ;(((

outsmartchad commented 4 months ago

@skybl1ue https://github.com/outsmartchad/solana-memecoin-cli/tree/main/src/Trading/dex/jupiter/swap, the code is easy to use and have integrated jito bundles + base gas, please have a look

outsmartchad commented 4 months ago

It's slow for me as well on copytrading, i get the error "TransactionExpiredBlockheightExceededError:". Any idea on how to fix? My fee is 0.005 sol, and im using the closest endpoint.

let it retries

sneljeroen commented 4 months ago

Using the jupiter swap functions now, with 0.01 sol jito tip and 0.01 prioritization fee for Jupiter. Average copy trade transaction now takes 3-6 seconds. Which is fairly quick, Jupiter responds quickly but the confirmation from Jito takes up most of the time would this improve if i increase the jito tip to more?

New to Solana transaction with Jito tips, thanks for providing the code @outsmartchad

skybl1ue commented 4 months ago

https://github.com/outsmartchad/solana-memecoin-cli/tree/main/src/Trading/dex/jupiter/swap,代码简单易用,并集成了jito捆绑包+基础气体,请看一下

I want to achieve very fast copy trading, just like the address in the picture. I set the same gas fees as him, but it is still much slower. I noticed that he sent multiple interactions simultaneously but only succeeded once. How is this done? 微信截圖_20240630212809

outsmartchad commented 4 months ago

Copy trade = you must be slower than the trader by few seconds, the way he made is sending the same request at the same time using the multi-thread, this will guarantee the tx will be land on mainnet successfully, yeah this is one of the options to make sure the tx is landing

outsmartchad commented 4 months ago

https://github.com/outsmartchad/solana-memecoin-cli/tree/main/src/Trading/dex/jupiter/swap,代码简单易用,并集成了jito捆绑包+基础气体,请看一下

I want to achieve very fast copy trading, just like the address in the picture. I set the same gas fees as him, but it is still much slower. I noticed that he sent multiple interactions simultaneously but only succeeded once. How is this done? 微信截圖_20240630212809

Please try every single thing you have to optimum it, if it works, you should contribute to this project. I already told you everything about how to optimize the code.