Cover photo

StreamFi: Week 4 @ ETHIndia Fellowship 3.0

Proxy Contracts

“A proxy contract is a contract which delegates calls to another contract. To interact with the actual contract you have to go through the proxy, and the proxy knows which contract to delegate the call to (the target).”

As per last week’s update, the real-time balances were supposed to be calculated from timestamps and stream details pulled from the Superfluid subgraph.

But as a matter of chance, I happened to log the contract details of each token and spotted a function: RealtimeBalanceOfNow - which returns the current token balance, without the need for calculations.

RealtimeBalanceOfNow
RealtimeBalanceOfNow

However, there was a twist presented in the form of the contract being deployed in the form of a proxy contract by Superfluid.

Proxy Contract for fDAIx
Proxy Contract for fDAIx

What Proxy contracts essentially change is how and where the data is stored and fetched. The current way of calling the contract is creating the contract object using the ABI of the underlying contract the Proxy contract calls and the address of the proxy contract itself.

This provided a really convenient and elegant solution to the fetching balances issue discussed last week.

Current State of StreamFi

Tasks accomplished this week:

  1. Fixed and finalised the dashboard, adding real-time updated token balances. The balances are being pulled now directly from proxy contracts, which took a lot of research and diving into the contract structure.

  2. Added multiple token support - fDAIx, fTUSDx, fUSDCx

  3. Planned out the infrastructure of building the savings feature and researched the backend service to be used. Currently tested out redis to build this.

  4. An MVP has been deployed on https://streamfi.fun/ 🚀 Would love to get some feedback on the look and feel of the project. NOTE: Only works on Goerli

Dashboard
Dashboard

Conclusion

The app has started to shape up really nicely, having structure and functioning. I have learned a lot especially about writing better code, researching protocols and creating UX flows. Deploying the website and domain never gets old 🛐