npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@squadswapdefi/oracle-sdk

v0.2.0

Published

TypeScript SDK for reading price feeds from the Squad Oracle Network. Chainlink-compatible, Chainlink AggregatorV3 interface under the hood.

Readme

@squadswapdefi/oracle-sdk

TypeScript SDK for reading price feeds from the Squad Oracle Network.

Under the hood each feed exposes the standard Chainlink AggregatorV3Interface, so if you already integrate Chainlink you can point your existing code at the per-feed adapter address and be done. This SDK is a thin convenience wrapper on top of that: multi-feed listing, pair-name lookup, staleness helpers, and typed results.

Install

npm install @squadswapdefi/oracle-sdk ethers
# or
pnpm add @squadswapdefi/oracle-sdk ethers
# or
yarn add @squadswapdefi/oracle-sdk ethers

ethers v6 is a peer of this SDK — installing it keeps the bundle tight.

Quick start

import { SquadOracle } from "@squadswapdefi/oracle-sdk";

const oracle = new SquadOracle(
  "0xF799d1ebc55B6FD1896714b92852a49b87461fB0", // BNB Chain oracle address
  "https://bsc-dataseed.binance.org"
);

// Fetch a single feed
const xmr = await oracle.getPrice("XMR/USD");
console.log(`XMR/USD: $${xmr.priceUsd} (round #${xmr.roundId})`);

// List everything the oracle exposes
const feeds = await oracle.listFeeds();
for (const f of feeds) {
  console.log(f.pair, "→", f.feedId);
}

// Subscribe to updates with explicit error handling. Without `onError`,
// transient RPC failures used to be silently swallowed by an empty catch —
// supplying it lets you surface banners / retry / unsubscribe yourself.
// The polling loop never stops on error: the next interval re-attempts.
const stop = oracle.onPriceUpdate("XMR/USD", p => render(p), {
  intervalMs: 5_000,
  onError: e => console.warn("price poll failed:", e),
});
// Legacy signature `onPriceUpdate(pair, cb, 5000)` still works.

What you get back

interface PriceData {
  price: bigint;       // Raw on-chain value (decimals-aware)
  priceUsd: number;    // Decimal-adjusted number for quick display
  timestamp: number;   // When the round was posted (seconds since epoch)
  roundId: number;     // Monotonically increasing round counter
  updatedAt: number;   // Same as timestamp for this oracle
  isStale: boolean;    // True if adapter's staleness window has expired
}

Drop-in Chainlink compatibility

If you prefer the raw Chainlink interface (no SDK), point the aggregator address at the per-feed adapter and use the standard interface — works in any Solidity project:

import { AggregatorV3Interface } from
  "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";

contract MyConsumer {
  AggregatorV3Interface immutable oracle;

  constructor(address adapter) {
    oracle = AggregatorV3Interface(adapter);
  }

  function latestPrice() external view returns (int256) {
    (, int256 price, , uint256 updatedAt, ) = oracle.latestRoundData();
    require(block.timestamp - updatedAt < 2 hours, "stale");
    return price; // 8 decimals, matching Chainlink convention
  }
}

Per-feed adapter addresses are listed on the dashboard.

Deployed networks

| Chain | Status | Oracle | Registry | |-------|--------|--------|----------| | BNB Chain (56) | ✅ Active | 0xF799d1ebc55B6FD1896714b92852a49b87461fB0 | 0xbc2D232c35B876d903FEce4a6a37AB81d088e12F | | Ethereum | 🔜 Coming soon | — | — |

Links

License

MIT