henrytirla / Decentralized-Exchange-Trading-Scripts

Useful scripts to automate trading on different DEX
https://t.me/dexpnl_bot
MIT License
366 stars 154 forks source link

How can i adjust the fee in your code in order to get priority? #8

Closed kohonez closed 6 months ago

kohonez commented 6 months ago

Thank you very much for your code. I'm using the raydium swap and works great, there's a way to adjust the fee to get priority in the transaction? sorry for my english.

EDIT: i did it, just need to add this line in buy/sell functions:

just edit:

from solders.compute_budget import set_compute_unit_price # import this

then:

if swap_token_account_Instructions is not None: swap_tx.add(swap_token_account_Instructions) swap_tx.add(set_compute_unit_price(1_0000)) # Add this line, edit amount with your custom fee swap_tx.add(instructions_swap) swap_tx.add(closeAcc)

henrytirla commented 6 months ago

Thank you for your contribution