-
Notifications
You must be signed in to change notification settings - Fork 17
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
Create UI to schedule Dutch auctions #967
Create UI to schedule Dutch auctions #967
Conversation
f7e5305
to
27014f8
Compare
41355d1
to
2e9012c
Compare
ab6c4d8
to
37508fb
Compare
setMaxOutput: state.dutchAuction.setMaxOutput, | ||
}); | ||
|
||
export const Price = () => { |
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.
* are even multiples of 10 minutes. So we'll set the step count to 120, so that | ||
* the sub-auctions can divide evenly into the number of intervening blocks. | ||
*/ | ||
export const STEP_COUNT = 120n; |
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.
Reviewers, let me know what you think of this logic.
Per @hdevalence 's comment here, a step count of ~100 is a good target. Since we're starting at a duration of 10 minutes, which doesn't divide evenly into 100 blocks (since blocks are added roughly every 5 seconds), I hard-coded the step count at 120.
Henry also wrote:
Longer time should mean more sub-auctions and slower price declines.
Not sure I understand this — does the number of steps influence how the price declines? And if a longer time = more sub-auctions, what should our algorithm be for increasing step count as duration increases?
(In the meantime, though, I figured this is a mergeable first effort. Let me know if you think otherwise.)
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 makes sense to me, but usually I'd go to the core repo and double check how it's done there. Doesn't look like we have an implementation on that side, so this is probably ok for now.
amount: state.dutchAuction.amount, | ||
setAmount: state.dutchAuction.setAmount, | ||
onSubmit: state.dutchAuction.onSubmit, | ||
submitButtonDisabled: state.dutchAuction.txInProgress || !state.dutchAuction.amount, |
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.
Should block if min/max isn't chosen too right?
* are even multiples of 10 minutes. So we'll set the step count to 120, so that | ||
* the sub-auctions can divide evenly into the number of intervening blocks. | ||
*/ | ||
export const STEP_COUNT = 120n; |
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 makes sense to me, but usually I'd go to the core repo and double check how it's done there. Doesn't look like we have an implementation on that side, so this is probably ok for now.
Also, is there a way we can get these changes in main and perhaps put it behind a flag or something? I worry that |
Yeah, I've hidden the tabs for now so that people don't actually use this until it's ready |
872d918
into
jessepinho/auctions-wasm-planner-web-942
* Build out Dutch auction UI * Add more docs to Slider * Fix metadata * Rename Prices -> Price * Fix test name * Create first tests for assembleRequest * Add one more test * Tweak Price layout * Add auction to swap sublinks * Remove tabs for now * Convert to a Record to avoid having to assert presence * Change min output * Change to decimal * Align to the right * Handle exponent when processing amounts * Add test coverage for constants
* Account for Dutch auction schedules/ends in the WASM planner * Remove useless conversion * Use real nonce * Create UI to schedule Dutch auctions (#967) * Build out Dutch auction UI * Add more docs to Slider * Fix metadata * Rename Prices -> Price * Fix test name * Create first tests for assembleRequest * Add one more test * Tweak Price layout * Add auction to swap sublinks * Remove tabs for now * Convert to a Record to avoid having to assert presence * Change min output * Change to decimal * Align to the right * Handle exponent when processing amounts * Add test coverage for constants
Screen.Recording.2024-04-30.at.6.36.22.PM.mov
<ActionDutchAuctionScheduleComponent />
to represent the action of scheduling a Dutch auction. It appears in both the transaction approval dialog and in the transaction view for a transaction containing a Dutch Auction Schedule action.<Slider />
component that allows users to use a slider to choose a value from a numeric range.<Swap />
component; it's now a router sibling of<DutchAuction />
active
toenabled
in theTab
interface, so as to differentiate from whenactive
means that a tab is selected.Coming in future PRs
Closes #944
Closes #978