-
Notifications
You must be signed in to change notification settings - Fork 2
Review docs (Intro; Protocol; Governance; OPTY) #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 17 commits
26d31af
811be15
45b032e
9709a1d
2ef2451
5977a40
a74dd2f
924f68a
bf4146b
ddc17a7
b5b628e
537e9dd
cc5066d
e3387b9
1125112
1a9f37b
47d7edc
8ca8cd0
3767589
acc4e25
8d255ac
e88d229
57cee05
78c537f
525c4da
cae0f0a
2bb5850
8f44f7b
8f17440
c5b9bd5
43e0c6c
2469676
a5ca8de
e0876d5
135ce51
8b14309
8e389b6
7d0e59a
4093dd4
506ab3c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,9 @@ | ||
| # The OptyFi Protocol | ||
|
|
||
| The OptyFi Protocol approaches DeFi yield from a first principles perspective. | ||
|
|
||
| Starting with an abstracted view of liquidity pools, we define yield [strategy steps](strategy-composition.md#strategy-step) which can be combined in [sequence](strategy-composition.md#strategy-sequence) into yield strategies, which in turn can be combined in parallel into yield portfolios. The universe of possible strategies form a directed [Strategy Graph](strategy-composition.md#strategy-graph), and executing a yield strategy can be conceptualized as traversing this Strategy Graph. | ||
|
|
||
| Users deposit their assets into OptyFI vaults, from where these assets are continuously deployed into optimal strategies that match the [risk profile](risk-framework.md#risk-profiles) of the vault. | ||
|
|
||
| [Strategy Execution](strategy-execution.md) contracts are able to execute any arbitrary multi-step strategy while enforcing [risk constraints](risk-framework.md). The [Optimization Engine](optimization-engine.md) continuously monitors thousands of data points across hundreds of liquidity pools in order to recommend the current optimal strategy to vaults. | ||
| The OptyFi Protocol approaches DeFi yield from a [first principles perspective](https://fs.blog/first-principles/). | ||
|
|
||
| Starting with an abstract view on liquidity pools, we define yield [strategy steps](strategy-composition.md#strategy-step), which are [sequentially combined](strategy-composition.md#strategy-sequence) into yield strategies. Multiple yield strategies can in turn be combined in parallel to obtain yield portfolios. The plethora of possible strategies form a directed [Strategy Graph](strategy-composition.md#strategy-graph), and executing a yield strategy can be conceptualized as traversing this Strategy Graph. | ||
|
Kilniv marked this conversation as resolved.
Outdated
|
||
|
|
||
| Users deposit their assets into OptyFi vaults. These vaults function as a liquidity pool from which assets are continuously deployed into optimal strategies that match the [risk profile](risk-framework.md#risk-profiles) of the vault. | ||
|
|
||
| [Strategy Execution](strategy-execution.md) contracts are able to execute any arbitrary multi-step strategy while enforcing [risk constraints](risk-framework.md). The [Optimization Engine](optimization-engine.md) continuously monitors thousands of data points across hundreds of liquidity pools in order to recommend the current optimal strategy to vaults. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,22 @@ | ||
| # Optimization Engine | ||
|
|
||
| DeFi is known to be volatile and DeFi yield markets are significantly inefficient. This means that the yields \(and risk\) of liquidity pools change continuously even for pools with the same underlying asset. The composability of DeFi protocols allows assets to be exchanged for "derivative assets" \(e.g. DAI for cDAI\) creating more potential volatility. | ||
| DeFi is known to be volatile and DeFi yield markets are significantly inefficient. This means that the yields \(and risk\) of liquidity pools change continuously, even for pools with the same underlying assets. The composability of DeFi protocols allows assets to be exchanged for "derivative assets" \(e.g. DAI for cDAI\), creating more potential volatility. | ||
|
|
||
| OptyFi is designed to allow continuous discovery of the most optimal yield strategies. Since this requires evaluation of multiple blocks of data from hundreds of liquidity pools, initially OptyFi's Optimization Engine is designed as an off-chain process that "recommends" the optimal strategy to each vault. [Strategy Execution](strategy-execution.md) smart contracts are responsible for executing this strategy, ensuring it includes only approved pools and enforcing risk constraints of the vault. | ||
| OptyFi is designed to allow continuous discovery of the most optimal yield strategies. Since this requires evaluation of multiple blocks of data from hundreds of liquidity pools, OptyFi's Optimization Engine is initially designed as an off-chain process that "recommends" the optimal strategy for each vault. [Strategy Execution](strategy-execution.md) smart contracts are responsible for executing this strategy, ensuring it includes only approved pools and enforcing risk constraints of the vault. | ||
|
Kilniv marked this conversation as resolved.
Outdated
|
||
|
|
||
|  | ||
|
|
||
| ## Implementation | ||
|
|
||
| The Optimization Engine is implemented in a custom developed python library Opty.py which will be open-sourced and shared with the community. Key functions include: | ||
| The Optimization Engine is implemented in a custom python library (Opty.py) developed by the OptyFi team. This library will be open-sourced and shared with the community. Key functions include: | ||
|
|
||
| | Component | Function | | ||
| | **Component** | **Function** | | ||
| | :--- | :--- | | ||
| | **getPoolData** | Fetches liquidity pool data from the OptyFi API server. Currently, automated jobs capture pool data from the blockchain on an ongoing basis and make this data available to the Optimization Engine. However, this should be replaced by the Graph Protocol prior to launch. | | ||
| | **predictRates** | Uses fetched pool data to predict the deposit, borrow and reward rates for liquidity pools for the upcoming rebalancing window. This component incorporates pool data modelling; time series modelling and prediction and price impact modelling. | | ||
| | **buildStrategies** | Dynamically generates all possible strategies given the enabled pools. | | ||
| | **scoreStrategies** | Provides a score to each generated strategy based on the predicted rates. | | ||
| | getPoolData | Fetches liquidity pool data from the OptyFi API server. Currently, automated jobs capture pool data from the blockchain on an ongoing basis and make this data available to the Optimization Engine. However, this should be replaced by the Graph Protocol prior to launch. | | ||
| | predictRates | Uses fetched pool data to predict the deposit, borrow and reward rates for liquidity pools for the upcoming rebalancing window. This component incorporates pool data modelling; time series modelling and prediction and price impact modelling. | | ||
| | buildStrategies | Dynamically generates all possible strategies given the enabled pools. | | ||
| | scoreStrategies | Provides a score to each generated strategy based on the predicted rates. | | ||
|
|
||
| ## Decentralization | ||
|
|
||
| The OptyFi road map includes the decentralization of the Optimization Engine. Possible approaches include implementation on an L2 chain or the development of a custom and efficient OptyFi Yield Chain. | ||
|
|
||
| The OptyFi road map includes the decentralization of the Optimization Engine. Possible approaches include implementation on an L2 chain or the development of a custom and efficient OptyFi Yield Chain. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,11 +12,11 @@ Currently the OptyFi Protocol implements three pool ratings: | |
|
|
||
| The system is flexible to accommodate an arbitrary number of pool ratings without modification to smart contract code. | ||
|
|
||
| Each liquidity pool integrated with the OptyFi Protocol is assigned a pool rating. This rating is currently established by governance vote. However in the future, governance may vote to use an external service \(such as [defiscore.io](www.defiscore.io)\), or subscribe to pool ratings from community [risk analysts](../participants.md#risk-analysts). | ||
| Each liquidity pool integrated with the OptyFi Protocol is assigned a pool rating. This rating is currently established through governance voting. However, in the future, governance voting may result in the use of external services \(such as [defiscore.io](www.defiscore.io)\) or community [risk analysts](../participants.md#risk-analysts) to determine the risk of a pool. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor feedback here to improve clarity. |
||
|
|
||
| Currently, all pools for a given protocol are assigned the same rating, as follows: | ||
|
|
||
| | Protocol | Pool Rating | | ||
| | **Protocol** | **Pool Rating** | | ||
| | :--- | :--- | | ||
| | Aave | T1 | | ||
| | Compound | T1 | | ||
|
|
@@ -29,9 +29,9 @@ Currently, all pools for a given protocol are assigned the same rating, as follo | |
|
|
||
| ## Risk Profiles | ||
|
|
||
| Each strategy is assigned a risk profile based on the ratings of pools involved in the strategy along with the complexity of the strategy. Currently, the following risk profiles are defined: | ||
| Each strategy is assigned a risk profile based on the ratings of the pools involved in the strategy along with the complexity of the strategy. Currently, the following risk profiles are defined: | ||
|
|
||
| | Risk Profile | Description | Pool Ratings | Strategy Complexity | | ||
| | **Risk Profile** | **Description** | **Pool Ratings** | **Strategy Complexity** | | ||
| | :--- | :--- | :--- | :--- | | ||
| | RP0 | Default | N/A | Hold In Vault | | ||
| | RP1 | Basic | T1 | Multi-Step, No Borrow | | ||
|
|
@@ -56,7 +56,7 @@ The limits work as follows: | |
|
|
||
| To better understand the application of these investment limits, take a look at the examples below. | ||
|
|
||
| | Protocol | Protocol Investment Limit Mode | Protocol Max Percent | Pool | Pool Max Percent | Pool Max Amount | | ||
| | **Protocol** | **Protocol Investment Limit Mode** | **Protocol Max Percent** | **Pool** | **Pool Max Percent** | **Pool Max Amount** | | ||
| | :--- | :--- | :--- | :--- | :--- | :--- | | ||
| | Compound | Percent | 500% | cDAI | 100% | N/A | | ||
| | Compound | Percent | 500% | cBTC | Null \(defaults to 500%\) | N/A | | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,11 +2,11 @@ | |
|
|
||
| Yield strategies are the fundamental building block of the OptyFi Protocol and its most compelling innovation. | ||
|
|
||
| Conceptually, yield strategies are generated dynamically based on the structure of DeFi liquidity pools. The building blocks for strategies are strategy steps and strategy sequences. The universe of possible strategy sequences together form a strategy graph. | ||
| Conceptually, yield strategies are generated dynamically based on the structure of existing DeFi liquidity pools. The building blocks for strategies are [strategy steps](strategy-composition.md#strategy-step) and [strategy sequences](strategy-composition.md#strategy-sequence). Put together, the entirety of strategy sequences form the [strategy graph](strategy-composition.md#strategy-graph). | ||
|
|
||
| ## Strategy Step | ||
|
|
||
| A strategy step is the fundamental building block of a strategy. A strategy step may consist of a deposit step or a borrow step. | ||
| A strategy step is a fundamental building block of a strategy. A strategy step can be categorized as a deposit step or a borrow step. | ||
|
|
||
| ### Deposit Step | ||
|
|
||
|
|
@@ -22,19 +22,18 @@ Depositing an underlying token into a pool as collateral and then borrowing an u | |
|
|
||
| ## Strategy Sequence | ||
|
|
||
| A strategy sequence is comprised of multiple strategy steps. | ||
| A strategy sequence is composed of multiple strategy steps. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same meaning, leave original as 'composed' is used more frequently.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed to comprises as the use of 'comprised of' is incorrect. |
||
|
|
||
| If a token is deposited into a pool and the LP token you receive in return can be deposited into a second pool, then you can "string together" two strategy steps to form a two-step strategy sequence. | ||
|
|
||
|  | ||
|
|
||
| This process can be generalized into n-steps based on the condition `outputToken(step[n-1]) = inputToken(step[n])`. | ||
|
|
||
| In today's DeFi reality, strategy sequences are usually limited to a maximum of two deposit steps or two deposit steps with a borrow step. | ||
| In today's DeFi reality, strategy sequences are usually limited to two deposit steps or two deposit steps with a borrow step. | ||
|
|
||
| ## Strategy Graph | ||
|
|
||
| The universe of possible strategy sequences forms a directed \(possibly cyclic\) graph which we refer to as the Strategy Graph. The nodes of the Strategy Graph represent liquidity pools and inbound edges represent deposits into those liquidity pools. | ||
|
|
||
| OptyFi's Strategy Graph is determined by liquidity pools integrated with the Protocol. Integrating a new liquidity pool to the Protocol creates a new node which potentially generates many more possible strategies. | ||
| The entirety of possible strategy sequences form a directed \(possibly cyclic\) graph which we refer to as the Strategy Graph. The nodes of the Strategy Graph represent liquidity pools and the inbound edges represent deposits into those liquidity pools. | ||
|
|
||
| OptyFi's Strategy Graph is determined by liquidity pools integrated within the Protocol. Integrating a new liquidity pool to the Protocol creates therefore updates the Strategy Graph, potentially generating multiple new strategies. | ||
|
Kilniv marked this conversation as resolved.
Outdated
|
||
Uh oh!
There was an error while loading. Please reload this page.