Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Perp Leverage Strategy STIP #15

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

richardliang
Copy link
Contributor

No description provided.

| ALM/CLM Strategy Extension Feature | Perp Strategy Extension Feature |
|----------------------------------- |-------------------------------- |
|Methodology - Flexible leverage is a superset of most of the leverage token methodologies. Supports the fixed ratio (FTX), and Binance methodologies|Methodology - Can use the same methodology as FLI or another by toggling parameters on the smart contract|
|Rebalance execution - Use TWAP and oracle to limit slippage|Rebalance execution - Similarly, we need TWAP and oracle to limit slippage on rebalances. Need to keep track of what the virtual addresses and spot token addresses are.|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oracle could be tricky since definitionally we would expect the spot price of the Perp to differ from the spot price of the underlying

STIPS/STIP-007.md Outdated Show resolved Hide resolved
- Allow keepers to rebalance the perp leverage token via the native exchange
- No need for an external DEX
- No need for a viewer contract
- Use Chainlink oracles to price slippage and determine trade size
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is biggest open question for me since we expect there to be some delta between spot and perp. How big can we expect that delta to get?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well we can parameterize it still. On mainnet we set it to be 2%. Hopefully perps do their job and closely mirror index price

STIPS/STIP-007.md Outdated Show resolved Hide resolved
A keeper wants to rebalance the Perp token which last rebalanced a day ago so calls shouldRebalance on the strategy contract directly
- The keeper calls rebalance on the PerpStrategyExtension
- The exchange's max trade size is grabbed from storage
- The current leverage ratio is grabbed from the Perp Module
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Historically haven't had the module return a leverage ratio, this assumes we have access to an oracle at the protocol level which I think I'd prefer not to make a dependency

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't a perp helper return this? Mainly meant the leverage ratio (or account leverage or collateral ratio) would be returned from Perp V2 vs us using oracles to calculate anything

### Comparison between the ALM/CLM Leverage Token Extensions and Perpetual Token Extension
In general, external perpetual protocols simplify the lever and delever flows for rebalances, and many of the previous extension logic can be reused in the perpetuals extension.

| ALM/CLM Strategy Extension Feature | Perp Strategy Extension Feature |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we track what state we usually pull from Compound and AAVE? Would be good to know what we'll need to pull from the PerpModule

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants