-
Notifications
You must be signed in to change notification settings - Fork 170
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
feat: add inspector queries #2085
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2085 +/- ##
==========================================
- Coverage 75.38% 74.89% -0.49%
==========================================
Files 100 127 +27
Lines 8025 9745 +1720
==========================================
+ Hits 6050 7299 +1249
- Misses 1589 1963 +374
- Partials 386 483 +97
|
This reverts commit 402c325.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proto review only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few more comments. Would be good to add a bit more tests.
Co-authored-by: Robert Zaremba <robert@zaremba.ch>
See updated PR description for examples of new CLI and web usage |
for _, account := range borrowers { | ||
ok := account.Analysis.Borrowed > req.Borrowed | ||
ok = ok && account.Analysis.Value > req.Collateral | ||
ok = ok && account.Analysis.Borrowed/account.Analysis.Liquidation > req.Danger |
Check notice
Code scanning / CodeQL
Floating point arithmetic
ok := account.Analysis.Borrowed > req.Borrowed | ||
ok = ok && account.Analysis.Value > req.Collateral | ||
ok = ok && account.Analysis.Borrowed/account.Analysis.Liquidation > req.Danger | ||
ok = ok && account.Analysis.Borrowed/account.Analysis.Value > req.Ltv |
Check notice
Code scanning / CodeQL
Floating point arithmetic
} | ||
// Truncate the float at a certain precision (can be negative) | ||
x := math.Pow(10, float64(precision)) | ||
return float64(int(n*x)) / x |
Check notice
Code scanning / CodeQL
Floating point arithmetic
} | ||
// Truncate the float at a certain precision (can be negative) | ||
x := math.Pow(10, float64(precision)) | ||
return float64(int(n*x)) / x |
Check notice
Code scanning / CodeQL
Floating point arithmetic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
per-approving given the 2 remaining comments.
Contains a query that combines the risk data query as specified by risk team, and the inspector query which allows a user to filter all active borrower accounts.
umeed query leverage inspect [symbol] [borrowed] [collateral [danger] [ltv]
Example of web usage:
Example of new CLI usage:
(show all borroweds with
>$100k USD borrowed value
and>0.7 LTV