porter-finance / v1-core

⛰️ Smart contracts powering the Porter protocol.
https://porter.finance
GNU Affero General Public License v3.0
4 stars 3 forks source link

Feature request to enable fully trustless credit default insurance products #324

Open Walodja1987 opened 2 years ago

Walodja1987 commented 2 years ago

Dear Porter Finance team,

We at DIVA Protocol are exploring launching credit default insurance products using Porter Finance protocol as a trustless on-chain oracle for settlement. More precisely, we would likey to query the amountUnpaid from the contract prevailing at the expiration time of the credit default insurance product.

After talking to @Namaskar-1F64F and getting a better understanding of how Porter Finance Protocol works, I understand that currently, the contract is not storing that value and repayments are possible even following the grace period end. This would imply that in order for us to use the amountUnpaid as settlement value for our products, we would need to call the getter function that returns the amountUnpaid shortly after expiration. If that doesn't happen, there is a risk that the amountUnclaimed may change which is not ideal.

I'd like to ask whether it would be somehow possible to store the amountUnpaid at grace period end time to enable a trustless oracle solution for our product.

Below graphic outlines how such a trustless oracle setup would work: image