OriginProtocol / origin-dollar

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

Base Chain WOETH Strategy #2055

Closed DanielVF closed 4 months ago

DanielVF commented 4 months ago

Quick Summary

Objective

We want to allow the OETH Vault on Base to deposit ETH to OETH on mainnet and earn yield from it. This strategy just sits on a pile of bridged from mainnet wOETH. The value of this wOETH goes up as the exchange rate of bridged wOETH goes up.

Complication 1 - No programmatic way to withdraw funds.

There is currently no way to 1:1 convert mainnet OETH to mainnet ETH. This means we cannot built a contract only way to convert back from WOETH to ETH.

We can however allow the strategist to provide WETH to the strategy in exchange for WOETH from strategy at the current WOETH exchange rate. This will allow us to do the conversion out of band, and lets us launch with at least a path to withdraws.

Complication 2 - Bridges and Async

This strategy needs to convert assets on the other sides of the bridge. This is an asynchronous process that will take perhaps 40 minutes to complete. During this time, the strategy will not hold the assets. Balance checking needs to be able to account for assets that are inflight.

Further complicating this, the amounts received back may not exactly match - both because of gas reasons and because the exchange rate may have gone up in the meantime.

Also complicating things is that we will need to deploy a contract to mainnet that will handle purchasing the WOETH and send it back.

We also have to pay fees on bridged operations. This will require bridge fees on both sides of the chain. We'll need to have some way to handle providing funds for this, or of taking them out of funds transferred.

Complication 3 - What happens if things go wrong?

What happens if we send money off the contract, and then on the other side of the bridge, sending back the OETH fails? How do we handle this? How do we recover?

Possible architecture

image
DanielVF commented 4 months ago

Deferring on bridging this for now.