Popcorn-Limited / vaultcraft-sdk

0 stars 2 forks source link

VaultFactory #36

Closed 0xruhum closed 10 months ago

0xruhum commented 11 months ago

The VaultFactory class should provide functions to deploy vaults and strategies.

getStrategyParams - is expected to use mainly by use to show strategy inputs and their resolved values. The params part of the object simply describes the input values. Defaults are fetched values for the asset input by the user. These should be used as inputs in 99% of cases but in some specific scenarios these might want to be changed by the user. (The resolver failed or its a configuration option that can be freely adjusted (for example minTradeAmounts)

Besides that we have 4 different functions to deploy strategies or vaults. The recommended functions to use are createVaultByKey (or createStrategyByKey) which takes in a strategy key and than resolves all necessary inputs itself. If a user wants to have full control we provide createVault and createStrategy in which the user needs to provide all inputs themselfs.

Currently integration tests are failing. I must have done smth wrong by moving files around in folders. We would need to iron that out.

Additionally im wondering about the function naming and if its clear enough. Last but not least i was wondering if we should create a separate function for deploying vaults with a pre deployed strategy and decouple it from the createVault function (which currently handles both scenarios)