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

RtAPI - PV of a Loan #942

Closed
mustermeiszer opened this issue Sep 2, 2022 · 5 comments
Closed

RtAPI - PV of a Loan #942

mustermeiszer opened this issue Sep 2, 2022 · 5 comments
Labels
crcl-runtime Circle runtime related. I8-enhancement An additional feature. P2-nice-to-have Issue is worth doing. Q1-easy Can be done by primarily duplicating and adapting code.

Comments

@mustermeiszer
Copy link
Collaborator

mustermeiszer commented Sep 2, 2022

Allow to retrieve the PV of a loan.
It is important that the now defining the value is optionally providable, to get a glimbs into the future. Past should be forbidden, as this is messy.

@mustermeiszer mustermeiszer added crcl-runtime Circle runtime related. Q1-easy Can be done by primarily duplicating and adapting code. P2-nice-to-have Issue is worth doing. I8-enhancement An additional feature. labels Sep 2, 2022
@mustermeiszer mustermeiszer changed the title PV of a Loan RtAPI - PV of a Loan Sep 5, 2022
@gruberb gruberb self-assigned this Dec 18, 2022
@gruberb gruberb removed their assignment Apr 20, 2023
@lemunozm
Copy link
Contributor

lemunozm commented Jan 8, 2024

@mustermeiszer
Copy link
Collaborator Author

@lemunozm but this is the lastly computed value, we would want the latest value available, or is the loans logic updating all loans when constructing the portfolio?

@lemunozm
Copy link
Contributor

lemunozm commented Jan 9, 2024

Yes, the current line above returns the present value computed just at the moment when it's retrieved. If you want the present value at the moment when the portfolio was updated, you can fetch then the PortfolioValuation type from the storage, which holds the values for all loans: https://github.com/centrifuge/centrifuge-chain/blob/main/pallets/loans/src/lib.rs#L1020

@mustermeiszer
Copy link
Collaborator Author

The API should give the PV of a loan at now() with this API. If possible.

@lemunozm
Copy link
Contributor

lemunozm commented Jan 9, 2024

Then, it's done in the first shared line, where the present value is computed with now()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crcl-runtime Circle runtime related. I8-enhancement An additional feature. P2-nice-to-have Issue is worth doing. Q1-easy Can be done by primarily duplicating and adapting code.
Projects
None yet
Development

No branches or pull requests

3 participants