Hey guys anchor noob back at it with another noob question!
Alright so I have a program that accepts deposits to a user pda (tx1), based on certain events the user might instantly get a payout from the pool pda in a settlement tx (tx2). I have a bot with the authority to execute tx2 and i want it to be able to do that as fast as possible, ( in the next slot or the one after that ).
To be able to be fast the bot accepts "processed" transactions to execute the second one.
I am scared that using processed might not be safe if the first tx gets reverted somehow (?)
but considering that the second tx is dependent on there being funds in the user pda, wouldn't that tx also revert if the first one failed? or would it just be able to transfer the funds from the pool pda and not the user pda, effectively creating an exploit in my app?
Please refer to the image to understand the flow of funds better
If anyone can help me understand I would be very grateful!