From 47b83f3a6d94d5ad747b81e4fda4ad8c4fcb73e6 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 24 Dec 2024 12:06:23 -0500 Subject: [PATCH 1/2] Asset prices --- 85.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 85.md diff --git a/85.md b/85.md new file mode 100644 index 0000000000..060e97142c --- /dev/null +++ b/85.md @@ -0,0 +1,61 @@ +NIP-85 +====== + +Asset Prices +------------ + +`draft` `optional` + +This NIP defines event kinds to host asset prices. + +## Latest price + +Kind `31892` stores the latest conversion price. The `d` tag contains the commonly used ticket conversion symbol.The `value` tag contains the amount, parseable to a Decimal.`n` tags separate the conversion ticker into the two ticket symbols.The event's `created_at` field MUST be used as the date/time of the conversion value. + +```js +{ + "kind": 31892, + "tags": [ + ["d", "BTCUSD"], + ["n", "BTC"], + ["n", "USD"], + ["value", "100000"] + ], + // other fields +} +``` + +Since this is a replaceable event, only the latest price will be available. + +## Historical data + +Historical prices can be found as `1892` events with the same structure as `31892`. Historical queries can use Nostr's `since` and `until` filter to narrow the search. + +```js +{ + "kind": 1892, + "tags": [ + ["d", "BTCUSD"], + ["n", "BTC"], + ["n", "USD"], + ["value", "100000"] + ], + // other fields +} +``` + +Even though these events use the `d` tag, they are not replaceable. + +## Declaring Pricing Providers + +Kind `10041` lists the user's authorized providers for pricing services.. It contains `s` tags with the `pubkey` of the provider and the relay where those events are stored. + +```js +{ + "kind": 10041, + "tags": [ + ["s", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://bitagent.prices"], + ], + //... +} +``` \ No newline at end of file From 5d039c1488f0e0260ac2c54b0f6c2ce814f9e712 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 24 Dec 2024 12:17:19 -0500 Subject: [PATCH 2/2] Typos --- 85.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/85.md b/85.md index 060e97142c..46e3b0fd00 100644 --- a/85.md +++ b/85.md @@ -8,9 +8,9 @@ Asset Prices This NIP defines event kinds to host asset prices. -## Latest price +## Latest Price -Kind `31892` stores the latest conversion price. The `d` tag contains the commonly used ticket conversion symbol.The `value` tag contains the amount, parseable to a Decimal.`n` tags separate the conversion ticker into the two ticket symbols.The event's `created_at` field MUST be used as the date/time of the conversion value. +Kind `31892` stores the latest conversion price. The `d` tag contains the commonly used ticket conversion symbol for the pair. The `value` tag contains the amount, parseable to a Decimal. `n` tags separate the pair into the two ticket symbols. The event's `created_at` field MUST be used as the date/time of the conversion value. ```js { @@ -27,9 +27,9 @@ Kind `31892` stores the latest conversion price. The `d` tag contains the common Since this is a replaceable event, only the latest price will be available. -## Historical data +## Historical Data -Historical prices can be found as `1892` events with the same structure as `31892`. Historical queries can use Nostr's `since` and `until` filter to narrow the search. +Historical prices can be found as `1892` events with the same structure as `31892`. Historical queries can then use Nostr's `since` and `until` filters to narrow the search. ```js { @@ -48,7 +48,7 @@ Even though these events use the `d` tag, they are not replaceable. ## Declaring Pricing Providers -Kind `10041` lists the user's authorized providers for pricing services.. It contains `s` tags with the `pubkey` of the provider and the relay where those events are stored. +Kind 10041 lists the user's authorized providers for pricing services. It contains `s` tags with the provider's pubkey and the relay where those events are stored. ```js { @@ -58,4 +58,4 @@ Kind `10041` lists the user's authorized providers for pricing services.. It con ], //... } -``` \ No newline at end of file +```