Inspiration
YieldMate is inspired by the lack of globally supported limit orders available on various chains. Its mission is to provide unified user experience for conditional swapping of ERC20 across multiple EVM chains.
What it does
YieldMate offers unique experience of executing swap of supported two ERC20s through Chainlink Automation at target market price through Uniswap V3. “The magic” lies within a powerful integration with Vault contract, that integrates with various yield-bearing strategies. Strategy can be a custom integration with any existing yield farming protocols, like AAVE on Polygon (through offering APY for providing lending assets). Real life application assumes that the user would like to perform a swap between two different ERC20s at a specific price, but in practice they will receive funds even faster thanks to the accumulated yield on his deposited asset, and they will receive even more than he asked, thanks to generated yield on output asset (after swap) before the user claims back funds.
Core functionalities
- Placing and deleting limit orders performed on Uniswap V3 decentralized exchange
- Yield generating before the limit price reaches the market
- Yield generating after a swap
- Supporting arbitrary number of yield farming protocol integrations through strategies
- Automated price quotation and swaps, thanks to Chainlink Automatio
App logic remarks
- Users can place multiple orders with different farming strategies
- Users do not have to put a realistic limit price - they can only enjoy the yield generation
- Users can cancel the order anytime before the market price match and withdraw their assets + yield
- There can be any number of farming strategies (currently AAVE is supported) connected to the platform anytime
- The platform is open to support any ERC20 token; currently it supports 10 most popular tokens
- Platform is scalable and can be extended beyond Polygon and potential transform into a DAO
How we built it
- Smart contracts - deployed to Polygon mainnet. Implementations are placed in libraries. Everything is powered by foundry and tested on Polygon mainnet fork. They are divided into:
- Quoter - receives prices from Uniswap V3
- Swapper - performs asset swap under conditions
- Order Manager - tracks list of orders and execute them
- Vault - tracks deposits into yield farming protocols
- Strategies - concept borrowed from Yearn Finance that allows to integrate with arbitrary list of yield farming protocols and can be potentially extended by community (and in long term -> accept submission by DAO governance)
- Frontend - connects to smart contracts and acts like a GUI for order submission, reviewing and claiming. We built the site with Next.js 13, wagmi and tailwind css.
- Chainlink Automation - is the core component of smart contract execution logic. Check upkeep identifies eligible orders for execution and upkeep triggers swap of assets.
Challenges we ran into
- Best yield farming strategies and highest APYs are available only on Ethereum Mainnet. We had a limited choice of tokens and APYs that could be achieved on Polygon. Additionally many protocols and tokens are not available on Polygon testnet - we had to deploy our smart contracts to the PoS mainnet and test through forking mainnet.
- Quoting a price from UniswapV3 was not that obvious like in UniswapV2, we had to utilize the OracleLibrary implementation.
- Iterating through an arbitrary list of orders can be expensive and restricted in Solidity. We plan to improve current storage implementation with a fixed-length rotating queue (with a limit to 10-50 orders per user).
- Working under time pressure after hours is challenging to sync the whole team and deliver a product, but we did our best to deliver a fully working demo :)
Accomplishments that we are proud of
- Implementing limit orders for tokens supported in strategy.
- Successful integration with AAVE for passive yield generation while awaiting your order.
- Great market research and identification of many potential upcoming strategies for future integrations.
- Providing a solution for smarter asset management, that can deliver limit orders before market achieving required price.
- Well-thought expansion plan for the project -> including utilization of ERC20 (backed by part of generated yield from fees) into governance mechanism operated through Snapshot and future DAO.
- We managed to design and implement not only the fully functional web app but also a visually pleasing landing page.
What we learned
- Deep dive into Chainlink services including Automation, where we understood very well how checkUpkeep and performUpkeep operate
- Integration with Uniswap V3, the power and limitations of TWAP Oracle and how to efficiently perform swaps
- We explored the market deeply (through multiple chains) to identify the best environment for kickstarting protocol and expanding it beyond Polygon. We integrated with AAVE currently and have in the future pipeline: Celer, dForce and Beefy. Other candidates are Stargate and Hop Network. Beyond Polygon there is plenty for future R&Ds and integrations on Avalanche and Ethereum Mainnet.
- That startups are time consuming and are a serious business. We should dedicate much more of our time, than just after hours, to focus on a project completely to tremble the DeFi landscape with innovation :)
What's next for YieldMate
- Refactor of codebase
- Security advancements
- Adding more yield farming protocols on Polygon
- Optimizing base supported assets
- Introducing fee mechanism, wrapping into new ERC20
- Utilizing ERC20 as a Governance token and forming DAO for accepting requests for new tokens and farming strategies
- Going beyond Polygon into multichain
- Potential integration with Bridges and expanding swapping with some aggregator like 1Inch.io
- For business R&D but potential partnership and collaboration with Chainlink for integration with their pricing oracle
Built With
- aave
- chainlink
- foundry
- tailwaind
- uniswap
- wagmi
Log in or sign up for Devpost to join the conversation.