OriginProtocol / origin-dollar

OUSD and OETH are stablecoins that passively accrue yield while you are holding it
https://originprotocol.com
MIT License
115 stars 75 forks source link

Improve reallocation process #1520

Open micahalcorn opened 1 year ago

micahalcorn commented 1 year ago

As described in the semi-automated allocations proposal, our current process for reallocation collateral has three main problems:

1) It neither maximizes yield nor minimizes risk 2) It is slow and inefficient 3) It lacks clarity for prospective users who want to know how their funds will be managed.

Let's come up with a solution for creating an objective process that people can trust and that can enable the Strategists or the protocol to operate more effectively with less manual effort. From my perspective, this starts with answering two questions:

1) What are the parameters that should be used to make allocation decisions? 2) How and when are the allocations executed?

DegenSensei commented 1 year ago

First thoughts regarding rebalancing: Target weight for each asset 33% Deviation = Current weight - target weight → Check deviation threshold → does it exceed predefined threshold (min 24% - max 49% - still to be tweaked)? If yes → proceed with rebalancing → is the deviation positive or negative → if positive = it’s above weight, if negative = below weight. Else no action.

Factor in transaction cost in rebalancing cost → if transaction cost is 0.2% → multiply rebalancing amount with 1.002 to account for cost w/o gas fees. Add gas fees on top of this action as an additional fluctuating variable.

Assess slippage based on historical data for similar amounts of value.

Calculate rebalancing amount: (Deviation * total portfolio value) / (1+ swap fee + slippage + gas fees)

→ Execute rebalancing in decentralized exchange with deep liquidity (Curve)

→ Update portfolio weights

Monitor weights on a consistent basis, Ideally, we want to use something like e.g. Keep3r network for a command that Reads the weights calculation function. Depending on the response we then either execute it or no action. (outside party can only Read weight function to monitor portfolio weights and not execute rebalancing function).

Will follow this up with thoughts regarding strategy for yield allocation as this mainly concerns OUSD underlying assets.

joshfraser commented 1 year ago

There are 3 competing objectives for us to consider:

Diversification is the easiest to implement but probably adds the least value for our yield hungry users. Diversification feels easy to achieve on your own. Projects like TokenSets have tried offering diversified baskets of assets in the past w/o much adoption. They now appear to be focused entirely on yield optimization instead.

Yearn similarly seem to have taken the approach of prioritizing yield over diversification. Some Yearn vaults have a dozen strategies but 95% of the funds are sitting in a single strategy. From what I can tell, the market cares more about chasing yield than slightly minimizing risk via diversification. Chasing yield is a much harder problem as we only have historical data not future projections of yield. Even historical data can be expensive/complicated to access onchain. Despite being challenging to implement, we should prioritize maximizing yield over a simplistic diversification strategy.

We also need a way for the community to voice their preferences and also inform the protocol when the world changes in a way that the protocol can't possibly detect (eg. rumors of a backing stablecoin losing their banking partner). We also want to leverage the wisdom of the crowd for decisions like how much value to place on accumulating MORPHO tokens. There's no way for the protocol to intelligently price these tokens today as they are non-transferrable but should have value in the future.

Our objectives are to:

DanielVF commented 1 year ago

Here's how I think about my votes for allocations.

Which strategies have the best yield situations actually tends to stay the same for weeks or months at a time. While it's good to monitor and make changes when a big change happens, the time for changes is actually far less often than weekly.

Start with a long term soft collateral allocation for non three pool funds. Say 60% USDT, 20% DAI, 20% USDC. Ignore this for the first bit.

  1. Pick the best lending strategy for each collateral type from the allowed strategies. Calc the weighted averagish rate on funds. (Simple version)

  2. Go through each AMM style strategy, taking into account policy min and max, find the allocation range that would make for maximum yield over the baseline strategy. Some strategies won't be competitive here, and should get zero allocced. Most good ones have a plateau shape for extra yield over the baseline strategy. Outside these ranges quickly gets worse. Just make sure we are inside that. If the ideal allocation change is small, don't bother.

Now we have a list of dollars that need to go in or out of these AMM strategies.

  1. Pick the mix of coins moving into or out of the AMM such that it brings the non AMM funds closer to desired soft mix target.

  2. Ensure all non AMM funds are allocated to best lending platform for that kind of coin.

If actually building a transaction:

  1. Ensure default strategies match the allocated lending platform.
DegenSensei commented 1 year ago

Further thoughts that would go into an eventual governance proposal based on your feedback:

In consideration of the challenges posed by cumbersome reallocations, our aim is to devise a streamlined process that promotes efficient allocation decision-making, bypassing the need for extensive governance discussions on minute details. To achieve this, it is crucial that we establish a clear set of rules within which the strategist can operate, ensuring easy verification on-chain.

To facilitate this process, I propose a set of rules that warrant discussion before finalizing parameters. These rules should prioritize the comfort and confidence of all stakeholders involved.

Firstly, to generate a favorable risk-adjusted return for OUSD, the strategist must reallocate capital between various pre-determined strategies across different protocols. These strategies encompass lending strategies and market-making approaches across platforms such as Convex, Aave, Compound, Curve, Morpho, and Liquity, with the goal of generating interest for OUSD.

To streamline this process and enable efficient execution when opportunities arise, the strategist should operate solely using the funds within the vault. The following parameters are suggested for the vault:

For non-3pool strategies: A maximum of 60% of funds can be allocated to a single stablecoin strategy to avoid endangering the protocol. Within this strategy, the strategist should execute swaps between the underlying collateral (USDT, USDC, DAI) to ensure compliance with the strategy's specified requirements. If the weighting exceeds 60%, rewards should be harvested and deposited into another strategy to rebalance and increase its weight. This exception may be disregarded only if the other strategies significantly underperform the largest weight (subject to governance decision).

In our pursuit to offer an attractive APR for OUSD holders, we also seek to hedge LPs across different ecosystems to enhance risk-adjusted returns. Accordingly, if a protocol aligns with our risk framework and presents compelling opportunities, an initial cap of 5% of the OUSD vault value will be set for new strategies. If the strategy demonstrates strong performance over a substantial period, exceeding this cap may be approved by governance. Note that the 5% cap does not imply an immediate allocation of 5%, but rather a gradual increase based on performance, starting from, for instance, a 1% allocation (our current LUSD strategy has 100k deployed to it).

While the harvesting process is already automated, we should delve into the subsequent execution. Currently, we utilize v2 pools to swap rewards and compound them into more OUSD. In an automated version, we can consult the Oracle pricing and notify MEV (Miner Extractable Value) bots that we are willing to accept, for instance, a 1% slippage hit on harvested rewards. The MEV bot that offers the highest bid can then execute the transaction. However, in the preliminary version, we should transition from using v2 pools to employing aggregators such as 1inch or Defillama swap to ensure optimal execution of reward transactions without incurring significant slippage.

The same principle applies to rebalancing across USDT, USDC, and DAI, where slippage becomes a relevant factor when swapping large amounts of capital within pools. Determining the most favorable execution through aggregators should be included as a "check" in our rebalancing process.

To safeguard our capital, it is essential not to hold a share greater than 25% of the Total Value Locked (TVL) in any given strategy. This precautionary measure ensures that an exit by us or another party does not cause an imbalance, which would result in slippage costs upon leaving the pool.

The strategist will perform an off-chain calculation to determine the optimal allocation across strategies in order to maximize yield. This strategy will be made publicly available, ensuring transparency for all depositors regarding capital allocation. It can be rebalanced as long as the allocation adheres to the aforementioned rules. Thus, the rebalancing is not based on specific time intervals but instead on how the weights perform. At times certain strategies might have 0% weight allocated due them due to bad performance.

Furthermore, we seek to underscore the significance of considering governance tokens that hold long-term value when allocating capital to farming ventures that yield the corresponding reward tokens. For instance, we have engaged in farming Morpho and obtained their non-transferable token as a reward. Although this token cannot be instantly redeemed for rewards, it may potentially confer additional advantages to OUSD in the future. Consequently, we should aspire to decide how much value we place on strategies of this nature, recognizing their potential benefits for our overall objectives.

DanielVF commented 1 year ago

In consideration of the challenges posed by cumbersome reallocations, our aim is to devise a streamlined process that promotes efficient allocation decision-making, bypassing the need for extensive governance discussions on minute details. To achieve this, it is crucial that we establish a clear set of rules within which the strategist can operate, ensuring easy verification on-chain.

I think our primary objective is not to move from weekly community votes to strategist driven allocations, but rather from weekly community vote to an algorithm that controls the allocations.

DanielVF commented 1 year ago

While the harvesting process is already automated, we should delve into the subsequent execution. Currently, we utilize v2 pools to swap rewards and compound them into more OUSD. In an automated version, we can consult the Oracle pricing and notify MEV (Miner Extractable Value) bots that we are willing to accept, for instance, a 1% slippage hit on harvested rewards. The MEV bot that offers the highest bid can then execute the transaction. However, in the preliminary version, we should transition from using v2 pools to employing aggregators such as 1inch or Defillama swap to ensure optimal execution of reward transactions without incurring significant slippage.

The harvesting implementation details would seem to be out of scope for rules about how to allocate funds?

DanielVF commented 1 year ago

In our pursuit to offer an attractive APR for OUSD holders, we also seek to hedge LPs across different ecosystems to enhance risk-adjusted returns. Accordingly, if a protocol aligns with our risk framework and presents compelling opportunities, an initial cap of 5% of the OUSD vault value will be set for new strategies. If the strategy demonstrates strong performance over a substantial period, exceeding this cap may be approved by governance. Note that the 5% cap does not imply an immediate allocation of 5%, but rather a gradual increase based on performance, starting from, for instance, a 1% allocation (our current LUSD strategy has 100k deployed to it).

How long does this cap last, how is it ended?

DanielVF commented 1 year ago

To streamline this process and enable efficient execution when opportunities arise, the strategist should operate solely using the funds within the vault.

What other funds would they operate with?

DanielVF commented 1 year ago

For non-3pool strategies: A maximum of 60% of funds can be allocated to a single stablecoin strategy to avoid endangering the protocol. Within this strategy, the strategist should execute swaps between the underlying collateral (USDT, USDC, DAI) to ensure compliance with the strategy's specified requirements. If the weighting exceeds 60%, rewards should be harvested and deposited into another strategy to rebalance and increase its weight. This exception may be disregarded only if the other strategies significantly underperform the largest weight (subject to governance decision).

Our lending platform strategies are basically Compound based or AAVE based. This 60% rule roughly means that many times we would need to be in both of them. Sometimes Compound is having issues and we don't want to be in them. Often yield on a particular stablecoin will be much worse in one of them.

Morpho yields usually are much higher than Compound or AAVE directly, are we willing to have a chunk of our funds earning less?

DanielVF commented 1 year ago

To safeguard our capital, it is essential not to hold a share greater than 25% of the Total Value Locked (TVL) in any given strategy.

Might need some clarification that this is not 25% of our TLV, but 25% of the target pools TLV. If that's what you mean.

However, it's really all about what percentage of the target's pools 3pool tokens we hold, not just the total pool TLV.

DegenSensei commented 1 year ago

In consideration of the challenges posed by cumbersome reallocations, our aim is to devise a streamlined process that promotes efficient allocation decision-making, bypassing the need for extensive governance discussions on minute details. To achieve this, it is crucial that we establish a clear set of rules within which the strategist can operate, ensuring easy verification on-chain.

I think our primary objective is not to move from weekly community votes to strategist driven allocations, but rather from weekly community vote to an algorithm that controls the allocations.

The initial calculation of the algorithm would be done off-chain though initially. Probably worded a bit wrong but I'd say that's the intention of it and then it's the algorithm that controls the allocation based on the initial calculation?

DegenSensei commented 1 year ago

To streamline this process and enable efficient execution when opportunities arise, the strategist should operate solely using the funds within the vault.

What other funds would they operate with?

Should be re-worded to "that the strategist can't withdraw capital out of the vault". Focusing on transparency and safety. Although this is already the case it needs to be clearly stated.

The harvesting implementation details would seem to be out of scope for rules about how to allocate funds?

That part can be removed.

How long does this cap last, how is it ended?

Cap would last until a new governance proposal is set up to fully whitelist it.

DegenSensei commented 1 year ago

For non-3pool strategies: A maximum of 60% of funds can be allocated to a single stablecoin strategy to avoid endangering the protocol. Within this strategy, the strategist should execute swaps between the underlying collateral (USDT, USDC, DAI) to ensure compliance with the strategy's specified requirements. If the weighting exceeds 60%, rewards should be harvested and deposited into another strategy to rebalance and increase its weight. This exception may be disregarded only if the other strategies significantly underperform the largest weight (subject to governance decision).

Our lending platform strategies are basically Compound based or AAVE based. This 60% rule roughly means that many times we would need to be in both of them. Sometimes Compound is having issues and we don't want to be in them. Often yield on a particular stablecoin will be much worse in one of them.

Morpho yields usually are much higher than Compound or AAVE directly, are we willing to have a chunk of our funds earning less?

Hmm no, that's essentially what we want to get around with this. I guess in this case it might be better to set a rule around that "promises" that "Origin will aim to maximize yield for OUSD holders by depositing into the strategy that provides the best risk-adjusted return. This implies that at times our capital might be concentrated on a few strategies to maximize value for OUSD holders."

Disregard the wording for now. Although do you think it's better to disregard a cap altogether and instead insert a clause for "in times of heavy volatility we will take the necessary swift action to protect vault capital that might require us to exceed stated parameters, this is a temporary intervention that has proven to protect us in prior crises (reference USDC depeg)"?

DegenSensei commented 1 year ago

Revised version: In consideration of the challenges posed by cumbersome reallocations, our aim is to devise a streamlined process that promotes efficient allocation decision-making, bypassing the need for extensive governance discussions on minute details. To achieve this, it is crucial that we establish a clear set of rules that are established by an algorithm that controls the allocations. This algorithm will initially be devised off-chain and then executed on-chain.

To facilitate this process, I propose a set of rules that warrant discussion before finalizing parameters. These rules should prioritize the comfort and confidence of all stakeholders involved.

Firstly, to generate a favorable risk-adjusted return for OUSD, the strategist must reallocate capital between various strategies across different protocols. These strategies encompass lending strategies and market-making approaches across platforms such as Convex, Aave, Compound, Curve, Morpho, and Liquity, with the goal of generating interest for OUSD. Capital that is deposited into the vault can’t be withdrawn by the strategist to ensure the safety of funds.

To streamline this process and enable efficient execution when opportunities arise, the strategist should operate solely using the funds within the vault. The following parameters are suggested for the vault:

Origin will aim to maximize yield for OUSD holders by depositing into the strategy that provides the best risk-adjusted return. This implies that at times our capital might be concentrated on a few strategies to maximize value for OUSD holders. In times of uncertainty, the algorithm might decide to de-risk certain strategies to safeguard the capital in the vault. The algorithm will aim to maintain a healthy balance among the underlying assets which are USDC, USDT, and DAI. However, in times of heavy volatility, we will take the necessary swift action to protect vault capital that might require us to exceed stated parameters, this is a temporary intervention that has proven to protect us in prior crises (such as the USDC depeg).

In our pursuit to offer an attractive APR for OUSD holders, we also seek to hedge LPs across different ecosystems to enhance risk-adjusted returns. Accordingly, if a protocol aligns with our risk framework and presents compelling opportunities, an initial cap of 5% of the OUSD vault value will be set for new strategies. If the strategy demonstrates strong performance over a substantial period, exceeding this cap may be approved by governance. Note that the 5% cap does not imply an immediate allocation of 5%, but rather a gradual increase based on performance, starting from, for instance, a 1% allocation (our current LUSD strategy has 100k deployed to it). The cap cannot be increased unless a quorum has been reached in governance.

In regards to rebalancing across USDT, USDC, and DAI, where slippage becomes a relevant factor when swapping large amounts of capital within pools. Determining the most favorable execution through aggregators (1Inch, Defillama swap etc.) should be included as a "check" in our rebalancing process in the first automation step. In a potential final version we could notify MEV (Miner Extractable Value) bots that we are willing to accept, for instance, an x% slippage hit on execution. The MEV bot that offers the highest bid can then execute the transaction.

To safeguard our capital, it is essential not to hold a share greater than 25% of the target pool’s tokens in any given strategy. This precautionary measure ensures that an exit by us or another party from a liquidity pool does not cause an imbalance, which would result in slippage costs upon leaving the pool.

Furthermore, we seek to underscore the significance of considering governance tokens that hold long-term value when allocating capital to farming strategies that yield the corresponding reward tokens. For instance, we have engaged in farming Morpho and obtained their non-transferable token as a reward. Although this token cannot be instantly redeemed for rewards, it may potentially confer additional advantages to OUSD in the future. Consequently, we should aspire to decide how much value we place on strategies of this nature, recognizing their potential benefits for our overall objectives.