ScribeSavant / raydium-swap-go

15 stars 4 forks source link

Hello,Could you show me how to add the price and limit fee for the new transaction ? #1

Closed cocktailalochol closed 4 months ago

cocktailalochol commented 4 months ago

I am run your code ,find the tx often sended ,but failed due to the low fee,how to increase the fees?

ScribeSavant commented 4 months ago

Hii sorry for late, i added new commit for fee configuration,

https://github.com/ScribeSavant/raydium-swap-go/commit/a92944481e68d8e6cbf9ce97dca1bef84ff9bc50

You can clone the repo or just type git pull in root directory of repo and update it

I wrote an example in run.go, but you can still ask any questions that come to your mind.

tx, err := raydium.Trade.MakeSwapTransaction(
        poolKeys,
        amountsOut.AmountIn,
        amountsOut.MinAmountOut,
        trade.FeeConfig{
            MicroLamports: 25000, // fee 0.000025 sol
        },
    )
cocktailalochol commented 4 months ago

cool~