On Pancakeswap it uses multihop functionality when swapping a pair with no direct swap path. The v2 router does not support multihop and was wondering how PCS has this implemented?

As an example on this transaction


Only the last swap WBNB->DFI goes through the PCS V2 router contract. Wonder how the rest is implemented then?

1 Answer 1


Firstly, any contract can make a series of swap..() calls directly to PCS pairs and a final call to the router.

In this case, I'm not sure what makes you say that "only" the last step goes through the PCS V2 router contract. At the link you provided, click the "Click to see more" link under the "BNB Price" row; then, click "decode input data".

2   path    address[]   0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56

There you can see that the router "swapExactTokensForTokens" call was given a path of multiple tokens to swap.

I think what you may be asking about is that the router contract receives the proceeds of the swap path, and then transfers those from itself to the destination/original-sender (0xafd...).

  • that is interesting. I was not aware that swapExactTokensForTokens can do multihop swaps.
    – Chris
    May 16, 2022 at 6:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.