Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
327 stars 207 forks source link

auction publish all bids to vstorage #7906

Open Chris-Hibbert opened 1 year ago

Chris-Hibbert commented 1 year ago

What is the Problem Being Solved?

In order to display all the outstanding bids to auction users (#7159), we'll have to start by publishing them.

Description of the Design

Write all the bids to vstorage, indexed by their sequence number.

The Product Spec wants a timestamp, unique identifier, the price or discount bid, the amount of IST available, and the maximum collateral desired. The auction doesn't currently store a timestamp for each bid, this would have to be added. It's apparently okay that this won't be unique.

If we use the unique ID as an identifier in the tree; we only have to update bids as they change.

Security Considerations

This will be public data.

Scaling Considerations

The expectation is that we'll see dozens or hundreds of bids per auction for the near future. We may have to revisit aspects of the design if it gets to 10s of thousands or more.

Test Plan

unit tests for the writing. Plan to have a reader (probably CLI-based) in process to consume the data to validate the info is usable.

Chris-Hibbert commented 1 year ago

Current theory is that when a Bid get fulfilled, withdrawn or cancelled, we should delete the vstorage node corresponding to the bid.

turadg commented 1 year ago

https://github.com/Agoric/agoric-sdk/pull/7618 will allow for deleting nodes