Git Product home page Git Product logo

sip-contracts's Introduction

✨ Introduction

There aren't many DeFi projects which allow for, what we call in TradFi, Systematic Investment Plans. We hope to change that with the introduction of our project which allows a user to subscribe to various investment plans which are automated to provide maximum efficiency and minimum effort. The aim was to minimize user's active involvement in managing their portfolio and hence, we automated the necessary parts of investing into different strategies (dHedge and Sushiswap DCA). Only thing the user needs to do is set some parameters and forget the rest (I mean leave everything else to us !). First aspect of our project is called Super-dHedge and it's the integration of dHedge with Superfluid constant flow agreements allowing you to set a stream of tokens to DCA into a dHedge pool. Second aspect is called Auto Dollar Cost Averaging which allows traditional DCA involving pools on Sushiswap. We believe that this strategy will allow for custom parameters/control over their DCA strategy.

 

dHEDGE 🤝 Superfluid (Super dHEDGE)

​dHEDGE is a one-stop location for managing investment activities on-chain where you can put your capital to work in different strategies based on a transparent track record.

With our Superfluid enabled integration, users of dHEDGE can subscribe to any active pool/fund using Superfluid supported/equivalent supertokens of the underlying tokens which are accepted by the dHEDGE pool. A user just has to start a stream. Tokens are deposited into the dHEDGE pool regularly (in approx 24 hour periods) using keepers (Gelato network keepers for the time being). DHPT (dHEDGE Pool Tokens) are minted after each deposit and these are then available for withdrawal after approx 24 hours for the user.

Furthermore, we provide details to track how much has been streamed/deposited to a dHEDGE pool, how much of your streamed amount is uninvested and how much DHPT (dHEDGE Pool Tokens) you can withdraw from our contracts.

We plan to upgrade/modify contracts to support Superfluid IDA (Instant Distribution Agreement) functionality later. This would enable us to distribute the DHPT minted instantly to the users. We also plan to deploy these contract to Optimism once they gain popularity and are proven to be safe enough.

 

Tech used in Super D HEDGE

 

🤖 Auto Dollar Cost Averaging

This product allows a user to create custom DCA task. This custom task is then monitored by Chainlink Keepers' and executed as per the parameters set by the user during task creation. Gas fees are taken upfront from the user for the entire duration of the task (in MATIC).

 

Tech used in Auto Dollar Cost Averaging

 

🏗️ Deployments

Super dHEDGE

🏢 Infrastructure (Core and Helper Contracts)

Contract Name Address
SFHelper 0x18CA85221385D8a4A0Dcb8c7FE5aD1f22843349b
dHedgeHelper 0x66E230030d7C45a6fe4d8d3661900fd4d95Aef07
dHedgeStorage 0x0528029C92dB92c466c3fd7bDff7cd0f25126829
dHedgeBank 0xF01696558f28CB1676Fca25f3A3C16b0951366b6
dHedgeUpkeepGelato 0xa78C29cFbabe6829Cbf645DB532a9e597254F5C1

 

💸 Active Super dHEDGE Pools

Pool Name dHEDGE Pool Address Super dHEDGE Address
dHEDGE Stablecoin Yield 0xbae28251b2a4e621aa7e20538c06dee010bc06de 0xC05B38Dd7D1bc0E65b2EE5dF19AC4296B382Cb10

 

Auto DCA

Contract Name Address
ChainLinkAggregator 0x2B76a4Fa993f30004B4e92caB6256F98d0612ae5
DCAChainLink 0x88df2C46e0e7D9185054e01965Dabf89e236Ae92

 

👨‍💻 Technology

  • Super dHEDGE
  1. dHEDGE - Discover top performing DeFi strategies.
  2. Superfluid - Allows for subscribing to a particular dHEDGE pool/fund.
  3. Gelato - Used to automate deposits to dHEDGE pools/funds.
  • Auto DCA
  1. Sushiswap - Swap, earn, stack yields, lend, borrow, leverage all on one decentralized, community driven platform.
  2. Chainlink - Keepers network and oracles used for automating a user's DCA task and ensuring best prices respectively.

sip-contracts's People

Contributors

rashtrakoff avatar

Stargazers

 avatar

Watchers

 avatar

sip-contracts's Issues

Create unhappy path/revert tests

The current tests don't check for all revert cases. These are the most important tests as they can point us to critical bugs. Come up with new test cases/scenarios such that those cases shouldn't occur in real world contracts. It's suggested to write or document the test cases before writing the tests for the same.

Notification/Bot System.

Each dHEDGE market works differently. To provide updates such as de-listing of deposit assets, APY changes and so on, a notification system is necessary. The notification system can be a Telegram/Discord bot providing information for each dHEDGE market to which a user is streaming to.

Another kind of a bot can be made to manage streams or to notify a user regarding their streams. For example, if a stream was closed or re-opened, the user can be notified of the same. Maybe the bot can allow a user to manage their streams directly from Telegram instead of going to SF dashboard or our dashboard ? This is highly experimental and can be a hackathon project in itself but I believe it's worth doing.

Close Stream Keeper.

When a user runs out of funds/supertokens, they tend to expect a service that will close their streams. We are in a good position to provide such a service because of our experience with Stroller Protocol. We can create a Gelato resolver contract which will close the streams of a user when their streams are gonna run out of funds in less than 12 hours or so. We can start with closing the streams to our cores of a user. Other streams will still go on but that's not our concern. A similar contract is already live which utilises the emergencyCloseStream function of a core contract. We need to create a new contract which uses Superfluid's new ACL features.

Create upgradeable contracts.

The contracts currently aren't upgradeable. Multiple bugs have been found and should some bug be found on mainnet version, it will become very difficult to fix and deploy a new set of contracts and tell all the users to change their streams. Although upgradeable contracts are controversial, particularly in our case as we intend to keep the control to ourselves initially, it would be helpful in having a set of upgradeable contracts which we can deploy when we choose to hand over the reigns of the project to the community.

Start and Restart Stream Keeper.

It's possible that a dHEDGE pool can disable a deposit asset i.e., the asset will no longer be allowed to be deposited into the dHEDGE pool. However, the streams of all users will still exist. In case the asset is disabled for a long time, the streams need to be stopped as they are not generating any yield for the users. When the asset is re-enabled, the streams should be re-started. However, this process should not take place frequently. This is because we will be unable to cover the gas costs associated with such frequent stream modifications. We should only close streams if the fees that we will get is more than the costs to manage every users' streams. Maybe we can only service those markets which actually generate enough profits to make stream management possible ?

Modify tests to NOT use mainnet forking.

Currently, most tests use mainnet forking to interact with dHEDGE contracts on Polygon mainnet. This makes the testing process slow and reliant on good internet connection. Ideally, we would like to test the contracts locally. This would involve mocking various contracts especially the dHEDGE ones. Instead of actually creating mock contracts, Waffle mocks can be used.

However, this issue is of low priority as the solution would involve a week or two's worth of dev time. Instead, I will write new test cases.

Break-up the existing dHedgeMathTesting test file

dHedgeMathTesting.test.js contains all the tests some of which can be placed in a new test file. The test cases should be grouped in a relevant manner. For example, if the test cases are for the keeper related functionality then they can be put into a separate test file and do the same if the test cases are for the mathematical aspect (calculation and validation of various amounts) of the contracts.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.