-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add offchain worker to monitor loans which should be liquidate or warned. #151
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vivekvpandya
requested review from
dzmitry-lahoda,
andor0 and
hussein-aitlahcen
October 6, 2021 09:34
dzmitry-lahoda
previously approved these changes
Oct 6, 2021
hussein-aitlahcen
previously approved these changes
Oct 6, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests, nice 🚀
andor0
dismissed stale reviews from hussein-aitlahcen and dzmitry-lahoda
via
October 6, 2021 09:44
c8baffe
andor0
approved these changes
Oct 6, 2021
hussein-aitlahcen
approved these changes
Oct 6, 2021
KaiserKarel
pushed a commit
that referenced
this pull request
Oct 7, 2021
…ned. (#151) * Add offchain worker to monitor loans which should be liquidate or warned. * Update benchmarks of pallet-lending Co-authored-by: Andrey Orlov <[email protected]>
KaiserKarel
added a commit
that referenced
this pull request
Oct 12, 2021
* POC of pallet-assets * use Assets in vault::Config * implement ReservableCurrency make event a placeholder * define and implement MultiCurrency trait clippy * use Assets as Currency implementation * add extrinsics to pallet-asset * weights file weights working weights added * implement common orml traits * implement MultiReservableCurrency * Use WeightInfo in extrinsics * fix merge * Update benchmarks of pallet-lending (#148) * Add offchain worker to monitor loans which should be liquidate or warned. (#151) * Add offchain worker to monitor loans which should be liquidate or warned. * Update benchmarks of pallet-lending Co-authored-by: Andrey Orlov <[email protected]> * light refactoring (#152) * simplify traits Prefer the usage of by-value for value parameters such as Balance and the usage of `DispatchResult` instead of custom error. * use try_mutate for mutating the auction order * move `WrappingNext` to composable traits * update gitignore, some tools are not supporting **/ patterns * lending borrow/repay fixes & isolation test & more vault test (#156) * add a note about how we are handling vault<->market * use the more explicit type aliases * `into_sub_account` require >8bytes AccountId * fix borrow_for_collateral, express itself as borrow asset unit instead of $ * introduce vault stock_dilution_rate tests * documentation & more inline pragmas * better error name When we hit a MustLiquidate while borrowing, this probably mean that the market is being closed and waiting for repays to happen. * refactor * avoid setting minimum deposit to let proptest pass with low values * fix borrow/repay tests and introduce market isolation test * auction and lending test fixes (#153) Signed-off-by: dzmitry-lahoda <[email protected]> * Pass InterestRateModel as input to create_new_market() extrinsic. Co-authored-by: Filip <[email protected]> Co-authored-by: andor0 <[email protected]> Co-authored-by: Vivek Pandya <[email protected]> Co-authored-by: Hussein Ait-Lahcen <[email protected]> Co-authored-by: Dzmitry Lahoda <[email protected]>
dzmitry-lahoda
added a commit
that referenced
this pull request
Oct 20, 2021
* POC of pallet-assets * use Assets in vault::Config * implement ReservableCurrency make event a placeholder * define and implement MultiCurrency trait clippy * use Assets as Currency implementation * add extrinsics to pallet-asset * weights file weights working weights added * implement common orml traits * implement MultiReservableCurrency * Use WeightInfo in extrinsics * fix merge * Update benchmarks of pallet-lending (#148) * Add offchain worker to monitor loans which should be liquidate or warned. (#151) * Add offchain worker to monitor loans which should be liquidate or warned. * Update benchmarks of pallet-lending Co-authored-by: Andrey Orlov <[email protected]> * light refactoring (#152) * simplify traits Prefer the usage of by-value for value parameters such as Balance and the usage of `DispatchResult` instead of custom error. * use try_mutate for mutating the auction order * move `WrappingNext` to composable traits * update gitignore, some tools are not supporting **/ patterns * lending borrow/repay fixes & isolation test & more vault test (#156) * add a note about how we are handling vault<->market * use the more explicit type aliases * `into_sub_account` require >8bytes AccountId * fix borrow_for_collateral, express itself as borrow asset unit instead of $ * introduce vault stock_dilution_rate tests * documentation & more inline pragmas * better error name When we hit a MustLiquidate while borrowing, this probably mean that the market is being closed and waiting for repays to happen. * refactor * avoid setting minimum deposit to let proptest pass with low values * fix borrow/repay tests and introduce market isolation test * auction and lending test fixes (#153) Signed-off-by: dzmitry-lahoda <[email protected]> * Pass InterestRateModel as input to create_new_market() extrinsic. Co-authored-by: Filip <[email protected]> Co-authored-by: andor0 <[email protected]> Co-authored-by: Vivek Pandya <[email protected]> Co-authored-by: Hussein Ait-Lahcen <[email protected]> Co-authored-by: Dzmitry Lahoda <[email protected]>
dzmitry-lahoda
added a commit
that referenced
this pull request
Oct 21, 2021
* POC of pallet-assets * use Assets in vault::Config * implement ReservableCurrency make event a placeholder * define and implement MultiCurrency trait clippy * use Assets as Currency implementation * add extrinsics to pallet-asset * weights file weights working weights added * implement common orml traits * implement MultiReservableCurrency * Use WeightInfo in extrinsics * fix merge * Update benchmarks of pallet-lending (#148) * Add offchain worker to monitor loans which should be liquidate or warned. (#151) * Add offchain worker to monitor loans which should be liquidate or warned. * Update benchmarks of pallet-lending Co-authored-by: Andrey Orlov <[email protected]> * light refactoring (#152) * simplify traits Prefer the usage of by-value for value parameters such as Balance and the usage of `DispatchResult` instead of custom error. * use try_mutate for mutating the auction order * move `WrappingNext` to composable traits * update gitignore, some tools are not supporting **/ patterns * lending borrow/repay fixes & isolation test & more vault test (#156) * add a note about how we are handling vault<->market * use the more explicit type aliases * `into_sub_account` require >8bytes AccountId * fix borrow_for_collateral, express itself as borrow asset unit instead of $ * introduce vault stock_dilution_rate tests * documentation & more inline pragmas * better error name When we hit a MustLiquidate while borrowing, this probably mean that the market is being closed and waiting for repays to happen. * refactor * avoid setting minimum deposit to let proptest pass with low values * fix borrow/repay tests and introduce market isolation test * auction and lending test fixes (#153) Signed-off-by: dzmitry-lahoda <[email protected]> * Pass InterestRateModel as input to create_new_market() extrinsic. Co-authored-by: Filip <[email protected]> Co-authored-by: andor0 <[email protected]> Co-authored-by: Vivek Pandya <[email protected]> Co-authored-by: Hussein Ait-Lahcen <[email protected]> Co-authored-by: Dzmitry Lahoda <[email protected]> Signed-off-by: dzmitry-lahoda <[email protected]>
dzmitry-lahoda
added a commit
that referenced
this pull request
Oct 21, 2021
* Refactoring of pallet-lending (#178) * Create SECURITY.md (#111) (#174) * Create SECURITY.md Set up for security protocols. * More guidelines * rewards section Co-authored-by: Filip <[email protected]> Update setup-auto-release Updating github workflow Implement auto update feature using two approaches Implement auto update feature using two approaches Implement auto update feature using two approaches Co-authored-by: Douglas Kuhn <[email protected]> * Refactoring of pallet-lending (#182) * - Implement dynamic PID controller based interest rate model. See details at https://www.delphidigital.io/reports/dynamic-interest-rate-model-based-on-control-theory/ - Add InterestRate trait which provides get_borrow_rate() method. * start refactor and inline docs (#169) * start refactor and inline docs * added more inline docs * more docs * clean * quick clean * fmt * fmt * polkadot-v0.9.11 (#187) * fix wasm build (#192) * fix wasm build * pin orml to rev * Update off-chain worker of pallet-lending (#190) * remove request id (#194) * test fixes (#195) * Fix release benchmark feature build. * Add cumulus-ping in Runtime (#197) * enable CI on develop branch (#199) * Implement DoubleExponent interest rate model. (#185) * Copy and paste code of cumulus-ping pallet (#198) * Remove unused dependencies (#203) * pallet-assets (#112) * POC of pallet-assets * use Assets in vault::Config * implement ReservableCurrency make event a placeholder * define and implement MultiCurrency trait clippy * use Assets as Currency implementation * add extrinsics to pallet-asset * weights file weights working weights added * implement common orml traits * implement MultiReservableCurrency * Use WeightInfo in extrinsics * fix merge * Update benchmarks of pallet-lending (#148) * Add offchain worker to monitor loans which should be liquidate or warned. (#151) * Add offchain worker to monitor loans which should be liquidate or warned. * Update benchmarks of pallet-lending Co-authored-by: Andrey Orlov <[email protected]> * light refactoring (#152) * simplify traits Prefer the usage of by-value for value parameters such as Balance and the usage of `DispatchResult` instead of custom error. * use try_mutate for mutating the auction order * move `WrappingNext` to composable traits * update gitignore, some tools are not supporting **/ patterns * lending borrow/repay fixes & isolation test & more vault test (#156) * add a note about how we are handling vault<->market * use the more explicit type aliases * `into_sub_account` require >8bytes AccountId * fix borrow_for_collateral, express itself as borrow asset unit instead of $ * introduce vault stock_dilution_rate tests * documentation & more inline pragmas * better error name When we hit a MustLiquidate while borrowing, this probably mean that the market is being closed and waiting for repays to happen. * refactor * avoid setting minimum deposit to let proptest pass with low values * fix borrow/repay tests and introduce market isolation test * auction and lending test fixes (#153) Signed-off-by: dzmitry-lahoda <[email protected]> * Pass InterestRateModel as input to create_new_market() extrinsic. Co-authored-by: Filip <[email protected]> Co-authored-by: andor0 <[email protected]> Co-authored-by: Vivek Pandya <[email protected]> Co-authored-by: Hussein Ait-Lahcen <[email protected]> Co-authored-by: Dzmitry Lahoda <[email protected]> Signed-off-by: dzmitry-lahoda <[email protected]> * privileged accounts (liquidation) (#164) * Refactoring of pallet-lending (#178) * Create SECURITY.md (#111) (#174) * Create SECURITY.md Set up for security protocols. * More guidelines * rewards section Co-authored-by: Filip <[email protected]> Update setup-auto-release Updating github workflow Implement auto update feature using two approaches Implement auto update feature using two approaches Implement auto update feature using two approaches Co-authored-by: Douglas Kuhn <[email protected]> * better naming, comments & documentation * introduce account privilege traits, allowing inspection + mutation * introduce pallet-privilege which implements all the privilege traits * add privilege pallet event triggers * add privilege pallet readme * refactor promote/revoke behavior to be noop over privileged/nonprivileged user Co-authored-by: andor0 <[email protected]> Co-authored-by: Adedayo Akinpelu <[email protected]> Co-authored-by: Douglas Kuhn <[email protected]> # Conflicts: # Cargo.lock # frame/lending/src/lib.rs Signed-off-by: dzmitry-lahoda <[email protected]> * dex docs, groups for lending, api (#183) Signed-off-by: dzmitry-lahoda <[email protected]> # Conflicts: # Cargo.lock # frame/composable-traits/Cargo.toml # frame/composable-traits/src/lending.rs # frame/dutch-auction/src/lib.rs # frame/lending/src/lib.rs # frame/oracle/src/lib.rs * smallest possible unit for currencies + refactor + lending fixes / tests more clear (#186) * make sure we allow liquidation if the source account has zero funds after * introduce PriceableAsset capability * refactor lending pallet + oracle mock to use smallest unit of an asset * fix merge conflicts, make tests more clear * simpler priceable type & upgrade runtime currency to handle it * simplify and better documentation * cleanup unused constraints # Conflicts: # frame/composable-traits/src/currency.rs # frame/composable-traits/src/lending.rs # frame/lending/src/lib.rs # frame/lending/src/tests.rs # frame/liquidations/src/lib.rs # frame/oracle/src/lib.rs # runtime/primitives/src/currency.rs Signed-off-by: dzmitry-lahoda <[email protected]> * Vault-index-configurable (#200) * make VaultId an associated type * Unmanle doc comment # Conflicts: # frame/vault/src/lib.rs Signed-off-by: dzmitry-lahoda <[email protected]> * rent implementation (#189) * implement rent and tombstoning * clean up claim_surcharge Also ensure that tombstoned vaults have funds returned by strategies. * handle deletion_reward * add delete_tombstoned functionality * add add_surcharge * fmt and fix doc comment Signed-off-by: dzmitry-lahoda <[email protected]> * Use NativeCurrency associated type instead of querying for native id (#202) # Conflicts: # Cargo.lock # frame/vault/Cargo.toml Signed-off-by: dzmitry-lahoda <[email protected]> * fixed lending tests and run cargo fmt Signed-off-by: dzmitry-lahoda <[email protected]> * fixes from fmt and clippy Signed-off-by: dzmitry-lahoda <[email protected]> * fixes to benches Signed-off-by: dzmitry-lahoda <[email protected]> Co-authored-by: andor0 <[email protected]> Co-authored-by: Adedayo Akinpelu <[email protected]> Co-authored-by: Douglas Kuhn <[email protected]> Co-authored-by: Vivek Pandya <[email protected]> Co-authored-by: JesseAbram <[email protected]> Co-authored-by: Seun Lanlege <[email protected]> Co-authored-by: Karel L. Kubat <[email protected]> Co-authored-by: Filip <[email protected]> Co-authored-by: Hussein Ait-Lahcen <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.