Cygnus — An inside look at the first stablecoin leveraged yield farming protocol in Avalanche — Part 3
Website in 3… 2… 1… Go!
Since our release of Part 2, a lot has happened in DeFi which affects the direction Cygnus takes.
Mainly the much publicized Luna Ecosystem crash, which saw its native stablecoin “UST” de-peg and the subsequent Luna crash. UST is still floating somewhere between $0.1 and $0.3, with no sure signs of going back to the 1:1 USD peg. At the time of this writing, UST has not been able to recover.
Why does this affect Cygnus?
In Part 1, we outlined the inefficiency of over-collateralization, particularly in the borrowing and lending markets. When looking at stablecoins, we can see a clear contrast between algorithmic stablecoins like UST and FRAX versus their over-collateralized counter parts such as DAI. One praises efficiency and innovation, while the other praises safety and stability.
Since Cygnus is a stablecoin lending and leveraged yield farming protocol, this event re-enforced our original idea for Cygnus. The original vision of Cygnus by 0xHyoga and 0xCamus was to focus solely on DAI as the lending token due to DAI being the most popular over-collateralized stablecoin. This meant that the factory deploys 2 contracts on each deployment (see below for how the factory works), 1 for the LP Token as collateral and 1 for DAI as the borrow token. Watching these events unfold, made our conviction in this stronger.
The aim of this article is to explain in depth how Cygnus works. Cygnus seeks to combine over-collateralized coins such as DAI with under-collateralized loans, allowing users to leverage their farming position.
Cygnus is still in development, and we are getting closer to our vision of a decentralized stablecoin lending and leveraged yield farming protocol, enabling LP Farmers to go long and prosper on their positions.
We are not interested in making a quick buck or building some house of cards where even a minimal negative exposure crumbles the whole structure. Our goal is simply to give LP Farmers a way to benefit from the power of leverage and give stablecoin holders a more fun and immersed investing experience.
We are building a protocol that personally we want to use and also the community wants, given the feedback we have received. We are not acting according to some deadline set by VC’s or some budget constraints imposed by outside parties, only by our conviction for such a system to exist. With this mind, let’s explore Cygnus architecture and how it works 😎!
1. Cygnus Architecture
As explained earlier, Cygnus primarily consists of individual lending pools where lenders deposit stablecoins and farmers use their LP Token as collateral. These pools are denominated as “Shuttles” in the Cygnus platform. Each shuttle consists of stablecoin depositors and LP Token depositors.
The aim is to build a permissionless system, where anyone can deploy a shuttle and whatever happens to each shuttle does not affect the core functionalities of the protocol itself. As such, Cygnus comes in 2 flavours:
- Individual shuttles with whitelisted crew members only (addresses from friends, families, etc.).
- CyngusDAO Shuttles.
In the first case, the whitelisted shuttles act similar to Rari Capital’s pools where one may deploy individual lending pools and whitelist certain addresses only. With individual shuttles each shuttle consists of 1 borrower and many lenders. The borrower acts in a way as a fund manager, where only whitelisted addresses may deposit stablecoins for the borrower to leverage their position. By leveraging their position, the borrower earns more trading fees + liquidity mining rewards, sharing the profits with the crew proportionally to their investment. This simplifies the process for lenders who may be new to DeFi and/or are not sure where to start investing, but they have that one degen friend who keeps up with the current crypto markets. Borrowers are still subject to liquidation penalties for lenders to be always guaranteed their loan back, but the shuttle is not part of the CYG distribution program.
In the second case, shuttles are deployed only by the Cygnus DAO after a proposal for such a pool to exist. Since the income of the protocol and CYG stakers comes in the form of different actives (such as JOE, AVAX, WETH, etc.) the protocol benefits if the tokens do well, and suffers if the tokens do not perform to expectations. This is why it is important to separate individual shuttles (or lending pools, remember?) from CygnusDAO owned shuttles.
For example, let’s say Dave is a believer and liquidity provider in the Doggy420/MoonRug liquidity pool. If Dave wishes to, he could deploy a shuttle with his friends to make deposits for Dave to leverage his position and share the rewards with the crew. If anyone else wants to deply another shuttle, they are free to do so. In the best case scenario, the members will be sipping champagne in the shuttle while Doggy420 starts rallying up in price. In the worst case scenario, if MoonRug does what its name suggests, for example, then their actions do not harm the Cygnus ecosystem at all, only those shuttles who decided to invest in it.
This represents the architecture of Cygnus Core contracts:
The architecture follows Impermax’ implementation of individual lending pools (https://www.impermax.finance/) with minor differences.
The process starts at the Factory contract, where 1 LP Token deploys 2 contracts: One for stablecoin deposits (DAI) and one for LP Token deposits.
- The lending
Albireocontract (the black/greyish ones on the left)
- The collateral
Denebcontract (the blue on the right).
The collateral side of Cygnus contracts each comes with their own “minichef” contract which is connected to the DEX’ farm and to the LP Tokens’
Masterchefcontracts which most Dexes use to give rewards. It re-invests any rewards accrued on every deposit/withdrawal to accumulate more LP Tokens.
The lending side of Cygnus contracts on the other hand each comes with their own Borrow Tracker, which is in charge of accruing interests to borrows. The borrow tracker is also in charge of assigning reserves to the CygnusDAO vault.
It is important to note that the factory has 2 types of deployments, one for CygnusDAO shuttles and one for individual shuttles. The reason is that for CygnusDAO pools, 1 LP Token can only deploy 1 unique Shuttle (meaning one lending and one borrow contract) to avoid having multiple shuttles of the same LP Token. These are only deployed by CygnusDAO admins. In individual shuttles, 1 LP Token can be deployed many times by different parties!
2. Cygnus Geyser Vault
The main component of Cygnus comes in the form of our vault. The vault is a way for the community to gain from ALL fees that Cygnus entails. There are no “Dev” fees. All fees/reserves after a certain time become available to the community, and we believe that Geyser vaults provide an elegant solution for this. The Geyser V2 contract supports 1 “locked” token, and multiple reward tokens. Cygnus (CYG) will serve as the locking token, and by doing so users will have access to every single fee earned by CygnusDAO, playing a crucial role at the time of which pools to be whitelisted by Cygnus.
The Geyser vault provides a different way to earn rewards in contrast to the vote-escrowed tokens which have recently gained in popularity in DeFi. The ve tokens work excellent in certain environments and unique tokenomics, such as Curve or Convex’ systems, however we believe Geyser vaults to be more accessible and fun for most users. The process relies on a multiplier to reward users who are longer staked than others, however users may withdraw their staked tokens any time they want, and they do not have to unstake all at once!
The original Geyser vault was developed by Ampleforth, and was released under the “GNU General Public License v3.0 Only” license. The original code can be found here:
Here is a first look into the CygnusDAO revenue vault, which accumulates tokens from all the whitelisted pools, and distributes both the rewards and the reserves over time to all CYG stakers:
3. Liquidations and Risks
Cygnus was designed with the idea in mind that lenders act as the “investors” of each shuttle, and users who own that assets (LP Token) can use investor’s funds to increase their position. With this in mind, what are the risks that each party has?
Let’s first look at the risks in Traditional Finance and DeFi for each party.
In Traditional Finance, when a borrower takes out a loan, the risk is translated entirely to the lender. The borrower has complete control of the funds, and if he/she so wishes so may refuse to pay back the loan and the lender loses their capital. This paints a harsh contrast to DeFi, where the risk is translated entirely to the borrower. The lender is in most cases always guaranteed their deposits as borrowers are subject to liquidations by external parties, thus losing part or all of their collateral.
Cygnus follows the latter example, where the borrowers carry most if not all of the risk. In the extreme example that MoonRug coin does what it says it will, then both lenders and borrowers share the cost of such actions, but in normal cases the lenders should always be guaranteed their deposits back. This is why it is important for the DAO to examine the underlying assets before deploying a shuttle for all Cygnus users to use.
And that’s it for now! You can track our progress at https://twitter.com/cygnusdao as that is where we keep track of all our updates for the community for the time being.
The aim of this article is to cover Cygnus Core architecture along with our CygnusDAO revenue vault implementation. We covered how deployments work for both individual shuttles and CygnusDAO owned shuttles. We also covered briefly our implementation of Geyser V2’s vault and the risks for lenders and borrowers.
We developed the roadmap in the start of 2022 and we are doing our best to keep up with it:
We planned to do our beta launch in June, before 2022 H1 ends and mainnet launch at the start of 2022 H2 (July) and we believe we are well in track to achieve this. Our smart contracts are mostly finished and we are currently performing unit tests of each contract. Once finished, we will share with you all our deployments for the beta launch where users can deploy their own shuttles with friends, family or whoever they want along with Cygnus DAO owned shuttles.
Our last announcement was over 1 month now, and this is due to the team developing the protocol with carefulness and with a thorough approach. We are also not as active on Twitter as we should, as noted by some of our followers. The main reason is we are not marketers. However we do acknowledge that we should inform everyone more of our progress on Twitter or on Medium. As we get closer to testnet we vow to become more active and to open up different community channels (Discord/TG).
Also, if you wish to be part of an open source project and learn more about Cygnus, please reach out to 0xhyoga on Twitter. We have already included a few users interested in working with Cygnus within our internal communication channels! Whether you would be interested in being a moderator for social channels, designing, developing or just learning about us, we are always looking to grow our team.
Thanks to all the support and kind DM’s we have received. It’s been quite an experience so far.
CygnusDAO Core Team