Recreate scenario 1 using fork testing setup.#128
Recreate scenario 1 using fork testing setup.#128RZhang05 merged 37 commits intofeature/forked-simulationsfrom
Conversation
|
|
||
| // Expected values from Google sheet calculations | ||
| let expectedYieldTokenValues: {UFix64: UFix64} = { | ||
| 0.5: 307.69230769, |
There was a problem hiding this comment.
The expectedYieldTokenValues are the debt notional (at target health factor) in the unit of account i.e MOET/USD: expectedYieldTokenValue = expectedDebt = fundingAmount * flowPrice * collateralFactor / targetHealthFactor. It doesn't not account for the fees associated with swapping (nor price impact) MOET to yieldToken on the DEX when we create the yieldVault (ie. yieldToMoetSwapper in the createStrategy), as a consequence: expectedYieldTokenValue < expectedDebt.The bridge fees are in FLOW and covered by the protocol.
1b21dd0 to
e7a6683
Compare
| // helps match expected values by increasing the amount of tokens we would get | ||
| // normally amount of tokens we would get is true_price * (1 - fee_rate) | ||
| // now we get true_price / (1 - fee_rate) * (1 - fee_rate) = true_price | ||
| access(all) let fee3000Premium: UFix64 = 1.0 / (1.0-0.003) | ||
| access(all) let fee100Premium: UFix64 = 1.0 / (1.0 - 0.0001) |
There was a problem hiding this comment.
👌 This makes sense to me, we should be able to get our numbers much, much closer like this.
The only thing we need to be mindful of is that this adjustment and swaps only happen in a single direction. Conceptually, I would think that this should be the case (why swap both ways & pay extra fees if you never needed to swap the tokens in the first place), but just wanted to flag this if we start to see any irreducible discrepancies.
The other option is that we could just tighten our assertions by calculating fee adjusted values to test against.
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
…YieldVaults into raymond/forked-scen1
Closes: #122
Depends on: #151
Description
Output
For contributor use:
masterbranchFiles changedin the Github PR explorer