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]: Expose Price Oracle RPC #1356

Open
levmi opened this issue Feb 5, 2025 · 5 comments
Open

[feature]: Expose Price Oracle RPC #1356

levmi opened this issue Feb 5, 2025 · 5 comments
Labels

Comments

@levmi
Copy link
Collaborator

levmi commented Feb 5, 2025

A wide variety of app developers will likely be interested in validating the quote provided by the edge node for their users. Luckily, tapd itself also has a price oracle connection built into the daemon. However, the output of that price oracle is not easily accessible for app developers via an RPC. We should expose the result of the tapd price oracle for consumption by app developers via RPC.

@ZZiigguurraatt
Copy link

Trying to understand your wording here. Based on the conversation we had on this topic, I thought the intent was the following:

Expand tapd to not only be a price oracle client, but also a price oracle server. Normally the price oracle server is a separate external process. The price oracle server in tapd would basically be a proxy to the external price oracle server configured at

; Price oracle gRPC server address (rfqrpc://<hostname>:<port>)
; To use the integrated mock, use the following value:
; use_mock_price_oracle_service_promise_to_not_use_on_mainnet
; experimental.rfq.priceoracleaddress=
.

Benefits of this are as follows:

  • Actual price oracle server can remain unauthenticated and on a private network (and it must until [feature]: allow authenticating the price oracle server with a macaroon #1370 is fixed), but still allow authentication through tapd and exposure over the internet using a macaroon.
  • Common gRPC socket (more efficient on the wire and less socket/connection objects to manage in client applications).
  • Less firewall ports to open, less hostnames, SSL certificates and macaroons to manage.

@ZZiigguurraatt
Copy link

We should also be more specific here in that all we are talking about exposing is the QueryAssetRates RPC.

@Roasbeef
Copy link
Member

Expand tapd to not only be a price oracle client, but also a price oracle server. Normally the price oracle server is a separate external process

My reading of this issue is that it would just be a proxy. So tapd isn't running the price oracle server in its Go process, instead it allows users an easy way to query the price oracle it's already connected to.

So we'd add a new RPC to the tapd rpcserver, which serves mostly proxy (can add any other relevant information) to the price oracle server itself.

@ZZiigguurraatt
Copy link

OK, so it might actually be a slight variant of the QueryAssetRates RPC?

@Roasbeef
Copy link
Member

Yeah, basically a pass through version. So the user doesn't need the oracle info to query it, just tapd's info, who then proxies the call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🆕 New
Development

No branches or pull requests

3 participants