Inspiration

I was inspired by the recent collapse of many large CEX's. I wanted to create a way that people could develop their own automated investment strategies, without giving up custody of their tokens to a trust based institution.

What it does

At its core, OnChain Strategies is as way to automate investment strategies in a trustless way. Users approve a certain amount of their tokens to be swapped for another token, if a specified parameter is met. That could be a time interval, or the change in a Chainlink data feed.

How we built it

The smart contracts were developed and tested in Brownie. I then built a basic frontend in vanilla Javascript, and HTML.

Challenges we ran into

As usual, the most difficult part was the frontend. The smart contract's came together rather quickly. But I find it hard to develop intuitive, and appealing frontends. However I think overall it came out nicely in the end.

Accomplishments that we're proud of

I'm really proud I was able to finish multiple strategies, at first I thought I'd only have time to complete time based strategies, but when I had completed the data feed strategy contracts only a few days later, I was really happy that I'd been able to go beyond my original scope for this project.

What we learned

I learnt the importance of taking breaks from a codebase. At one point, I thought the smart contracts were complete, and didn't look at them for a couple weeks. Later when working with the contracts ABI while writing the frontend, I realized there was a pretty big issue with my contracts logic.

After seeing it, I wondered how I hadn't noticed it before. And I realized I'd just been too close to the code for too long. I needed to take a break, come back with fresh eyes, and review the code before deploying the smart contracts.

What's next for OnChain Strategies

I want to develop more types of strategies for users to take advantage of, one idea I've been playing around with has been a VRF strategy.

Ultimately I would like to get to a place where a single strategy can incorporate multiple types, so even more complex strategies can be developed by users.

Share this project:

Updates