Reduce price payload
https://pyth-lazer.dourolabs.app/v1/reduce_priceAn API key or short-lived access token, in an Authorization: Bearer <token> header.
Returns an update containing only the selected feeds. Use this endpoint to reduce the price data included in an on-chain transaction.
Submit an existing update from the WebSocket stream or either price endpoint. The router verifies the signatures, retains the selected feeds, and signs the reduced evm, solana, and leEcdsa payloads again. It also filters parsed and leUnsigned when present.
v1/reduce_pricecurl "https://pyth-lazer.dourolabs.app/v1/reduce_price" \
-H "Authorization: Bearer $PYTH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"payload": {
"evm": {
"data": "2a22999addab728fb2c91fe672c977809b9d75dfe312b35e1bc9e65a1099998250db7e5f1cf36f42dfd03dcbbe835e7b4b5d2913451a0cdcfc9a9d879cf8f6a592228fd100003093c7d37500065c56d00e39c00302000000010200000007a59b2ad58a04fff80000000202000000003eb32f732004fff8",
"encoding": "hex"
}
},
"priceFeedIds": [1]
}'{
"evm": {
"data": "2a22999a2bd019221815ab35dbd08b1bb69b2c425c50dbde48caf7e8deeb5e986986fb01475b54ae4864ab26d1cbe373a256afb47c80d39237bc95be37e7904bf7e97b9a01001f93c7d37500065c56d00e39c00301000000010200000007a59b2ad58a04fff8",
"encoding": "hex"
}
}Request body
application/jsonSend a JSON object with these fields.
payloadobjectRequiredThe original, unmodified update from Stream price updates, Get latest prices, or Get signed prices at a timestamp.
evmobject | nullOptionalSigned payload for EVM chains.
datastringRequiredBinary payload encoded using the format specified by encoding.
encodingstringRequiredThe encoding of data.
- base64
- hex
leEcdsaobject | nullOptionalSigned payload for Sui, IOTA and Stellar, with a little-endian layout and an ECDSA (secp256k1) signature.
datastringRequiredBinary payload encoded using the format specified by encoding.
encodingstringRequiredThe encoding of data.
- base64
- hex
leUnsignedobject | nullOptionalUnsigned payload.
datastringRequiredBinary payload encoded using the format specified by encoding.
encodingstringRequiredThe encoding of data.
- base64
- hex
parsedobject | nullOptionalDecoded feed values in the supplied update.
priceFeedsobject[]RequiredFeed values included in this update.
priceFeedIdintegerRequiredNumeric ID of the price feed.
bestAskPricestring | nullOptionalBest ask price, before applying exponent.
bestBidPricestring | nullOptionalBest bid price, before applying exponent.
confidenceinteger | nullOptionalConfidence interval of the price, before applying exponent.
emaConfidenceinteger | nullOptionalExponential moving average of the confidence interval, before applying exponent.
emaPricestring | nullOptionalExponential moving average of the price, before applying exponent.
exponentinteger | nullOptionalPower of ten that scales the decimal fields: decimal value = mantissa * 10^exponent.
feedUpdateTimestampinteger | nullOptionalFeed update timestamp, in Unix microseconds.
Show 6 moreShow fewer
fundingRateinteger | nullOptionalPerpetual futures funding rate, before applying exponent.
fundingRateIntervalinteger | nullOptionalTime between funding rate updates, in microseconds.
fundingTimestampinteger | nullOptionalTimestamp of the latest funding rate, in Unix microseconds.
marketSessionstring | nullOptionalMarket session of the feed update.
- regular
- preMarket
- postMarket
- overNight
- closed
pricestring | nullOptionalPrice, before applying exponent. On funding-rate feeds, the funding price.
publisherCountinteger | nullOptionalNumber of publishers contributing to the update.
timestampUsstringRequiredThe update timestamp, in Unix microseconds.
solanaobject | nullOptionalSigned payload for Solana.
datastringRequiredBinary payload encoded using the format specified by encoding.
encodingstringRequiredThe encoding of data.
- base64
- hex
priceFeedIdsinteger[]RequiredIDs of the feeds to retain. The router ignores IDs absent from the input update. An empty array retains no feeds.
Response
200 · application/jsonReturns a JSON object with the following fields.
parsedobjectDecoded feed values retained in the reduced update.
priceFeedsobject[]Feed values included in this update.
priceFeedIdintegerNumeric ID of the price feed.
bestAskPricestringBest ask price, before applying exponent.
bestBidPricestringBest bid price, before applying exponent.
confidenceintegerConfidence interval of the price, before applying exponent.
emaConfidenceintegerExponential moving average of the confidence interval, before applying exponent.
emaPricestringExponential moving average of the price, before applying exponent.
exponentintegerPower of ten that scales the decimal fields: decimal value = mantissa * 10^exponent.
feedUpdateTimestampintegerFeed update timestamp, in Unix microseconds.
Show 6 moreShow fewer
fundingRateintegerPerpetual futures funding rate, before applying exponent.
fundingRateIntervalintegerTime between funding rate updates, in microseconds.
fundingTimestampintegerTimestamp of the latest funding rate, in Unix microseconds.
marketSessionstringMarket session of the feed update.
- regular
- preMarket
- postMarket
- overNight
- closed
pricestringPrice, before applying exponent. On funding-rate feeds, the funding price.
publisherCountintegerNumber of publishers contributing to the update.
timestampUsstringThe update timestamp, in Unix microseconds.
evmleEcdsaleUnsignedsolanaobjectEach payload contains encoding and data. The evm, solana, and leEcdsa payloads include signatures. The leUnsigned payload does not include a signature.
datastringBinary payload encoded using the format specified by encoding.
encodingstringThe encoding of data.
- base64
- hex
Status codes returned when a request fails.
- 400
- The router could not verify the supplied payload.
- 401
- The API key or access token is invalid.
- 403
- Authentication is missing or the credentials do not grant access to a requested feed or channel.
- 429
- The request rate limit for this API key was exceeded.