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

[feature]: create an initial basic version of the PriceOracle RFQ service #777

Closed
ffranr opened this issue Jan 31, 2024 · 2 comments
Closed
Assignees
Labels
enhancement New feature or request rfq
Milestone

Comments

@ffranr
Copy link
Contributor

ffranr commented Jan 31, 2024

Parent issue: #683

The PriceOracle is a new RFQ subsystem service for retrieving the exchange rate between BTC and a counter currency. The service is queried by the RFQ Negotiator service.

@ffranr ffranr added enhancement New feature or request rfq labels Jan 31, 2024
@ffranr ffranr moved this from 🆕 New to 💇‍♂️Needs Shaping in Taproot-Assets Project Board Jan 31, 2024
@ffranr ffranr added this to the v0.4 milestone Jan 31, 2024
@ffranr ffranr changed the title [feature]: create PriceOracle RFQ service [feature]: create PriceOracle RFQ service Jan 31, 2024
@ffranr
Copy link
Contributor Author

ffranr commented Jan 31, 2024

The unknowns I'd like to solve are:

  1. How do I get from an asset ID/asset group to some bid/ask on a site like blockchain.com
  2. How do I handle niche assets where I can't find a bid/ask on the internet.

Do we need meta data in the asset to the effect of "price this asset as this fiat currency"?

Any ideas @Roasbeef @jharveyb @dstadulis ?

@Roasbeef
Copy link
Member

Roasbeef commented Feb 2, 2024

How do I get from an asset ID/asset group to some bid/ask on a site like blockchain.com

From the code's PoV, it's an abstract interface it can use to obtain price data. It isn't aware of where it's getting that data from, just that it can map a (asset, volume) pair into an acceptable price.

The actual implementation can source data from pretty much anywhere. We'll fashion a standardized JSON/gRPC interface similar to the feeurl setting we have. A daemon won't ever need to source prices of an asset that it doesn't hold itself.

How do I handle niche assets where I can't find a bid/ask on the internet.

I don't think this is a concern. See above.

The code can be written in an abstracted style, trusting that if a daemon has an asset, then it'll be able to obtain a relevant price for it. If not, then there'll be an error scenario where a user may need to manually update a config, or run a slim proxy to be able to obtain a quote.

More concretely, I think this would take the form of a PirceOracle gRPC service that tapd becomes a client of. We hit this endpoint whenever we need to obtain a price that isn't cache otherwise. This can also instead be configured as a normal REST endpoint returning JSON in w/e format.

Do we need meta data in the asset to the effect of "price this asset as this fiat currency"?

What would that look like in practice? I think, no? The logic of an oracle implementation itself can be very dynamic, and isn't really restricted by much. You can think of it just like fee estimation in a sense.

@ffranr ffranr moved this from 💇‍♂️Needs Shaping to 🏗 In progress in Taproot-Assets Project Board Feb 5, 2024
@ffranr ffranr changed the title [feature]: create PriceOracle RFQ service [feature]: create an initial basic version of the PriceOracle RFQ service Feb 29, 2024
@ffranr ffranr moved this from 🏗 In progress to 👀 In review in Taproot-Assets Project Board Feb 29, 2024
@ffranr ffranr moved this from 👀 In review to ✅ Done in Taproot-Assets Project Board Feb 29, 2024
@ffranr ffranr closed this as completed Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rfq
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants