Skip to main content
skill CX Codex

supra-push-oracle — Claude Code skill: Supra price feeds on Hedera

A skill for reading the Supra push oracle on Hedera: getSvalue(pairId), millisecond timestamps and USDT pairs. Useful when a contract pulls prices from Supra.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add hedera-dev/hedera-skills --skill supra-push-oracle -a claude-code
Open on GitHub

What supra-push-oracle does

The skill lays out the Supra push pattern: the oracle writes to an on-chain feed, and the consumer calls getSvalue(pairId) to get price, decimals and time. The ISupraSValueFeed address is fixed per network, and a pair ID is a numeric Supra identifier, not an EVM aggregator address. Chain IDs: testnet 296, mainnet 295.

The timestamp is where things break. On Hedera the time field often arrives in milliseconds, so it gets compared against 10_000_000_000 and divided by 1_000 before any staleness check. Skip that step and the value reads as the future, which lets old quotes through. The second trap is the quote asset: Hedera feeds are often denominated in USDT rather than USD, and labelling one as USD is wrong.

Rejecting bad data gets its own section. Zero time, zero price, a stale timestamp and an unknown pair ID should all revert instead of returning zero. Prices are normalized through decimals to the consumer scale, usually 18. Inside are SKILL.md with a checklist and two references: references/examples.md with read sketches and references/hedera-feeds.md on where to source addresses and pair IDs.

What it helps with

  • read a price from a Supra feed on Hedera
  • convert a millisecond timestamp to unix seconds
  • reject a stale or zero quote before it hits a calculation
  • match a pair ID to the right market
  • avoid labelling a USDT feed as USD

Example prompts for the agent

  • Add Supra price reading on Hedera to the consumer contract
  • Check that the getSvalue timestamp is converted to seconds before the staleness check
  • Review the oracle read: zeros, staleness, decimals

How to install supra-push-oracle

1Skills CLI (Vercel)

npx skills add hedera-dev/hedera-skills --skill supra-push-oracle -a claude-code

2Manually: put the files in place

~/.claude/skills/supra-push-oracle/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/supra-push-oracle/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about supra-push-oracle

How do I install supra-push-oracle in Claude?

Run npx skills add hedera-dev/hedera-skills --skill supra-push-oracle -a claude-code. The skill lands at ~/.claude/skills/supra-push-oracle/SKILL.md.

What does supra-push-oracle do?

It covers reading the Supra push oracle on Hedera: calling getSvalue(pairId), handling decimals and time, enforcing freshness and reverting on incomplete quotes.

Why does the timestamp look like it is in the future?

On Hedera the time field is often in milliseconds. Values above 10_000_000_000 are divided by 1_000 before being compared with block.timestamp.

Source text

SKILL.md · Apache-2.0
---
name: supra-push-oracle
description: >
  Supra S-Value push oracle on Hedera. Use when reading getSvalue price feeds on Hedera
  (testnet 296 / mainnet 295), mapping pair IDs, converting millisecond timestamps to unix
  seconds, or quoting USDT pairs where USD is unavailable.
---

# 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

| Piece | Role |
| ----- | ---- |
| Push oracle | Immutable `ISupraSValueFeed` address for the network |
| Pair ID | Numeric Supra pair id (not an EVM aggregator address) |
| Read | `getSvalue(pairId)` → price, decimals, time |
| Time | Often **milliseconds** on Hedera — convert when `time > 1e10` |
| Quote asset | Hedera feeds are often **USDT**, not USD |
| Freshness | Compare unix **seconds** to a max staleness |

**Hedera chain IDs:** testnet `296`, mainnet `295`.

See [references/hedera-feeds.md](references/hedera-feeds.md) for where to source push-oracle addresses and pair IDs. See [references/examples.md](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:

| Condition | Why |
| --------- | --- |
| `pf.time == 0` | No successful update |
| `pf.price == 0` | Invalid price |
| Stale after converting to seconds | Older than `maxStaleness` |
| Unknown pair ID | Do 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

- [references/examples.md](references/examples.md) — `getSvalue` and timestamp sketches
- [references/hedera-feeds.md](references/hedera-feeds.md) — where to source push-oracle addresses and pair IDs
- [Supra push oracle networks](https://docs.supra.com/oracles/data-feeds/push-oracle/networks)
- [Supra data feeds index](https://docs.supra.com/oracles/data-feeds/data-feeds-index)

© hedera-dev · Apache-2.0 · hedera-dev/hedera-skills

Similar skills

Everything for Backend and APIs →

From the same set13

Quality Gates This skill wires up automatic code checks: lint and typecheck after every edit, a local CI run before push, and a five-stage deploy checklist. CX Codex +1 536installs Hedera Agent Kit v4 Migration Walks a project from [email protected] to v4: swaps packages, rewrites imports and ports custom tools to BaseTool. CX Codex +1 484installs agent-kit-plugin This skill guides the creation of Hedera Agent Kit plugins and tools. Use it when adding token, account, consensus, smart contract, or custom Hedera functionality. CX Codex +1 463installs create-harness-spec Turns a Hedera feature idea into a runnable hedera-harness recipe: PRD, spec file and validators. Useful when you need a spec you can actually run. CX Codex +1 465installs harness-spec-anatomy Defines what a hedera-harness recipe is made of: the files, the v3 defaults, the run stages and the blind evaluate-checklist rule. For anyone authoring or auditing recipes. CX Codex +1 464installs x402-payments An agent skill for gating HTTP resources behind HBAR payments with x402: a 402 challenge, a signed transfer, then verify and settle through your own facilitator. CX Codex +1 462installs layerzero-messaging A skill for building LayerZero V2 bridges between Hedera and EVM chains: OFT/OApp setup, Endpoint V2 wiring, ULN, DVN and sends via quoteSend. CX Codex +1 460installs pyth-price-feeds A skill for wiring Pyth pull price feeds into Hedera contracts: Hermes payload updates, max-age reads, and confidence checks. CX Codex +1 444installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor