delvtech / hyperdrive

An automated market maker for fixed and variable yield with on-demand terms.
Apache License 2.0
27 stars 3 forks source link

design choices #12

Closed wakamex closed 1 year ago

wakamex commented 1 year ago

let's go around the room and say how we feel

Hyperdrive related docs so far:

  1. Jonny original
  2. YieldSpace with Yield Bearing Vaults (yield.is bros)
  3. map out positions (Mihai Oct16-Nov2, 4352 words)
  4. Quick Analysis of Hyperdrive Lending (Violet Oct31)
  5. user strats, plain english examples of actions you can do in v1 and v2 (Mihai+Mazy Oct31-Nov2, 2233 words)
  6. Principia Math (Alex+Jonny Oct24-Nov4)
  7. Potential hyperdrive bug classes (Violet Nov4)
  8. a book, trying to describe everything in words and numbers (Mihai Nov8, 2573 words)
  9. Element preread (Jonny Nov9-10)
  10. Hyperdrive Sandwich Attack Fix (Jonny Dec 11-20)
  11. technical appendix (Feb 1)
  12. User Guide (Feb 1)
  13. docs
  14. Hyperdrive LP Withdrawals - WIP
  15. Hyperdrive: How it works - unfinished, user for announcement
  16. Hypderive Explainer of 4 primitives (Alex Feb 21)

Margin option A: don't provide margin, make every trade put up full collateral option B: allow built-in "natural" margin from trader putting up only max loss option C: create separate lending market with its own rate current status: going with

LP safety: working to avoid obvious rugs that's why buffers were introduced to limit what can be withdrawn. mihai's view: yet to fully grok buffers, think we can maintain LP safety without them. or maybe something similar, that doesn't reduce trader optionality. also buffers destroy netting, which is my starting point.

LP profitability: unlike LP safety, this looks at their average return over time. doesn't include rugs or instantaneous arbitrage. losing money over time, stochastically (some of the time) is somewhat to be expected from a passive liquidity provider. we can work to minimize this, but it's an area of ongoing active research in the space. mihai feels this shouldn't be a priority for a v1, rather chipped away at over time

Netting: Option A: force every trade to net out with opposite side. doing so would reduce trader optionality, as they can't exit until another matching trade is found for them. Option B: allow netting only when it happens naturally, but structuring accounting to maximize this likelihood. when it doesn't happen, the other side of the trade is the LP, as normal. Option B: no netting. netting is voodoo. current status: going with option B, as it seems Mihai and Alex both think this is quite doable. downsides exist more with Option A, which no one was proposing. mihai feels it can exist. it's his starting point for analysis in the many documents written up so far. but apparently that doesn't count as describing it. needs simulation output to do so more rigorously. words written so far: 9158, see docs #3, 5, and 8 above.

Bootstrapping: how do you initialize a pool? Option A: same as element v1, through external parameter Option B: start everything at 0, allow initial trades to bootstrap pool from scratch mihai feels option B is doable, but needs more analysis to prove it. doesn't need to be in hyperdrive v1.

Rate directionality: Option A: market can be net long only, rates can't increase from starting point Option B: market can be net long or short, aiming for symmetry, rates can move in either direction Option C: market be be net short only, rates can't increase from starting point current status: aiming for option B mihai feels Maker's needs may allow us to ship option C with lower complexity, while working on option B (which we'll still want for the more general case). is that useful, or just adds unnecessary complication to our shipping plan?

Riskier yield sources: What do we need to support this? doesn't yieldspace v2 naturally solve this, by allowing share price to go down? do we need to support negative rates?

Trade types: cross-pool long/short: long StEth and short rEth for example cross-token trades: long ETH and short USDC for example synthetic futures

=== SHIPPING PLAN === v1 LP safety (no rugs) margin option B: natural margin netting option B: natural netting bootstrapping option B: start everything at 0 rate directionality option B: market can be net long or short v2 LP profitability margin option C: separate lending (unlocks new trade types) riskier yield sources more trade types v3 vaults and trading strats (RL helps here) even more trade types

wakamex commented 1 year ago

added

  1. technical appendix (Feb 1)
  2. User Guide (Feb 1)
  3. docs
wakamex commented 1 year ago

added

  1. Hyperdrive LP Withdrawals - WIP
wakamex commented 1 year ago

added

  1. Hyperdrive: How it works - unfinished, user for announcement
  2. Hypderive Explainer of 4 primitives (Alex Feb 21)