hedera-dev/hedera-skills

supra-push-oracle

Supra S-Value push oracle on Hedera.

查看源码
仓库原始内容

按源仓库内容呈现,保留标题、案例、代码、表格、链接以及原文引用的演示图片。

Supra Push Oracle (Hedera)

Push S-Value pattern: Supra updates an on-chain feed; readers call getSvalue(pairId) and must reject empty, zero, or stale quotes.

text
Supra push oracle → getSvalue(pairId) → consumer

Consumers may wrap the feed behind a local interface; that is optional. Do not assume a project-specific adapter name.

Quick Reference

PieceRole
Push oracleImmutable ISupraSValueFeed address for the network
Pair IDNumeric Supra pair id (not an EVM aggregator address)
ReadgetSvalue(pairId) → price, decimals, time
TimeOften milliseconds on Hedera — convert when time > 1e10
Quote assetHedera feeds are often USDT, not USD
FreshnessCompare unix seconds to a max staleness

Hedera chain IDs: testnet 296, mainnet 295.

See references/hedera-feeds.md for where to source push-oracle addresses and pair IDs. See references/examples.md for read sketches.

Critical: Millisecond Timestamps

Supra time on Hedera is frequently milliseconds. Treat values > 10_000_000_000 as ms and convert before staleness checks:

solidity
uint256 updatedAt = pf.time > 10_000_000_000 ? pf.time / 1_000 : pf.time;
if (block.timestamp - updatedAt > maxStaleness) revert StalePrice(updatedAt, maxStaleness);

Comparing a millisecond timestamp to block.timestamp (seconds) will look “in the future” or skip staleness incorrectly.

Critical: USDT Pairs On Hedera

Current Hedera Supra feeds often quote USDT, not USD. Pair keys / symbols must match the actual quote (HBAR/USDT, BTC/USDT). Do not label a USDT feed as USD.

Completeness And Invalid Prices

Revert when:

ConditionWhy
pf.time == 0No successful update
pf.price == 0Invalid price
Stale after converting to secondsOlder than maxStaleness
Unknown pair IDDo not return zero

Normalize pf.price with pf.decimals to the consumer scale (often 18).

Checklist

When implementing or reviewing Supra reads on Hedera:

  • [ ] Push-oracle address and pair IDs taken from Supra Hedera docs (not Ethereum)
  • [ ] Timestamps converted to unix seconds when they look like milliseconds
  • [ ] Pair symbols match the real quote asset (often USDT)
  • [ ] Zero / missing updates revert
  • [ ] Staleness bound is enforced in seconds
  • [ ] Decimals normalized to the consumer scale

References

来自同一仓库

更多 Skills

全部 Skills
hedera-dev
社区

agent-kit-plugin

This skill should be used when the user asks to "create a hedera plugin", "build a hedera agent kit plugin", "extend hedera agent kit", "create custom hedera tools", "add hedera functionality", "write a hedera tool", "implement hedera tool", or needs guidance on Hedera Agent Kit plugin architecture, tool definitions, mutation tools, query tools, or parameter schemas using Zod.

安装量
2
GitHub Stars
28
最近更新
9月3日
hedera-dev
社区

axelar-gmp

Axelar General Message Passing (GMP) on Hedera. Use when sending or receiving cross-chain contract calls via Axelar Gateway (callContract, payNativeGasForContractCall), building AxelarExecutable receivers, wiring Hedera↔EVM destinations, or separating bridge transport from destination handlers (orchestrated / scheduled flows).

安装量
2
GitHub Stars
28
最近更新
9月3日
hedera-dev
社区

ccip

Chainlink CCIP Cross-Chain Tokens on Hedera. Use when bridging burn-and-mint CCT between Hedera and EVM, registering TokenAdminRegistry / pools, calling ccipSend with chain selectors, or wiring HTS-backed wrappers (HtsBurnMintERC20) vs vanilla BurnMintERC20. Not for Chainlink Data Feeds / price oracles.

安装量
2
GitHub Stars
28
最近更新
9月3日
hedera-dev
社区

chainlink-data-feeds

Chainlink Data Feeds on Hedera. Use when reading AggregatorV3 price feeds on Hedera (testnet 296 / mainnet 295), calling latestRoundData, checking round completeness and staleness, or normalizing feed decimals. Not for Chainlink CCIP (cross-chain tokens).

安装量
2
GitHub Stars
28
最近更新
9月3日