I will try to describe my problem as clearly as possible so that I can get feedback on whether I am going in the right direction for resolution.
I'm running tests on mainnet fork trying to implement a vault on top of Zapper. They have implemented an easy way to interact with many of protocols where I can "swap" a Token for a LP Token or another yield-bearing-token. The problem is that they are not answering how to use they API in contexts that they don't documented.
Taking as example that transaction where the user bought a proportional investment in a pool with the token LOOK and WETH starting with his USDC.
Looking at their contract code you can see that everything is done through the function ZapIn
(the function that I'm trying to use) and this function require some parameters pretty self explanatory but one specific called swapData in a bytes format. I realized the data passed in this field will just be used in the step: _swapTarget.call.value(valueToSend)(swapCallData);
and until there I did'n know about it but studying I discovered that is encoded function call where the bytes hash
encodes the name and parameters of the function.
Now, I have some questions. Inspecting the transaction we can see that their are using 0x to perform the swaps and I read their documentations trying to find how can I build this swapData field and use the ZapIn function but I'm blocked.
The guys on 0x discord said that 0x doesn't perform multi-swap of tokens but you can see on this transaction that Zapper are swapping USDC for WTH and then for LOOKS and their code just call the 0x once.
To summarize my question is:
How can I build this bytes sequence to pass through the ZapIn function and call the 0x to swap the tokens?