A while ago I had this really cool idea to improve our multicall helper. Multicall is a really cool smart contract that allows us to combine a bunch of other smart contract calls into one single call.
This allows us to combine** 16 smart contract calls** (to things like Uniswap, FLUX, SushiSwap etc) ** into 1 single call**. This is the "magic sauce" that allows our dapp to function so fast.
Well as this number kept growing the complexity grew further. A long time ago I've created a really cool helper that simplifies this logic.
I've attached a little snippet where an entire contract call/results are easily converted and typed.
As I got into swapping for Uniswap we need to add some more calls to this and they have to be conditional. This is something that was limited before, but I found a really cool idea of how we can do this with key/value approach.
The reason it's so good is that it allows us to add even more complexity as we'll need to fetch even more data than ever.
Anyway, if you are curious to see how it works:
https://github.com/Datamine-Crypto/dashboard/commit/b0a30fb0b29493331d2206dcf78a6693028e94c8