Skip to content
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
merged 2 commits into from
Oct 6, 2021

Conversation

vivekvpandya
Copy link
Contributor

No description provided.

dzmitry-lahoda
dzmitry-lahoda previously approved these changes Oct 6, 2021
Copy link
Contributor

@hussein-aitlahcen hussein-aitlahcen left a 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 andor0 merged commit b5da444 into main Oct 6, 2021
@andor0 andor0 deleted the vivek/main branch October 6, 2021 10:00
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants