deezy-inc / deezy-place

decentralized marketplace for bitcoin ordinal inscriptions
https://deezy.place
87 stars 39 forks source link

feat: bid auction #298

Closed topether21 closed 11 months ago

topether21 commented 11 months ago

Enable Create and Accept Bid Auction. Just the functionality. UX/UI is basic just for demonstration. It should be handle in another PR.

How to test this PR:

  1. You require at least two addresses. Please play attention to your fee rate.
  2. Login with any Wallet (Alby, Metamask or Unisat).
  3. Pick an inscription click on Bid
  4. Create a Bid.
  5. Login with the owner address.
  6. Accept the Bid.

https://github.com/deezy-inc/deezy-place/assets/126987350/ecfa2444-4fc2-49c4-861a-36766786f626

Fee 8 sats/vB

image image
linear[bot] commented 11 months ago
ENG-82 Add button to "Bid" on deezyplace and nosft-core

When clicking bid, it should construct a Buy PSBT and nostr event A buy PSBT looks like this: Inputs: * \#0 dummy input (signed w/ SIGHASH_ALL) * \#1 dummy input (signed w/ SIGHASH_ALL) * \#2 ordinal to be bought (NOT SIGNED YET) * \#3 funding input (signed w/ SIGHASH_ALL) Outputs: * \#0 dummy output * \#1 output to buyer's address to receive ordinal * \#2 payment to seller of ordinal (this address can just be the address where ordinal currently lives) * \#3 change back to buyer This can be constructed very similar to normal BUY flow, but just note that there is no existing PSBT to start with, and that input #2 is not signed (because the seller has not agreed to sell it at this price yet!) Note that you can use the same `/v1/psbt/populate` API to get dummy utxos and `v1/psbt/finalize` to get those dummy inputs signed. See docs.deezy.io ([https://docs.deezy.io/#tag/PSBT](https://docs.deezy.io/#tag/PSBT)) or DM danny for details The Nostr event is almost identical to a SELL event, except the "t" tag field is "buy" instead of "sell" [https://github.com/orenyomtov/openordex/blob/main/NIP.md](https://github.com/orenyomtov/openordex/blob/main/NIP.md)

netlify[bot] commented 11 months ago

Deploy Preview for fabulous-meringue-01474b ready!

Name Link
Latest commit b354fb652ff5f37d163a1be77b81f7c40cc5811f
Latest deploy log https://app.netlify.com/sites/fabulous-meringue-01474b/deploys/64da689b3169a40008d81776
Deploy Preview https://deploy-preview-298.test.deezy.place
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

dannydeezy commented 11 months ago

nit: should say "Bid on* this Ordinal"

Screenshot 2023-08-10 at 5 38 30 PM
dannydeezy commented 11 months ago

@habibitcoin I made a bid on my baseball card!

https://deploy-preview-298.test.deezy.place/inscription/b312d2ac6ed1fee29acb6be9d1cf07e001595a6e9a1a26fef324552da290e343i0

dannydeezy commented 11 months ago

should i be able to view bids on an item I don't own? cant' remember what we decided here. i think it would be nice eventually, but not a blocker

Screenshot 2023-08-10 at 5 40 45 PM
habibitcoin commented 11 months ago

should i be able to view bids on an item I don't own? cant' remember what we decided here. i think it would be nice eventually, but not a blocker Screenshot 2023-08-10 at 5 40 45 PM

Not yet, we're going to have that as a follow up once this is merged: https://linear.app/deezy/issue/ENG-137/create-a-view-to-see-other-competing-bids

And ayyy, the tx looks for your bid! Hope you don't mind tho I'm gonna keep this piece of cave art haha bullish on Deezy

dannydeezy commented 11 months ago

The "View All Bids" button is very slow to load. I'm ok with optimizing this later, but I think we should have a temporary button or placeholder that say "Searching for Bids..." with either a loading icon or the "..."'s changing just to convey that we are looking for bids.

https://github.com/deezy-inc/deezy-place/assets/43550949/ceb1d508-5dce-458c-b76e-dadf3d6d479c

dannydeezy commented 11 months ago

It's not clear what "Address" is in this column. I think that's the "Buyer" in which case it should say "Buyer". Otherwise i think it might be my receive address

Screenshot 2023-08-11 at 10 23 27 AM
dannydeezy commented 11 months ago

I made a bid with Unisat at 24 sat/vbyte and was able to successfully accept the bid via Alby. Broadcasted at 23.9 sat/vbyte, very nice!

topether21 commented 11 months ago

@dannydeezy What about this?

https://github.com/deezy-inc/deezy-place/assets/126987350/fda2062f-c297-421e-958e-a6a1c8c3cb4a

topether21 commented 11 months ago

@dannydeezy

image