π§Price Oracle
Overview
The LN Exchange Price Oracle is the cornerstone of decentralized finance within the Lightning Network, primarily serving RFQ (Request for Quote) services. This platform provides dynamic pricing, including price fluctuations and a spread between buy and sell prices, ensuring accurate and reliable rates for assets traded on the network.
This guide will walk you through integrating with the platform, fetching prices, and adding currency pairs.
Unified Interface Domain
GRPC: oracle.ln.exchange:443
REST: https://oracle.ln.exchange
Fetching Prices
GRPC Calls
REST Calls
Adding Currency Pairs & Prices
There are 2 methods for adding assets/currency pairs:
Method 1: Using BTC/USDT Price
This method is intended for assets that are tied to the USDT stablecoin. When this method is used, the system automatically fetches the current BTC/USDT price, ensuring that your asset's value reflects real-time market conditions.
Method 2: Manual Price Specification
This method is useful for testing purposes. You can manually specify the price of the assets.
After adding prices using either method, prices can be fetched immediately.
If a currency pair or currency doesnβt exist, the system will automatically create them.
Prices can be added multiple times; the system will always use the most recently added price when fetching.
Note: For dynamic BTC-USDT pricing, set price=0 when adding the price. This value is fixed, and subsequent modifications are restricted.
Please refer to the API section for more details.
Price Oracle API
Quick Start
GRPC Section
Fetch Price
URLοΌ
oracle.ln.exchange:443
MethodοΌ
priceoraclerpc.PriceOracle.QueryRateTick
Request Parameters
Request Example
Response Parameters
REST Section API
REST Request Authentication
All private REST requests must include the following header
Header Parameters
Fetch Price List
URLοΌ
/napi/price/getList
MethodοΌ
GET
Request Parameters
Request Example
Response Parameters
Add Currency Pair & Price
URLοΌ
/napi/price/custom
MethodοΌ
POST
Request Parameters
Request Example (Price not equal to 0)
Request Example (Price equal to 0)
Response Parameters
Last updated