FloorDAO / floor-v2

Floor aims to create a fully onchain governance mechanism for sweeping and deploying NFTs to profitable NFT-Fi strategies as well as seeding liquidity for its own NFT-Fi products.
https://floor.xyz
2 stars 0 forks source link

Allow for only WETH yield to be tracked from snapshots #126

Closed tomwade closed 9 months ago

tomwade commented 9 months ago

This will allow for only WETH to be snap-shotted as sweepable value, meaning that our token yield will just continue to compound. This removes the requirement for a {PricingExecutor} to be called during the sweep events as we will only ever have a 1:1 mapping of token to ETH value.

Gas Report:

RegisterSweepTrigger

OLD: | endEpoch              | 679997          | 679997 | 679997 | 679997 | 1       |
NEW: | endEpoch              | 467759          | 467759 | 467759 | 467759 | 1       |

EpochManager.endEpoch

OLD: | endEpoch              | 451             | 123771 | 31556  | 722061 | 7       |
NEW: | endEpoch              | 451             | 94554  | 31556  | 517539 | 7       |

StrategyFactory.snapshot()

OLD: | snapshot               | 9495           | 11252  | 11142  | 12791  | 10      |
NEW: | snapshot               | 75658          | 75658  | 75658  | 75658  | 1       |

Note that this does not include additional gas from a proper Pricing Executor as it's using a Mock in these tests. The snapshot also takes it from n calls to 1, where n is the number of strategies, so it will optimise better over time.