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

Loans: add slippage for external pricing #1487

Merged
merged 14 commits into from Aug 16, 2023
Merged

Loans: add slippage for external pricing #1487

merged 14 commits into from Aug 16, 2023

Conversation

lemunozm
Copy link
Contributor

Description

Fixes #1464

Changes and Descriptions

  • Implementation
  • Test fixed and updated with slippage feature
  • IMPORTANT: Fixed bug in runtime API where the present_value didn't taking into account the write off.

@lemunozm lemunozm added Q3-medium Can be done with good experience in the language, but little knowledge of the codebase. I8-enhancement An additional feature. D8-migration Pull request touches storage and needs migration code. labels Aug 10, 2023
@lemunozm lemunozm self-assigned this Aug 10, 2023
@lemunozm lemunozm requested a review from hieronx August 10, 2023 15:46
Copy link
Collaborator

@mustermeiszer mustermeiszer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand the feature request correctly I would request changing PerThing.

pallets/loans/src/entities/pricing/external.rs Outdated Show resolved Hide resolved
pallets/loans/src/entities/pricing/external.rs Outdated Show resolved Hide resolved
@lemunozm
Copy link
Contributor Author

lemunozm commented Aug 11, 2023

Changed to Rate type.

I've left the PerThing associated config type because it will be needed when we change the write_off_percentage type from Rate to PerThing.

Copy link
Collaborator

@mustermeiszer mustermeiszer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks already good. Just a propossal to prevent future migrations. cc @offerijns

pallets/loans/docs/types.md Outdated Show resolved Hide resolved
Signed-off-by: lemunozm <lemunozm@gmail.com>
@lemunozm lemunozm enabled auto-merge (squash) August 11, 2023 22:11
@lemunozm
Copy link
Contributor Author

@mustermeiszer, I think we need your approval to get this merged

@lemunozm lemunozm merged commit 0294561 into main Aug 16, 2023
11 checks passed
@lemunozm lemunozm deleted the loans/slippage branch August 16, 2023 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D8-migration Pull request touches storage and needs migration code. I8-enhancement An additional feature. Q3-medium Can be done with good experience in the language, but little knowledge of the codebase.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loans: Add slippage for settlement_price
3 participants