Token Sets Decomposer
TokenSets oracle to get the price of any Set in Ether, allowing lending platforms to take Sets as collateral.
We jumped on a few different projects during the course of this hackathon, our main goal was to start learning about the infrastructure of ethereum, and learning how to play with solidity and interact with smart contracts. Miguel was running solo on this team for a while and Anar joined mid-hackathon. Miguel learned how to spin up his own chainlink node, but ultimately we both settled on making a Price oracle of TokenSets in order to integrate it in Aave. What our Project does is basically: Given an address for a TokenSet, we will decompose that Set into their underlying tokens, and get the correct price of each of the underlying tokens in order to calculate the price of the Set in ETH terms.
This projects firstloads the address interface of SetTokens, extracting the fields we care about, we also validate the address belongs to a TokenSet pool. We extract the units, and underlying components of this Set. With that in place, we then call our PriceOracleProxy (which in place would potentially call the Aave Price Oracle, that calls Chainlink under the hood) to get the price for each of our underlying components. Since the Aave Price Oracle doesn't have support for cTokens and wETH we had to create a CTokenPriceOracle to calculate those prices, and a check for wETH address. The bulk of the code is just Solidity smart contracts, but we also created a simple UI interface to interact with our contract. This idea can be replicated by other lending platforms like Compound, however the Aave team were really helpful and interested on this project, hence why we are applying for their prize, but would like to be considered for Compounds prize. We believe this idea would bring more flow of money to the markets, Sets have some risk to them, but they have the potential to handle the risk of being exposed directly to ETH or BTC with their rebalancing feature, so they could be a good collateral for them to onboard.