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

aUSD total issuance cross check, bad debt monitor #10

Open
2 tasks
lrcnz opened this issue Sep 7, 2022 · 0 comments
Open
2 tasks

aUSD total issuance cross check, bad debt monitor #10

lrcnz opened this issue Sep 7, 2022 · 0 comments
Assignees

Comments

@lrcnz
Copy link

lrcnz commented Sep 7, 2022

  • Create script to return following params for Acala, Karura and Mandala
  1. aUSD total issuance: aUSD 发行总量
    
2. collateralised loan: 所有有抵押支撑的债务(loans里的total position 和 cdpEngine中的 debit exchange rate 计算而出)
  2. bad debt: 坏账池(cdpTreasury.debit_pool)
  3. special mint: 特殊发行 (Acala上发行了 110w aUSD 用于跨链的quota, Karura上发行了 45w KUSD 用于跨链的quota, Karura 上还发行了IADS V0 的 10w KUSD)
  • Create monitor (or 2 monitors) in Datadog - Laminar, 1 for each of the caeses below, to run script every 10 mins to get the above params, logics and threshold should reside in datadog for ease of maintenance.
    

 判断两种情况:

    1.aUSD 发行总量 - 所有有抵押支撑的债务 - 坏账池 后,不等于 已知特殊发行的总量(这个dead code, 后续有其他的特殊发行的量,就更新这里的数值) 因为计算可能有偏差, 不等于的判断可以是 偏差超过 0.1%。 这种情况是系统不知在哪里又有 没有计入到坏账中, 且是无抵押支持的债务。
(其实这次error mint的aUSD 是被计入坏账池的, 所以当前应该不会触发这个判断条件)

    Message: @slack-watchdog, @wangjj9219 @xlc aUSD total issuance deviate from calculation by over 0.1%, diff 13k aUSD
    Notification: slack, sms

2.坏账池数额超过一定比例 (Acala 上现在坏账池占总发行量的比例很高, 可是暂时关掉Acala的,等recovery后,我们再定一个百分比), karura之前已经产生了很多坏账,当前占比已经是 0.3206, 币价下跌, 还会继续增高, 可以把报警占比定在 0.4, 就是坏账占比达到 40% 时会警报.
Message: @slack-watchdog @wangjj9219 @xlc Bad debt ratio over 40%, amount 123k aUSD
Notification: slack, sms

Logic by @wangjj9219

Examples:
Response param in json
API for health check
Webhook for setting up SMS - could be useful for auto call gateway too

@lrcnz lrcnz changed the title aUSD total issuance cross check aUSD total issuance cross check, bad debt monitor Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants