Should prb-proxy be used with a Pancakeswap v2 router target to avoid Pancakeswap frontrunning? #175
-
Hi guys! I was wondering whether or not the following would be a good use case for prb-proxy. Sometimes, when I send a transaction through the Pancakeswap v2 router, an MEV wallet frontruns me by copying my transaction exactly (only replacing the "from" address with their own) with gas price 1 wei higher. This causes my transaction to fail. Unfortunately, the bloXroute private RPC isn't sufficient for this use case, because only some validators are connected to bloXroute, so using their private RPC doesn't guarantee that I'll reliably get in on the next block every time I send a transaction. I think using prb-proxy with the Pancakeswap v2 router as a target could solve this problem. If the MEV wallet simulates my transaction which uses prb-proxy by replacing my from address with their own, their simulated transaction will fail. Additionally, since the Pancakeswap call is obfuscated, it seems unlikely that they'd be able to automatically decode the call and figure out what I'm trying to do. (In principle, they could do this, but that would require more sophistication than I've seen.) Is this a good use case for prb-proxy? Is one able to just use the Pancakeswap v2 router as a prb-proxy target, or would I have to write a contract which is specifically configured to work with prb-proxy? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @ariel-simnegar, thanks for your question and interesting use case! The frank answer is "I don't know". I have never used PRBProxy to prevent front-running. But by the looks of it, you should be able to use the PancakeSwap V2 router directly without any bespoke target contract. This is because anything that can be done with an EOA can be done with PRBProxy, too (the reverse is not true, however). All I can say is that a miner will still be able to decode your tx and front-run you - but, as you say, this will require more advanced operations than just replacing Regarding vulnerabilities, that is something that you should consult with a security researcher. See the caveat emptor in the README. |
Beta Was this translation helpful? Give feedback.
Hi @ariel-simnegar, thanks for your question and interesting use case!
The frank answer is "I don't know". I have never used PRBProxy to prevent front-running. But by the looks of it, you should be able to use the PancakeSwap V2 router directly without any bespoke target contract. This is because anything that can be done with an EOA can be done with PRBProxy, too (the reverse is not true, however).
All I can say is that a miner will still be able to decode your tx and front-run you - but, as you say, this will require more advanced operations than just replacing
from
. They will have to deploy their own PRBProxy, etc.Regarding vulnerabilities, that is something that you should consult wi…