Inspiration

Crypto never sleeps and can be volatile.

Even the most vigilant investor can be caught out by rapid price changes and black swan events. When yield farming, investors need a way to limit their exposure to adverse price movement while their assets are working for them generating income.

Earning yield on your assets is a great feeling, and so is giving to a worthy cause , If only there was an investment platform that protected deposits and donated to charities! 🤔💡

What it does

Liquiswap watches the market price of assets its users have invested on protocols like Aave. If the price drops below the user defined threshold, Liquiswap will automatically withdraw the investment asset and swap it for stablecoin, limiting potential losses. It's a stop loss while your assets are earning yield.

When a user withdraws a profitable investment, a portion of their profits will be shared with Liquiswap charities. In recognition of their generosity, they will receive a Liquiswap NFT. Earning Liquiswap donation NFTs will gain them membership and rights in the nascent Liquiswap DAO.

How we built it

The backbone of the platform is Chainlink services, namely Chainlink Price Feeds and Automation.

An EVM smart contract constantly monitors the price of an investment asset against the stop loss thresholds that platform users have set. The demo monitors MATIC deposited on Aave. Should the trigger conditions be met, Chainlink Automation executes the contract's intervention logic to swap the assets for stablecoin. The demo executes the swap on Uniswap.

We store user transaction data in decentralized storage using a backend node server to post data to IPFS. We are using web3.storage, which provides a real database experience for storing and retrieving data. Backend server code here :- https://github.com/VaibhavArora19/Liquiswap/blob/main/server/server.js IPFS code from line 52.

Challenges we ran into

Liquiswap combines a complex set of protocols and transactions, and setting up and test scenarios is a complex process. Additionally, low testnet activity on DeFi protocols means that they do not necessarily behave as expected, and it requires a few tricks and workarounds to successfully test in spite of these issues.

Accomplishments that we're proud of

Our concept employs multiple disparate technologies and protocols, which created a great deal of complexity in our smart contracts, frontend and backend, and took us into a lot of unfamiliar territory. Each member of the team contributed different skills and strengths to bring the whole thing together into a working platform.

We created a backend service to monitor the blockchain for our contract event logs and commit them to IPFS for data storage. This was a completely new endeavour for us, but it worked out really well and is something we’re really pleased with.

What we learned

We gained familiarity with so many technologies and protocols that we hadn’t worked with before. We broke a lot of new ground on the smart contract side, frontend and created our very first backend service.

What's next for Liquiswap

The Liquiswap demo was built on the Polygon network, using MATIC as the investment asset, Aave as the yield platform, Uniswap to execute swaps and DAI as the stablecoin,. The number of possible new combinations of these elements is huge. The aim would be create more utility by building and offering more options of assets, platforms and networks.

Liquiswap DAO needs to be brought to life. Liquiswap is the 'how' of how to provide something of value to users and create a vehicle for social good. Liquiswap DAO encapsulates the 'why'.

Starting from the ground up, we have to build the DAO around our shared vision, grow a community of like minded people, and create the mechanism to allow that community to function as whole.

Refactoring code: we have built a functioning platform and proof of concept, but we have a lot to do to revisit the finer points of how the logic works in certain scenarios and edge cases. Refactoring is required to refine logic, and harden the code in terms of scalability, reliability and security.

Explore potential to add more automation features, like buy/sell limit orders.

Built With

Share this project:

Updates