Request for help to understand on chain data

Hi everyone,
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:

  1. Getting a list of ilk types by calling ilkRegistry.list [ETH-A, ETH-B, BAT-A]
  2. 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.
  3. Sum the generated Dai for all ilks.

At time of writing, the sum in step three is returning 1,414,371,853.86 while vat.dai is returning 1,420,115,977.85.

What variables am I missing?

Thanks!

1 Like

If I’m not mistaken, you are missing the Sin of the vow which you can get on Etherscan. Maybe, the total vice of the system is more accurate (same number currently).

1 Like

Thank you, Seb. Thats exactly what I was missing. Can you explain what vice is? In particular, why is there “unbacked dai”?

The main reason currently is to print DAI and buy&burn MKR (edit: actually I might be wrong, don’t have time to check). It is not unbacked in the sense that there is, overall, enough assets that back those issued DAI. But those DAI are not assigned to one vault in particular.

1 Like