I am trying to learn as much about how Maker works by exploring on chain data.
Currently I am struggling to understand how the total debt of the system is calculated. So far I am:
- Getting a list of ilk types by calling
[ETH-A, ETH-B, BAT-A]
- For each ilk type, retrieving the ilk with
val.ilks(ilkType) and calculating the amount of generated dai from that ilk with ilk.art * ilk.rate. The result of this seems to be correct when compared to daistats.com.
- Sum the generated Dai for all ilks.
At time of writing, the sum in step three is returning
vat.dai is returning
What variables am I missing?