Commit Graph

4 Commits

Author SHA1 Message Date
Derrick Lee
ded692d2f4
Add savings strategy (#1290)
* Add basic savings strategy

Supports ukava

* Use clearer error message for ErrInvalidVaultStrategy

* Add invariants

* Separate specific vault/all vaults query, update depositor inconsistencies

* Update swagger

* Use single bkava AllowedVault for all bkava variants

* Do not use allowedVault.Denom for value

* Fix vault balance query

* Update query to list bkava vaults

* Add vaults query doc

* Update grpc query test with no supply

* Add earn hooks

* Handle errors

* Update outdated doc comments, make getAllowedVault_Raw private

* Fix outdated comments, lints

* Fix comment maths

* Use AccAddressFromBech32 to validate message addresses
2022-09-12 10:50:35 -07:00
Derrick Lee
82e2f26e14
Add Earn grpc query service and cli query commands (#1279)
* Add query methods

* Add TotalDeposited rpc query

* All accounts and all denoms query wip

* Add query deposits

* Remove IsDenomSupported strategy method

This is not necessary and is already set in params allowed vaults

* Add Vaults, TotalDeposited queries

* Deposits query tests and fixes

* proto lints

* Add earn swagger docs

* Add cli query cmds

* Update init-new-chain.sh with usdx strategy and funds

* Add denom url query path for vaults

* Return a list of coins for each depositor instead of multiple deposit entries
2022-07-28 09:50:59 -07:00
Derrick Lee
88d4868316
Implement Hard strategy for Earn vaults (#1278)
* Simplify strategies to lend and savings

* Add hard and savings keepers

* Add ctx to strategy interface, fill in lend strategy

* Rename lend strategy to hard

* Fix hard deposit query, fix withdraw bank send

* Fix misleading borrow instead of withdraw for hard

* Remove liquidateall strategy method

* Withdraw tests

* Add hard gs to testutil suite

* Update withdraw tests with working hard strategy, clean strategy interface methods

* Check allowed denom for strategy

* Update GetVaultTotalValue doc note

* Update error wrap message for unsupported denom

* Remove unnecessary viewvault keeper

* Withdraw amount from account value, not supplied value

* Test value > supplied withdraw

* Use dec when dividing for withdrawAmountPercent

* Use the correct store prefix for vault shares

* Update swap references to earn

* Simplify vault shares, use a single share for all coins per address
2022-07-28 09:39:57 -07:00
Derrick Lee
ae181604ff
Add basic Earn module vault deposit/withdraw (#1277)
* Add basic earn types and interfaces

* Add VaultStrategy type

* Update params with allowedVaults, deposit/withdraw msgs

* Fill in Deposit method, add keeper methods

* Add testutil, params, codec

* Add withdraw

* emit vault events

* Implement vault viewer methods

* Update doc comments, strategies

* Add earn cli query/tx commands

* Add successfull balance withdraw tests

* Add ukava vault to dev genesis

* Add vault keeper method doc comments

* Update stablecoin strategy to only accept usdx

* Vault state tests

* VaultTotalSupplied tests

* msg server test
2022-07-20 16:14:43 -07:00