raydium-ui
raydium-ui copied to clipboard
Added harvest all button for farms & fusion
I think it would be more convenient for users who are farming multiple pairs on farms/fusion to have a button to quickly collect all the pending rewards, so I implemented it
Current mechanism
- Treat the
harvest
function as a Promise - Added the
harvestAll
function to loop through the pairs, check their pending rewards, and trigger harvest if the amount is greater than 0 - Harvesting in synchronous because use need to approve transactions one by one
@t-rekttt Thanks for this PR, but if you join many pools, transaction packet data limit here, can't add many instructions in same transaction.
https://github.com/solana-labs/solana-web3.js/blob/171c73ee938c2bd12f0a0785e52d076c3f58649d/src/transaction.ts#L614
@TimonPeng I'm processing the harvests the same way as the user clicking each of the harvest buttons, each one creates a new transaction, so I think there wouldn't be any problem with that
@TimonPeng please check to see, it's working fine for me
@TimonPeng please check to see, it's working fine for me
Ok, I will check it! Thanks a lot!
@TimonPeng please check to see, it's working fine for me
Ok, I will check it! Thanks a lot!
How do you think? Please tell me if you have a better idea, I'll try to improve it
@t-rekttt Sorry for the late reply, I'm busy with IDO development and we are planning to release a new SDK library and some features will be included in it. I will check your PR and merge it as soon as possible. Thank you again!
@t-rekttt Sorry for the late reply, I'm busy with IDO development and we are planning to release a new SDK library and some features will be included in it. I will check your PR and merge it as soon as possible. Thank you again!
Thanks for the update. Just feel free to check whenever you have time!