Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added dry run feature for default tx executor and logs file #96

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nikola43
Copy link

Added feature to simulate transactions using the default tx executor, has been added for testing / benchmarking purposes.

Also added functions to write to a log file the transactions performed by the bot for further analysis.

@lucasoares
Copy link

lucasoares commented Apr 25, 2024

This feature may be named as dry run instead of simulate to clarify what it is doing. Ppl may want to simulate the transaction before executing to avoid spending unnecessary SOL, for example, but then perform the real transaction. In this case, you are running the bot in a dry run mode to execute it without sending the swap transactions and using the simulation as the "real" result...

@nikola43
Copy link
Author

This feature may be named as dry run instead of simulate to clarify what it is doing. Ppl may want to simulate the transaction before executing to avoid spending unnecessary SOL, for example, but then perform the real transaction. In this case, you are running the bot in a dry run mode to execute it without sending the swap transactions and using the simulation as the "real" result...

I know, I added that functionality to do some tests, what you say is a good idea, add the possibility to simulate the transaction and if it is completed correctly then launch the real transaction, it would be nice to have 3 modes, no simulate, simulate and simulate and release tx, I'll keep in mind for next updates

@nikola43 nikola43 changed the title feat: Added simulate tx feature for default tx executor and logs file feat: Added dry run feature for default tx executor and logs file Apr 25, 2024
@fdundjer
Copy link
Collaborator

This feature may be named as dry run instead of simulate to clarify what it is doing. Ppl may want to simulate the transaction before executing to avoid spending unnecessary SOL, for example, but then perform the real transaction. In this case, you are running the bot in a dry run mode to execute it without sending the swap transactions and using the simulation as the "real" result...

I know, I added that functionality to do some tests, what you say is a good idea, add the possibility to simulate the transaction and if it is completed correctly then launch the real transaction, it would be nice to have 3 modes, no simulate, simulate and simulate and release tx, I'll keep in mind for next updates

I agree with this, IMO this should be a running mode. Also, preflight is enabled by default, not sure if we need the 3rd mode. The simulation will happen when using warp or default executor right now.

try {
open({
library: 'tpu_client', // key
path: "/Users/kasiopea/dev/rust/tpu-sol-test/target/aarch64-apple-darwin/release/libtpu_client.dylib" // path

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???

Copy link
Author

@nikola43 nikola43 May 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been researching how to call the TPU as people say transactions are faster, I've tried using
https://github.com/lmvdz/tpu-client but it doesn't work because solana migrated to quic, so the only way I've had to use it from TS is creating a mini library in rust and doing binding to ts using ffi-rs, this is the code
https://github.com/nikola43/tpu_client

So i serialize tx and send it to tpu_client for release it

I forgot add compiled library to project and leave my local path, my idea is build for mac, windows and linux for bot be compatible with any OS.

Refereces:
https://solana.stackexchange.com/questions/5971/tpu-client-sometimes-the-transaction-doesnt-go-through-0-5-sol-bounty

https://solana.stackexchange.com/questions/9502/optimal-transaction-execution-speed

https://solana.stackexchange.com/questions/10003/solana-tpu-client-and-sending-versioned-transactions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants