-
Notifications
You must be signed in to change notification settings - Fork 215
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!: inter auction status command #7454
Conversation
conflicts already?! I just branched from master a few hours ago. Going to draft mode until I get those worked out... |
@Chris-Hibbert The revised scope scope calls for "Time until next price step". For example:
|
606137f
to
d8641c4
Compare
oops. yes it does. never mind :) |
d8641c4
to
8d81620
Compare
8d81620
to
45b8e47
Compare
hm... I ended up writing a more extensive test for #7295; maybe I should move it to this PR. |
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.
more extensive test for #7295; maybe I should move it to this PR.
I support that since the other PR is about docs. But I'd suggest having the best known tests in both and it'll reach master in whichever lands first.
|
||
/** | ||
* ref publishSchedule() | ||
* packages/inter-protocol/src/auction/scheduler.js#L103 |
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 line number will be wrong soon enough that it should be omitted. Same for the source path less urgently. For a durable ref try,
* packages/inter-protocol/src/auction/scheduler.js#L103 | |
* @see (import('@agoric/inter-protocol/src/auction/scheduler.js')} publishSchedule |
I don't think our tools error on bad paths there yet but they will
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.
oh but more importantly… none of these types should be defined here. The contract must declare its published types and it does.
agoric-sdk/packages/inter-protocol/src/auction/scheduler.js
Lines 43 to 52 in 470ca41
/** | |
* @typedef {object} ScheduleNotification | |
* | |
* @property {Timestamp | undefined} activeStartTime start time of current | |
* auction if auction is active | |
* @property {Timestamp} nextStartTime start time of next auction | |
* @property {Timestamp} nextDescendingStepTime when the next descending step | |
* will take place | |
*/ | |
agoric-sdk/packages/inter-protocol/src/auction/auctionBook.js
Lines 93 to 107 in 470ca41
/** | |
* @typedef {object} BookDataNotification | |
* | |
* @property {Ratio | null} startPrice identifies the priceAuthority and price | |
* @property {Ratio | null} currentPriceLevel the price at the current auction tier | |
* @property {Amount<'nat'> | null} startProceedsGoal The proceeds the sellers were targeting to raise | |
* @property {Amount<'nat'> | null} remainingProceedsGoal The remainder of | |
* the proceeds the sellers were targeting to raise | |
* @property {Amount<'nat'> | undefined} proceedsRaised The proceeds raised so far in the auction | |
* @property {Amount<'nat'>} startCollateral How much collateral was | |
* available for sale at the start. (If more is deposited later, it'll be | |
* added in.) | |
* @property {Amount<'nat'> | null} collateralAvailable The amount of collateral remaining | |
*/ | |
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.
Thanks! I did just a tiny bit of looking for them, but didn't see them when I hovered over the point of publication.
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.
yeah there's some type flow regression in makeRecorderKit
. I'll look into it.
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.
fix in 68d4170
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.
ok, I applied that in this PR. Didn't manage to preserve authorship, though.
This all looks good to me. I won't |
); | ||
return { ...amounts, price }; | ||
/** @param {bigint} bp */ | ||
const basisPoints = n => `${(Number(n) / 100).toFixed(2)}%`; |
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.
sorry I omitted the body from the earlier suggestion.
const basisPoints = n => `${(Number(n) / 100).toFixed(2)}%`; | |
const basisPoints = bp => `${(Number(bp) / 100).toFixed(2)}%`; |
* | ||
* @typedef {import('@agoric/time/src/types.js').TimestampRecord} TimestampRecord | ||
* @typedef {{ | ||
* activeStartTime?: TimestampRecord | ||
* nextStartTime: TimestampRecord, | ||
* nextDescendingStepTime: TimestampRecord, | ||
* }} ScheduleUpdate | ||
* | ||
* @typedef {{ | ||
* startPrice: Ratio | null, | ||
* startProceedsGoal: Amount<'nat'> | null, | ||
* proceedsRaised: Amount<'nat'> | null, | ||
* startCollateral: Amount<'nat'>, | ||
* collateralAvailable: Amount<'nat'> | null, | ||
* currentPriceLevel: Ratio | null, | ||
* }} BookUpdate | ||
*/ | ||
/** @type { [ScheduleUpdate, BookUpdate, *] } */ |
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 see another push after this discussion but I don't see the types imported.
* | |
* @typedef {import('@agoric/time/src/types.js').TimestampRecord} TimestampRecord | |
* @typedef {{ | |
* activeStartTime?: TimestampRecord | |
* nextStartTime: TimestampRecord, | |
* nextDescendingStepTime: TimestampRecord, | |
* }} ScheduleUpdate | |
* | |
* @typedef {{ | |
* startPrice: Ratio | null, | |
* startProceedsGoal: Amount<'nat'> | null, | |
* proceedsRaised: Amount<'nat'> | null, | |
* startCollateral: Amount<'nat'>, | |
* collateralAvailable: Amount<'nat'> | null, | |
* currentPriceLevel: Ratio | null, | |
* }} BookUpdate | |
*/ | |
/** @type { [ScheduleUpdate, BookUpdate, *] } */ | |
*/ | |
/** @type { [ScheduleNotification, BookDataNotification, *] } */ |
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.
yeah, I'm still working on it. thanks for watching carefully
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.
take another look, please? I hope you don't mind that I squashed all the fixups
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.
small enough that it's easy to fully re-review
bd4029b
to
549ad7d
Compare
darn it... |
eb2380d
to
0125e36
Compare
BREAKING CHANGE: removes `inter liquidation status`
5cbbfc5
to
d7cd994
Compare
closes: #7266
note the revised scope
Description
Add an
agops inter auction status
command.Security/ Scaling Considerations
none?
Documentation Considerations
BREAKING CHANGE: this replaces an
inter liquidation status
that was kinda goofy.I'm not sure how
nextDescendingStepTime
works. More on that in a comment below...Testing Considerations
The only test is a help text snapshot test.