Saffron begins: epoch 0

psykeeper
saffron.finance
Published in
6 min readNov 1, 2020

Saffron is launching today in less than 2 hours from post time, at 2020–11–01 14:00 UTC. The starting date was pre-decided and set in the Saffron pool contract upon deployment. The relevant code can be found on GitHub and verified on etherscan.io. Another Medium post from yesterday explains the high-level concepts and can be found here. It may be required reading to understand some of the more technical details laid out below.

How does it work?

The system works like this:

1. Liquidity providers add liquidity to the Saffron DAI pool
2. LPs receive two Saffron LP tokens for adding liquidity: principal and dsec
3. DAI added to the pool is locked until the epoch ends. LP tokens are regular ERC20 tokens and can be traded freely
4. At the end of the epoch, LPs redeem their LP tokens for interest+SFI and principal. dsec tokens are redeemable proportionally for interest+SFI and principal tokens are redeemable for the exact amount of DAI

As an example: if I own 150 principal tokens and 10% of the dsec tokens then I can redeem 150 DAI and 10% of the interest and SFI earned during the epoch.

Remember, the epoch begins at a fixed time and has a fixed length of two weeks, so if an LP enters 10 days into the epoch then they are only locked in for 4 days. However, their dsec value (calculated by multiplying dollar value by seconds remaining in the epoch) is much lower than anyone who became an LP earlier in the epoch.

What’s the difference between epoch 0 and the next epoch?

Currently epoch 0 has limitations by design. The first is that all liquidity must be added into the S tranche. This is because SFI will be needed to add liquidity to the A tranche and SFI does not exist until it is minted at the end of the epoch. Finally, the A tranche and AA tranche must be balanced evenly to provide the A tranche with its guaranteed enhanced yield multiplier. If the A tranche is 0 then the AA tranche must necessarily also be 0. Therefore, all LPs will enter into the S tranche in epoch 0 and the system will earn the base rate for lending DAI on Compound, which is currently 5.35%.

In the future, the A and AA tranches will be available for LPs to select, and they can start earning multiplied interest or buying loss coverage.

Why does the duration slider lock me in to a certain minimum time?

The minimum duration for any deposit is the duration between the time of deposit and the end of the epoch. The Saffron web3 app does that calculation for you and displays the minimum duration above the slider bar. In epoch 0 all liquidity must be removed at the end of the epoch because there will be a hard fork to enable new features added to the system. Don’t worry, as long as you have your LP tokens, you can redeem them at any time using the epoch 0 smart contract.

The next version of the Saffron contract system will implement AA and A tranches as well as rollover liquidity, commitment extensions, and adding more token pools and platform adapters to the system. One of the new token pools will be the SFI staking pool which is required to participate in the A tranche.

Can you give me an example?

Yes. We’ve already performed a beta epoch 0 for 14 days earlier in October which had 15 participants using a combined 10,000 DAI to test the system. You can view some of the example transactions here:

https://etherscan.io/tx/0x763f70e1aa77d52db8ed360f01188434d0b05ce28409b47c8afddacbe9717d3f

https://etherscan.io/tx/0xeccbea1f9edf0c24fb584582d46b55ae9eef92512a08256e65515dee5cadceaf

These are two add_liquidity operations from two users in our beta epoch. One was from 14 days ago, and the other is from 11 days ago. The first added 376 DAI and received 100 million dsec, and the second added 2,251 DAI and received only 23 million dsec. That’s because as the epoch draws near an end, the seconds remaining decreases, and your proportional share of dsec is reduced. After all, someone who added 10MM DAI to the pool for 1 second didn’t really generate much interest compared to someone who added 1MM DAI for 2 weeks.

Feel free to look around the pool contract from the beta test to get a better idea of what’s going on in the system: https://etherscan.io/address/0x7db640b1190b192e8c977208d863e0e1e821cbdb

What about the team allocation?

The team is not receiving any SFI until the end of the epoch. At that point 30,000 SFI is generated for liquidity miners, and at the same time, 10,000 SFI is generated and sent to the team contract. Governance on the team contract mandates that the full amount is split up and distributed to 13 different addresses. These addresses can be updated and could be replaced with a timelock for vesting over time or another contract (e.g. a contract to add liquidity to Uniswap). Currently, all 13 addresses are EOAs that are owned by team members.

How do rewards get distributed to liquidity miners?

Right now the current system works like this:

  1. DAI interest is split up proportionally using dsec.
  2. SFI mined is split up proportionally using dsec.
  3. COMP rewards are currently set for manual governance distribution.

To explain point #3 in more detail, this is because the Compound system’s new reward distribution doesn’t fit nicely with the way we split up rewards to LPs exactly proportional to their dsec contribution. The current plan is to either:

  1. Distribute COMP rewards manually based on LP dsec after-the-fact
  2. Use COMP rewards to provide liquidity to a Uniswap SFI/WETH pool

It seems that the community would much prefer option #2 and we may consider executing this option at the end of the epoch rather than distributing COMP rewards manually.

What power does governance have?

The governance address has some powers in the system until they are set to the 0x0 address. Firstly, SFI generation is set by governance to the pool for epoch 0, and must be re-set to the next pool at hard fork time. The relevant code is here:

This is because we want to be able to use the same SFI token throughout the lifetime of Saffron.

The governance address also has two sweep functions for ERC20 tokens sent to the adapter. One is unlocked and the other is locked for 10 weeks:

https://github.com/saffron-finance/saffron/blob/38da95ec2d0c15f68aee739168ecd6adb7f0f523/contracts/FlatDAI_Compound_Adapter.sol#L636-L661

This is for three reasons:

  1. In case of accidental sending tokens can be recovered.
  2. Compound rewards must be distributed to LPs and this function will let us do that.
  3. If anything goes wrong then funds are recoverable after a certain date.

We think the 10 week limit on governance sweep will allow enough time for everyone to withdraw their principal.

Finally, the governance address has the ability to add and remove adapters and pools, which is an intended feature for adding currencies and platforms in the future. Every hour the strategy contract can execute a strategic deploy on the pool and the pool sends all DAI to the adapter to interface with Compound. It is possible that the governance EOA could change the adapter address to a malicious adapter. Users concerned about an adapter switch-up can execute add_liquidity and deploy_all_capital as there is no governance control over these functions.

Join the community

Saffron is launching liquidity mining for the first epoch on Sunday, November 1st, 2020 at 2:00pm UTC (Ethereum block time: 1604239200). Subscribe to the pages below for more events, updates, and information about Saffron and its unique ecosystem of decentralized finance applications.

Web3 app: https://saffron.finance
Telegram: https://t.me/saffronfinance
Discord: https://discord.gg/pDXpXKY
Twitter: https://twitter.com/saffronfinance_
Github: https://github.com/saffron-finance/saffron

--

--