Skip to Content

Pyth Network action reference

This page is generated from the plugin registry. Do not edit it by hand.

Pyth Network: cross-chain decentralized on-chain price oracle feeds

Set actionType in a node’s config to the action type shown under each heading. See the workflow definition page for the node format.

Read actions return the value under result: a single unnamed output is result, a named one is result.<name>, and several outputs are result.<name> each. Reference it as {{@nodeId:Label.result}}. Integer Solidity types are passed as decimal strings.

ActionAction type
Pyth Network: Get Price (Unsafe)pyth/get-price-unsafe
Pyth Network: Get Pricepyth/get-price
Pyth Network: Get Price No Older Thanpyth/get-price-no-older-than
Pyth Network: Get EMA Price (Unsafe)pyth/get-ema-price-unsafe
Pyth Network: Get EMA Pricepyth/get-ema-price
Pyth Network: Get EMA Price No Older Thanpyth/get-ema-price-no-older-than
Pyth Network: Get Price Unsafe (Custom Oracle)pyth/custom-get-price-unsafe
Pyth Network: Get Price (Custom Oracle)pyth/custom-get-price
Pyth Network: Get Price No Older Than (Custom Oracle)pyth/custom-get-price-no-older-than
Pyth Network: Get EMA Price Unsafe (Custom Oracle)pyth/custom-get-ema-price-unsafe
Pyth Network: Get EMA Price (Custom Oracle)pyth/custom-get-ema-price
Pyth Network: Get EMA Price No Older Than (Custom Oracle)pyth/custom-get-ema-price-no-older-than

Pyth Network: Get Price (Unsafe)

Action type: pyth/get-price-unsafe. Connection: not required.

Read the last pushed on-chain price of any age (check publishTime for freshness).

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 56, 137, 999, 8453, 42161, 43114, 11155111Network.
idbytes32YesPrice Feed ID (bytes32 hex) (bytes32).

Outputs

OutputDescription
resultThe contract function return value
result.pricePrice (int64 raw integer, scaled by 10^expo e.g. 190533915588 with expo -8 is $1905.34)
result.confConfidence Interval (uint64)
result.expoExponent (int32)
result.publishTimePublish Time (Unix timestamp)
successWhether the operation succeeded
errorError message if the operation failed

Pyth Network: Get Price

Action type: pyth/get-price. Connection: not required.

Read the current price tuple for a Pyth price feed. Reverts with StalePrice() if not recently updated.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 56, 137, 999, 8453, 42161, 43114, 11155111Network.
idbytes32YesPrice Feed ID (bytes32 hex) (bytes32).

Outputs

OutputDescription
resultThe contract function return value
result.pricePrice (int64 raw integer, scaled by 10^expo e.g. 190533915588 with expo -8 is $1905.34)
result.confConfidence Interval (uint64)
result.expoExponent (int32)
result.publishTimePublish Time (Unix timestamp)
successWhether the operation succeeded
errorError message if the operation failed

Pyth Network: Get Price No Older Than

Action type: pyth/get-price-no-older-than. Connection: not required.

Read the current price tuple for a Pyth price feed, reverting if older than specified max age.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 56, 137, 999, 8453, 42161, 43114, 11155111Network.
idbytes32YesPrice Feed ID (bytes32 hex) (bytes32).
ageuint256YesMax Age (seconds) (uint256).

Outputs

OutputDescription
resultThe contract function return value
result.pricePrice (int64 raw integer, scaled by 10^expo e.g. 190533915588 with expo -8 is $1905.34)
result.confConfidence Interval (uint64)
result.expoExponent (int32)
result.publishTimePublish Time (Unix timestamp)
successWhether the operation succeeded
errorError message if the operation failed

Pyth Network: Get EMA Price (Unsafe)

Action type: pyth/get-ema-price-unsafe. Connection: not required.

Read the last pushed on-chain EMA price of any age (check publishTime for freshness).

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 56, 137, 999, 8453, 42161, 43114, 11155111Network.
idbytes32YesPrice Feed ID (bytes32 hex) (bytes32).

Outputs

OutputDescription
resultThe contract function return value
result.pricePrice (int64 raw integer, scaled by 10^expo e.g. 190533915588 with expo -8 is $1905.34)
result.confConfidence Interval (uint64)
result.expoExponent (int32)
result.publishTimePublish Time (Unix timestamp)
successWhether the operation succeeded
errorError message if the operation failed

Pyth Network: Get EMA Price

Action type: pyth/get-ema-price. Connection: not required.

Read the current exponential moving average (EMA) price tuple from the on-chain Pyth contract.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 56, 137, 999, 8453, 42161, 43114, 11155111Network.
idbytes32YesPrice Feed ID (bytes32 hex) (bytes32).

Outputs

OutputDescription
resultThe contract function return value
result.pricePrice (int64 raw integer, scaled by 10^expo e.g. 190533915588 with expo -8 is $1905.34)
result.confConfidence Interval (uint64)
result.expoExponent (int32)
result.publishTimePublish Time (Unix timestamp)
successWhether the operation succeeded
errorError message if the operation failed

Pyth Network: Get EMA Price No Older Than

Action type: pyth/get-ema-price-no-older-than. Connection: not required.

Read the current EMA price tuple from the Pyth contract, reverting if older than max age.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 56, 137, 999, 8453, 42161, 43114, 11155111Network.
idbytes32YesPrice Feed ID (bytes32 hex) (bytes32).
ageuint256YesMax Age (seconds) (uint256).

Outputs

OutputDescription
resultThe contract function return value
result.pricePrice (int64 raw integer, scaled by 10^expo e.g. 190533915588 with expo -8 is $1905.34)
result.confConfidence Interval (uint64)
result.expoExponent (int32)
result.publishTimePublish Time (Unix timestamp)
successWhether the operation succeeded
errorError message if the operation failed

Pyth Network: Get Price Unsafe (Custom Oracle)

Action type: pyth/custom-get-price-unsafe. Connection: not required.

Read the last pushed on-chain price of any age from a custom Pyth oracle address.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 56, 137, 999, 8453, 42161, 43114, 11155111Network.
contractAddressstringYesCustom Pyth Oracle Address.
idbytes32YesPrice Feed ID (bytes32 hex) (bytes32).

Outputs

OutputDescription
resultThe contract function return value
result.pricePrice (int64 raw integer, scaled by 10^expo e.g. 190533915588 with expo -8 is $1905.34)
result.confConfidence Interval (uint64)
result.expoExponent (int32)
result.publishTimePublish Time (Unix timestamp)
successWhether the operation succeeded
errorError message if the operation failed

Pyth Network: Get Price (Custom Oracle)

Action type: pyth/custom-get-price. Connection: not required.

Read current price tuple from a custom Pyth oracle contract address.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 56, 137, 999, 8453, 42161, 43114, 11155111Network.
contractAddressstringYesCustom Pyth Oracle Address.
idbytes32YesPrice Feed ID (bytes32 hex) (bytes32).

Outputs

OutputDescription
resultThe contract function return value
result.pricePrice (int64 raw integer, scaled by 10^expo e.g. 190533915588 with expo -8 is $1905.34)
result.confConfidence Interval (uint64)
result.expoExponent (int32)
result.publishTimePublish Time (Unix timestamp)
successWhether the operation succeeded
errorError message if the operation failed

Pyth Network: Get Price No Older Than (Custom Oracle)

Action type: pyth/custom-get-price-no-older-than. Connection: not required.

Read price tuple from a custom Pyth oracle address with max age assertion.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 56, 137, 999, 8453, 42161, 43114, 11155111Network.
contractAddressstringYesCustom Pyth Oracle Address.
idbytes32YesPrice Feed ID (bytes32 hex) (bytes32).
ageuint256YesMax Age (seconds) (uint256).

Outputs

OutputDescription
resultThe contract function return value
result.pricePrice (int64 raw integer, scaled by 10^expo e.g. 190533915588 with expo -8 is $1905.34)
result.confConfidence Interval (uint64)
result.expoExponent (int32)
result.publishTimePublish Time (Unix timestamp)
successWhether the operation succeeded
errorError message if the operation failed

Pyth Network: Get EMA Price Unsafe (Custom Oracle)

Action type: pyth/custom-get-ema-price-unsafe. Connection: not required.

Read the last pushed on-chain EMA price of any age from a custom Pyth oracle address.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 56, 137, 999, 8453, 42161, 43114, 11155111Network.
contractAddressstringYesCustom Pyth Oracle Address.
idbytes32YesPrice Feed ID (bytes32 hex) (bytes32).

Outputs

OutputDescription
resultThe contract function return value
result.pricePrice (int64 raw integer, scaled by 10^expo e.g. 190533915588 with expo -8 is $1905.34)
result.confConfidence Interval (uint64)
result.expoExponent (int32)
result.publishTimePublish Time (Unix timestamp)
successWhether the operation succeeded
errorError message if the operation failed

Pyth Network: Get EMA Price (Custom Oracle)

Action type: pyth/custom-get-ema-price. Connection: not required.

Read EMA price tuple from a custom Pyth oracle contract address.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 56, 137, 999, 8453, 42161, 43114, 11155111Network.
contractAddressstringYesCustom Pyth Oracle Address.
idbytes32YesPrice Feed ID (bytes32 hex) (bytes32).

Outputs

OutputDescription
resultThe contract function return value
result.pricePrice (int64 raw integer, scaled by 10^expo e.g. 190533915588 with expo -8 is $1905.34)
result.confConfidence Interval (uint64)
result.expoExponent (int32)
result.publishTimePublish Time (Unix timestamp)
successWhether the operation succeeded
errorError message if the operation failed

Pyth Network: Get EMA Price No Older Than (Custom Oracle)

Action type: pyth/custom-get-ema-price-no-older-than. Connection: not required.

Read EMA price tuple from a custom Pyth oracle address with max age assertion.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
networkstringYeschain ids 1, 56, 137, 999, 8453, 42161, 43114, 11155111Network.
contractAddressstringYesCustom Pyth Oracle Address.
idbytes32YesPrice Feed ID (bytes32 hex) (bytes32).
ageuint256YesMax Age (seconds) (uint256).

Outputs

OutputDescription
resultThe contract function return value
result.pricePrice (int64 raw integer, scaled by 10^expo e.g. 190533915588 with expo -8 is $1905.34)
result.confConfidence Interval (uint64)
result.expoExponent (int32)
result.publishTimePublish Time (Unix timestamp)
successWhether the operation succeeded
errorError message if the operation failed

Contracts

ContractChain ids
Pyth Oracle Contract1, 56, 137, 999, 8453, 42161, 43114, 11155111
Custom Pyth Oracleany (the address is set on the node)