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

feat(auctions): add auctions api to IO classes #235

Merged
merged 14 commits into from
Oct 24, 2024
Merged

Conversation

dtfiedler
Copy link
Collaborator

@dtfiedler dtfiedler commented Oct 21, 2024

Updated the examples/vite to show a chart for auction information using the read APIs.

Related process PR - https://github.com/ar-io/ar-io-network-process

image

dtfiedler added a commit to ar-io/ar-io-network-process that referenced this pull request Oct 23, 2024
Summary:
Introduces and `Auction` object class that is used to store auctions on
the `NameRegistry`. We should look towards using more of these classes
to leverage some better static analysis and type enforcement on
functions. The class is responsible for computing prices based on the
initialization details (baseFee, demandFactor, etc.). Auctions are
stored as instances of this class, and returned as simple table
(excluding function) so clients can compute prices themselves.

This initial implementation includes handler support for ANTs returning
`permabuy` name registrations. In a separate PR we'll introduce
Lease-Expiration-Intiated-Auctions where a name will go in to auction
after the grace period has ended.

Checklist:
- [x] business logic (and docs) to create and store auctions in state
with pricing information
- [x] handler for `Release-Name` that allows integration with ANTs
- [x] handler for `Auction-Info` to get auction information of a given
name
- [x] handler for `Auction-Bid` to submit bid to acquire name in auction
and update arns registry
- [x] unit tests with >80% coverage
- [x] integration tests for all handlers
- [x] update ANT source code to support `Release-Name` handler that
forwards to this process
    - PR: ar-io/ar-io-ant-process#23
- [x] update [ar-io-sdk](https://github.com/ar-io/ar-io-sdk) to include
auction types and APIs for auctions
    - PR: ar-io/ar-io-sdk#235
- [ ] add event data for auction creation and auction bids
- WILL DO IN A SEPARATE PR ONCE E2E TESTING IN DEVNET HAS BEEN VALIDATED

TODOs:
- [x] storing prices in auction state impacts the handler response
(`Data` ends up being an empty table - not sure if this is a bug in AO
or we are hitting a memory limit). it also costs ~600KiB to store those
values in state, which could bloat our memory when several auctions are
in process. we could consider just storing the settings of the auction
pricing in state, and use that to calculate prices when necessary (still
have to create the table, but response doesn't need to contain it). need
to think more about this and what is necessary for clients to be able to
showing pricing charts.
- we've modified to store the auction settings on the auction object,
and then clients will compute the price with various parameters

Here is the sequence diagram for a permabuy initiated auction
<img width="794" alt="image"
src="https://github.com/user-attachments/assets/8b1699e2-a764-4a7d-ad65-cafddfe66c19">
@dtfiedler dtfiedler marked this pull request as ready for review October 23, 2024 19:24
@dtfiedler dtfiedler requested a review from a team as a code owner October 23, 2024 19:24
value: intervalMs?.toString() ?? '900000',
},
].filter(
(tag): tag is { name: string; value: string } => tag.value !== undefined,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh, neat

@dtfiedler dtfiedler merged commit 7490a95 into alpha Oct 24, 2024
13 checks passed
@dtfiedler dtfiedler deleted the PE-6656-auctions branch October 24, 2024 16:02
@dtfiedler
Copy link
Collaborator Author

🎉 This PR is included in version 2.4.0-alpha.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants