centrifuge / pools-subql

Subquery for Pools on Centrifuge
MIT License
1 stars 4 forks source link

feat: track future cashflows per asset #219

Open filo87 opened 3 days ago

filo87 commented 3 days ago

Fixes #196 Fixes #220

filo87 commented 3 days ago

@hieronx this first implementation covers only the creation of cashflows, but for further optimization I need some more information...

  1. How often do the cashflows change between Events?
  2. Do some cashflow entities get deleted over time?
  3. Is it correct to assume that DebtTransfers do not modify the cashflows?

Thx ;)

hieronx commented 3 days ago

How often do the cashflows change between Events?

Between Events they shouldn't change.

Do some cashflow entities get deleted over time?

Yes. If you change maturity to an earlier date, the older cashflows would be deleted. Also if the interest rate changes, all existing cashflows change their amounts. I would suggest anytime you query the cashflows for an asset on an event, just delete the existing ones and create new ones.

Is it correct to assume that DebtTransfers do not modify the cashflows?

No that is not true, a repayment/borrow through a debt transfer also modifies the cashflows.