-
Notifications
You must be signed in to change notification settings - Fork 212
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
Publish Reserve econ data: mint & burn #5753
Conversation
* @property {Amount<'nat'>} mintedRUN total RUN minted to date | ||
* @property {Amount<'nat'>} burnedRUN total RUN burned to date |
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.
let's use Fee
instead of RUN
per #4800
and per
// Metrics naming scheme: nouns are present values; past-participles are accumulative. |
minted
should be second.
"total" helps convey that this is "minted ever" not any other time window.
* @property {Amount<'nat'>} mintedRUN total RUN minted to date | |
* @property {Amount<'nat'>} burnedRUN total RUN burned to date | |
* @property {Amount<'nat'>} totalFeeMinted total Fee minted to date | |
* @property {Amount<'nat'>} totalFeeBurned total Fee burned to date |
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.
Done
let mintedRUN = AmountMath.makeEmpty(runBrand); | ||
let burnedRUN = AmountMath.makeEmpty(runBrand); |
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.
just noting the variable names should continue to match the metric names
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.
done
export const reserveInitialState = emptyRun => ({ | ||
allocations: {}, | ||
shortfallBalance: emptyRun, | ||
burnedRUN: emptyRun, | ||
mintedRUN: emptyRun, | ||
}); |
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.
this is valid only for test-reserve.js
so please keep it there
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.
I hoisted it when the vault test needed it as well. I didn't want the vault test to have to be updated if we add more to the record. I didn't see a better place to put it, and metrics.js
is at least under test
.
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.
ah, my mistake that it's used only in test-reserve.js
.
@@ -316,6 +325,7 @@ const start = async (zcf, privateArgs) => { | |||
}), | |||
); | |||
zcf.reallocate(offerToSeat, collateralSeat); | |||
updateMetrics(); |
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.
why is this needed here but not after burnedRUN
change?
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.
It is already called in burnRUNToReduceShortfall
, because that calls increaseLiquidationShortfall
. addLiquiditytoAmmPool
mints, but doesn't adjust the shortfall. The shortfall is increased by other contracts that get a shortfallReportingInvitation
.
* feature: publish Reserve econ data: mint & burn closes: #4651 * chore: standardize names Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
closes: #4651
Description
Publish key economic data (minting and burning) from the Reserve contract.
Security Considerations
publishing data that should be public. No security concerns.
Documentation Considerations
None.
Testing Considerations
Tested that the values were published.