Pyth Updates API
The Updates API from Pyth — 2 operation(s) for updates.
The Updates API from Pyth — 2 operation(s) for updates.
openapi: 3.1.0
info:
title: Benchmarks Price Differences Updates API
version: 0.3.6
tags:
- name: Updates
paths:
/v1/updates/price/{timestamp}:
get:
tags:
- Updates
summary: Historical price updates for a provided timestamp
description: Returns the historical price updates at a specific timestamp for one or more provided price feed ids. This price update includes the data you need to post on-chain to prove the price at a specific time.
operationId: price_updates_timestamp_route_v1_updates_price__timestamp__get
parameters:
- name: timestamp
in: path
required: true
schema:
type: integer
description: The timestamp for the requested price update in seconds since the Unix epoch.
title: Timestamp
description: The timestamp for the requested price update in seconds since the Unix epoch.
- name: ids
in: query
required: true
schema:
type: array
items:
type: string
description: List of price feed ids to include in the price update. Multiple ids can be specified by repeating the parameter, e.g. `?ids=a12...&ids=b4c...`.<br><br><b>Note:</b> If any of the provided IDs are invalid, an error message will be shown. The query will only succeed if all IDs are valid.
examples:
- - e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43
title: Ids
description: List of price feed ids to include in the price update. Multiple ids can be specified by repeating the parameter, e.g. `?ids=a12...&ids=b4c...`.<br><br><b>Note:</b> If any of the provided IDs are invalid, an error message will be shown. The query will only succeed if all IDs are valid.
- name: encoding
in: query
required: false
schema:
$ref: '#/components/schemas/EncodingEnum'
description: Encoding of the data. Defaults to `hex` if not given. Possible values are `hex`, `base64`.
examples:
- hex
default: hex
description: Encoding of the data. Defaults to `hex` if not given. Possible values are `hex`, `base64`.
- name: parsed
in: query
required: false
schema:
type: boolean
description: If `true`, the historical price update will be parsed and returned in a JSON format along with the binary data. Defaults to `true` if not given. Possible values are `true`, `false`.
examples:
- 'true'
default: true
title: Parsed
description: If `true`, the historical price update will be parsed and returned in a JSON format along with the binary data. Defaults to `true` if not given. Possible values are `true`, `false`.
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/PriceUpdatesResponse'
examples:
PriceUpdatesSuccessResponse:
summary: PriceUpdatesSuccessResponse
value:
binary:
encoding: hex
data:
- 01000000030d0009d7a69f691d418d88d2af48f91dae7eca27e98aba7d26a49bde387137e8446403c351726fcdf0fa5f00590abfef64e139120b7973ba06a1b197fe722c3d0e27010125a8b0b8b06116810cbe18fd450046cbeaab7ecced3bc806c7f3fa7a7a8d78297aa87cec5b826e696e40c143740f98a633d65ee18503a26f8c2db67f2193b737010277c94477e3bb98d5603c5d53b36143bf9afc39337cb7c1e0fa119a14dd3d9e9209799fea768e03937f5f9ad856e648693a3e6fad1adbcef148a1da1b737eb2c20104972c3482dc0ae53279037139f015b0cdb50c0d230747e2d908fd346ddb7c3e9b384dabbf87c60bd58acc28e2fc8b3ad42fff7cd813f6700db54eb8f3cd5161a90006acdf0b6967646c9ab663ff9eeb9984d512bbf5c24e48384603526caa411a9dfb6db7e7cfce4ef10ab51fb86f4d0eae3b030b3e8a422defe687ecb3ccb1bfaf9f000899eef5ceae6b8e703f69ac90919d1f8199ebc9da4ec88240ca846ef870aa0e140909cec866f7c8888ae4e7bfe53fa839141577320ee9235f91dee1515565221d0109db99e24981df8bb4190a375f36e743aaf92625e7c1eb40f81e5f665f858d09096ed35eccafe317939f26c891275d73646ac8ea3c77d9cd4d81d9bba8ccbd223b010a5b1262f9bbe6f2ded2b2e68f093e17fe480f75d104ec90aeae00812d6913d2eb5be2e15942f260d8db312667949646d532a55bcd222d8e9b5db3de679b823698000bbd84621a2921ecf37704e3c45cab1fdd772a61ff6258e7c137c7b4be88a53c9331ff702c8a57d2bfc015f319169713f4c12eafa126448f105ec3bb96565fab79010f4ec6bd83df620aeea8fecabdcb183e38f0369caf6959c94b864726229d48dd8636759d20664eb3bcd2007960eda52311742405a564ff3d760cb77d66c2854b110010dc8b3b13c4984214088bd16de5ee769b3fe649f828eef44240e7f94ea75addcb5bf0d8a1f9d05286076e1d4be65544dba0125831144649cfd214b5b63fdc851a0011d7dbf5e17532b8eefd59d202ebc64bf344b649d466c1062d364ae5b319b091213485fc7aea212eedce1866150af38e697e6b0e68c2b1bc0cf55c0a7e54dafb2400129f4985ce5ab209f59afe0ed22ecff37971878d7718a6e96df5ec9ac8147d58a1214e5db8fb095f57caa24a05b8a256be59cd1015db0dfea9714e95781f93fb590064c84b0000000000001af8cd23c2ab91237730770bbea08d61005cdda0984348f3f6eecb559638c0bba00000000021b1bed90150325748000300010001020005009d04028fba493a357ecde648d51375a445ce1cb9681da1ea11e562b53522a5d3877f981f906d7cfe93f618804f1de89e0199ead306edc022d3230b3e8305f391b00000002b34f400ff000000000632ea00fffffff80000002b32b01fc80000000006a9ee86010000000c0000000f0000000064c84b000000000064c84b000000000064c84aff0000002b33d4c1b800000000057923880000000064c84afee6c020c1a15366b779a8c870e065023657c88c82b82d58a9fe856896a4034b0415ecddd26d49e1a8f1de9376ebebc03916ede873447c1255d2d5891b92ce57170000002d125464a8000000000bd59e08fffffff80000002d12f03f18000000000be2082e01000000090000000a0000000064c84b000000000064c84aff0000000064c84aff0000002d12552410000000000bd65d700000000064c84affc67940be40e0cc7ffaa1acb08ee3fab30955a197da1ec297ab133d4d43d86ee6ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace0000002b369f400000000000043b5fbffffffff80000002b37877d2000000000041c4ce7010000001d000000200000000064c84b000000000064c84b000000000064c84aff0000002b3680bb8000000000044aa2000000000064c84aff8d7c0971128e8a4764e757dedb32243ed799571706af3a68ab6a75479ea524ff846ae1bdb6300b817cee5fdee2a6da192775030db5615b94a465f53bd40850b50000002b2fa72ac40000000009f7ff5bfffffff80000002b32c4d0a8000000000ab6aab4010000000a0000000c0000000064c84b000000000064c84aff0000000064c84aff0000002b301995c8000000000a6a6a5f0000000064c84aff543b71a4c292744d3fcf814a2ccda6f7c00f283d457f83aa73c41e9defae034ba0255134973f4fdf2f8f7808354274a3b1ebc6ee438be898d045e8b56ba1fe1300000000000000000000000000000000fffffff8000000000000000000000000000000000000000000000000070000000064c84b000000000064c84b000000000000000000000000000000000000000000000000000000000000000000
parsed:
id: ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace
price:
conf: '70999999'
expo: -8
price: '185600000000'
publish_time: 1690848000
ema_price:
conf: '68963559'
expo: -8
price: '185615220000'
publish_time: 1690848000
'404':
description: Error
content:
application/json:
examples:
PriceUpdateErrorResponse:
summary: PriceUpdateErrorResponse
value: Price update for the given ids ['e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43', 'ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace'] and timestamp 1690972284 not found.
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/updates/price/{timestamp}/{interval}:
get:
tags:
- Updates
summary: Historical price updates for a provided time interval
description: Returns the historical price updates within a specified time range for one or more provided price feed ids. This price update includes the data you need to post on-chain to prove the price at a specific time. The time interval should not exceed 60 seconds.
operationId: price_updates_interval_route_v1_updates_price__timestamp___interval__get
parameters:
- name: timestamp
in: path
required: true
schema:
type: integer
description: Unix timestamp (UTC) of the start of the time range for the requested price updates, including timestamp.
title: Timestamp
description: Unix timestamp (UTC) of the start of the time range for the requested price updates, including timestamp.
- name: interval
in: path
required: true
schema:
type: integer
description: Time interval in seconds added to the provided timestamp for the requested price updates. For example, if the timestamp is 1716400000 and the interval is 60, this function will return price updates from time 1716400000 to 1716400060, inclusive of both. The time interval should not exceed 60 seconds.
title: Interval
description: Time interval in seconds added to the provided timestamp for the requested price updates. For example, if the timestamp is 1716400000 and the interval is 60, this function will return price updates from time 1716400000 to 1716400060, inclusive of both. The time interval should not exceed 60 seconds.
- name: ids
in: query
required: true
schema:
type: array
items:
type: string
description: List of price feed ids to include in the price update. Multiple ids can be specified by repeating the parameter, e.g. `?ids=a12...&ids=b4c...`
examples:
- - e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43
title: Ids
description: List of price feed ids to include in the price update. Multiple ids can be specified by repeating the parameter, e.g. `?ids=a12...&ids=b4c...`
- name: encoding
in: query
required: false
schema:
$ref: '#/components/schemas/EncodingEnum'
description: Encoding of the data. Defaults to `hex` if not given. Possible values are `hex`, `base64`.
examples:
- hex
default: hex
description: Encoding of the data. Defaults to `hex` if not given. Possible values are `hex`, `base64`.
- name: parsed
in: query
required: false
schema:
type: boolean
description: If `true`, the historical price update will be parsed and returned in a JSON format along with the binary data. Defaults to `true` if not given. Possible values are `true`, `false`.
examples:
- 'true'
default: true
title: Parsed
description: If `true`, the historical price update will be parsed and returned in a JSON format along with the binary data. Defaults to `true` if not given. Possible values are `true`, `false`.
- name: unique
in: query
required: false
schema:
type: boolean
description: If `true`, only unique price updates will be returned. Defaults to `true` if not given. Possible values are `true`, `false`.
examples:
- 'true'
default: true
title: Unique
description: If `true`, only unique price updates will be returned. Defaults to `true` if not given. Possible values are `true`, `false`.
responses:
'200':
description: Success
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PriceUpdatesResponse'
title: Response Price Updates Interval Route V1 Updates Price Timestamp Interval Get
examples:
PriceUpdatesSuccessResponse:
summary: PriceUpdatesSuccessResponse
value:
- binary:
encoding: hex
data:
- 504e41550100000003b801000000040d00c444bb80bfacc33ebecb01063005cd96278fd0f96e3ef4503eca32fd5f6a2e8f5f87f4f49b5ab03db5faa6ff686e99ff40de804f5bb1af4d81b799562e9a84330001c60156201ccb1b6c8f03410476789c379c38689d887963f6babfcdb303e1cdb96701adf9c3d26929c4dcada5b56129f7294867ba54872fb55e6f7ded19d533610002c5d1ca9048003a5947fc5940b908d7a35f4b14f678076b92922b9767b0f7f01b6657581e71a03eca737b35e13b2c5f1ab9f144775907f3bb8a59023a4a5106fe0103c4db7937314710ebd1fa45ef1968c9d40eec8dcade7b38a29545d9acd965d35c3fe31aa67b1c15e9a0ac4b8dcc5f426ceea480d42aef92ac4ddb7a9a77484f490004e89486e9e5ac3731929ff4fbc85c3b1a39d8422a1c5fb84f1007c492af2b906b642640954a616c694cfe23215a114503197477b292e9a4aaa51bf66662ea4ec80006ca8a98b26ed389b06445a62edf33f6fe605c86551aff94a7f8ed91b4765eec5a5a9072b5421d749d53579a36e9d3925c9bba98401cac7f9135e8c4508b33769a000ac06d1ab3f928b4235f0094e1f9ee8e52328dc05c924a7c1cb80fa13cb20207ff1efe0d20e629734fa69746fd30b839a1231e2a1ca72ea9e2f0a68a44a982c7ae010b43a8c3dadd43a873b979fd1de0324ea061b8ed0397724af45b8ed9b79e4c57861e844b3849591444c5bea09a9d321c382bf0ae5380125c21da22e6208c7c5e2c010c2bd5742c609499458acb69a375ef22c7ce0f4ae2ab106a750604dedb2a0a4ca755db575e0ade3c902beba82d3e9131f843a02a86451fe6f7c568da2a3a435ce2010d15f6f14bdce37d73cacdc2591d1fe64f63dc3b29054c2b2afaa5155f136e61d50bcf2722be281dc493f61440d8818c6db32403323e242d4b0d1d1d613cc3098b010e866af4c5b2e3f693a412d6cef049f48f058bb222cf878929d141a7cfabf0921355b06da2d3ef6bff6e4fa39b786fec15b46ef78e2bd51827ec6d65401525082d000f23e1a9a5a8828f43769c5f57231cc3c49cef5c3a080f7aa6274fb0fb5fa652d13533aea4c51ed6dd6cc93052f88fba219bb7c5890a474d59f2eda88586da65d200126c3a27b36be396956f86dc53aaa70b58a90864004840839e03824c8582a5aaf179b71386cb787ea108996dd0b70d90250ab260bc78a5872564a30cec7170b6da00664ecd3d00000000001ae101faedac5851e32b9b23b5f9411a8c2bac4aae3ed4dd7b811dd1a72ea4aa71000000000379ef250141555756000000000008840d1900002710fdb3714f5b13a1eca078c72010a76a3c94ace53702005500e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b4300000652c02819f600000000e91fd07dfffffff800000000664ecd3d00000000664ecd3c0000065110a3fc2000000000ee132b000ab9be7aa722078d092f8d6d3698d5ca800ba6d6d4fb5088d1c73e04ca7eed83e47333f2985ec2522a3d9a370fbdf485cc0d8aefc973ed86460e1e5b53afb577a4a691021641af52f9154573092239917e9985319e575db8ebab7f673709157135a8f5a90e6c8f80b08a84767c95f77174c4fed882d520c768001996c06a78e72de0fdee1987d94c5c97d7d590740dafa3ce5fc2f78b21cd612ed5e0ba869571130546bbfaf843a4a348581c5f574d4ec2f991a099b25fb38b5032043074a2fb6027cc163abff53862005500ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d0000000421bcccf600000000010b36c4fffffff800000000664ecd3d00000000664ecd3c00000004256dd9300000000000d59b7f0a4358592d697e1cb89649779dedf815f70271a051a3c4bb667721210f6d03c1f991cc67df39763e38422112153cf32e4218563d7b131630de0fa540bc9189439eda2ffb92f9d4c46d51e2afc5745bafa1a302b19f22794f0afc60d0436e0843a69a13ebf36c8f80b08a84767c95f77174c4fed882d520c768001996c06a78e72de0fdee1987d94c5c97d7d590740dafa3ce5fc2f78b21cd612ed5e0ba869571130546bbfaf843a4a348581c5f574d4ec2f991a099b25fb38b5032043074a2fb6027cc163abff53862
parsed:
- id: ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d
price:
conf: '17512132'
expo: -8
price: '17745890550'
publish_time: 1716440381
ema_price:
conf: '13998975'
expo: -8
price: '17807825200'
publish_time: 1716440381
metadata:
slot: 142871833
proof_available_time: 1716440382
prev_publish_time: 1716440380
- id: e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43
price:
conf: '3911176317'
expo: -8
price: '6952480938486'
publish_time: 1716440381
ema_price:
conf: '3994233600'
expo: -8
price: '6945241300000'
publish_time: 1716440381
metadata:
slot: 142871833
proof_available_time: 1716440382
prev_publish_time: 1716440380
- binary:
encoding: hex
data:
- 504e41550100000003b801000000040d0000fe875453b0714c0c953400eb5ed3b48a13da5041b163d4d2673a8ef64ff23c06404f6fa212c6512e03ce98ec9511306aab20d554f2028cbca0637fa6fea4ae00018837c1b7d5f31b7028e41e515c1b4e8148981ebb949d3c28478834b69b37180c040e80a6b67ae2a098e721195ba75efa4ed0ad067e7939033f7e8e6827006be40102feded0b0d667b6f9852542442a280b22ef686a305a29c48dc6300787376526244c835ec8c583b4f59e2b5f0014e77c027c2857baf87d0abdbb7cb84ddef635ee0103646732aada9b3de4595578c8f3b29b63c9cf5265794e40feb747cf4d920778ce0dfb90ceb2f1caa3a51992b604afd338d61749c347d1d905585548847f90f4650004b0a499feac8ea5d790610c74e2ba2cd6f60a5b8627a8822498207bb3fdaf4ac842e39e78732982b1927194b1e3db0b9117c2e91f78bf568ebb4935d8f0a356800106bb2531f4faa67101dfbc44930d644bf868c638383ca02d94d391377585341ed9702aa202e3f3d62cbf71403867314309b3b87b4dbf60632cb775ec009c860dab010ab1f66539467889cf2cb901dbaa46a530a980e47dbfea48f2521a3b55cd95d80d4539bb342e9cdeb7078231f6681a880722d82097f47b750dc15670c58a33e5c9000b6eb9d48a8147b2dd437676d140dcb41f264db36ef758ef2ccaafacd82fed3a425f241b61e8850e2544450c551f4e26f29304afe6b628227df03ff6ab4402c64b000c0728cad8d8f494aff9ba5901f5a82239c31ed7deda0981e564d8a19120889e2b1659f7a10ada368101c7cbdd4e302f27e515fe3927ee11f16932fcb2e578a5d0010d8963f1a7cc1a294d2b67390495309401d2c580e06149abb7ef4eb056ec6d68d71746147df75f6fe572668ed27f0b1ba50fc3e555eb26b446d36f428a6cf18868010e1cd7133f24f8296152f388849bac0d4c903e034a4683e099eb5f481253654d00537fde3c1bade5cff6e74affca6bd9cb6d45ddadc008b2ad7a4d8379b02c7cb9010fb9beda90fa9bf3d4f040272d02420d33af0639ef7dbabc2cba93cf764b2ecd6c1319b45375b6d85a3c8d85f9463ac79227559275e0fa9b1e361a61e75a689ed60112f8582f74514f9c1b0647b3bb3f5b880f377a34a85dfd8249176eca29474468113ba0dda26aec5b6f97f1488912e2cb86e07cf71bbdf9c3aebe89c62c4ba6140600664ecd3e00000000001ae101faedac5851e32b9b23b5f9411a8c2bac4aae3ed4dd7b811dd1a72ea4aa71000000000379ef290141555756000000000008840d1d000027102976861f826413fb91d5b38f49961c95322b12ec02005500e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b4300000652ca1a486a00000000df2be1fafffffff800000000664ecd3e00000000664ecd3d0000065110d9640000000000ee11e72c0ab9be7aa722078d092f8d6d3698d5ca800ba6d6d4099db42d8f832d5b785c08ad831b68309aaaa4f1e798d3516621532027074d83acac09d9a057ebfacca9c7b7875e58c61da9b66aea715b04311c44af7bbb5e68b077e2e9d55ee065011131ab76647aca0720de3fd00312fe505bfe1d364ebaa8dbcfe12bfb604a52b10a3d158b6aa88a70cc1c8eb0ca797319054eecd94ccc949c393d7f56793d1045e9176793e928b072043ac703f9f905752bc71f938025265d3ad161255f92c9ff4ed1969f2d073855756874005500ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d0000000421c052090000000000f2562ffffffff800000000664ecd3e00000000664ecd3d00000004256d7d640000000000d59ff20ad292a779ea6ffd19bbaa74e52335a7c11546b3f96e4a5eab4e2a4d45d57115b7bec5fcd99284edadedb441358e2167a942d0c1e0cd9ef48a36aeb990ba2e1c1dcc8335a82bd8baf53741c38e3c60f7b38bbc9453ceb05f2402d15edc440d9ed5b53018e60720de3fd00312fe505bfe1d364ebaa8dbcfe12bfb604a52b10a3d158b6aa88a70cc1c8eb0ca797319054eecd94ccc949c393d7f56793d1045e9176793e928b072043ac703f9f905752bc71f938025265d3ad161255f92c9ff4ed1969f2d073855756874
parsed:
- id: ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d
price:
conf: '15881775'
expo: -8
price: '17746121225'
publish_time: 1716440382
ema_price:
conf: '14000114'
expo: -8
price: '17807801700'
publish_time: 1716440382
metadata:
slot: 142871837
proof_available_time: 1716440383
prev_publish_time: 1716440381
- id: e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43
price:
conf: '3744195066'
expo: -8
price: '6952647805034'
publish_time: 1716440382
ema_price:
conf: '3994150700'
expo: -8
price: '6945244800000'
publish_time: 1716440382
metadata:
slot: 142871837
proof_available_time: 1716440383
prev_publish_time: 1716440381
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
ProofData:
properties:
encoding:
$ref: '#/components/schemas/EncodingEnum'
title: Encoding used for the `data` field
data:
items:
type: string
type: array
title: An array of data that can be used as the `updateData` argumentfor pyth smart contracts
type: object
required:
- encoding
- data
title: ProofData
ParsedData:
properties:
id:
type: string
title: Id
price:
$ref: '#/components/schemas/Price'
ema_price:
$ref: '#/components/schemas/Price'
title: Exponentially-weighted moving average price
metadata:
$ref: '#/components/schemas/Metadata'
type: object
required:
- id
- price
- ema_price
- metadata
title: ParsedData
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
type: object
required:
- loc
- msg
- type
title: ValidationError
EncodingEnum:
type: string
enum:
- hex
- base64
title: EncodingEnum
Price:
properties:
conf:
type: string
title: Conf
expo:
type: integer
title: Expo
price:
type: string
title: Price
publish_time:
type: integer
title: Publish Time
type: object
required:
- conf
- expo
- price
- publish_time
title: Price
Metadata:
properties:
slot:
anyOf:
- type: integer
- type: 'null'
title: Slot
proof_available_time:
anyOf:
- type: integer
- type: 'null'
title: Proof Available Time
prev_publish_time:
anyOf:
- type: integer
- type: 'null'
title: Prev Publish Time
type: object
title: Metadata
PriceUpdatesResponse:
properties:
binary:
$ref: '#/components/schemas/ProofData'
title: Proof data that can be used on-chain
parsed:
anyOf:
- items:
$ref: '#/components/schemas/ParsedData'
type: array
- type: 'null'
title: Parsed version of the data
type: object
required:
- binary
title: PriceUpdatesResponse
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError