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

@silo-finance/indexer

v0.0.1

Published

GraphQL client for Silo Finance indexer - fetch markets, positions, and historical data

Downloads

2

Readme

@silo-finance/indexer

npm version License: MIT

GraphQL client for Silo Finance indexer. Fetch markets, positions, vaults, and historical data.

Note: This package fetches data from the Silo indexer (GraphQL). For direct blockchain access, use @silo-finance/adapter-viem.

Installation

pnpm add @silo-finance/indexer

Quick Start

import { createIndexerClient } from "@silo-finance/indexer";

const client = createIndexerClient({
  url: "https://your-indexer-url.com",
});

// Fetch all markets on Arbitrum
const markets = await client.getMarkets({ chainId: 42161 });

// Fetch user positions
const positions = await client.getAccountPositions(userAddress, 42161);

// Fetch historical data
const snapshots = await client.getMarketSnapshots({
  marketId: "42161-0x...",
  from: BigInt(Date.now() / 1000 - 86400 * 7), // Last 7 days
});

API

createIndexerClient(config)

Creates an indexer client.

const client = createIndexerClient({
  url: "https://indexer.example.com",
  headers: { Authorization: "Bearer token" }, // optional
});

Methods

| Method | Description | |--------|-------------| | isAvailable() | Check if indexer is reachable | | getSilos(options?) | Get all silos (market pairs) | | getSilo(configAddress, chainId) | Get a specific silo | | getMarkets(options?) | Get all markets | | getMarket(marketAddress, chainId) | Get a specific market | | getPositions(options?) | Get positions with filters | | getAccountPositions(address, chainId) | Get all positions for an account | | getToken(tokenAddress, chainId) | Get token metadata | | getVaults(options?) | Get all vaults | | getVault(vaultAddress, chainId) | Get a specific vault | | getIncentivesPrograms(marketAddress, chainId) | Get incentive programs | | getMarketSnapshots(options) | Get historical market data |

Query Options

// Pagination
interface PaginationOptions {
  limit?: number;  // default: 100
  offset?: number; // default: 0
}

// Market filters
interface MarketQueryOptions extends PaginationOptions {
  chainId?: number;
  siloId?: string;
}

// Position filters
interface PositionQueryOptions extends PaginationOptions {
  chainId?: number;
  account?: Address;
  marketId?: string;
  openOnly?: boolean;
}

// Historical data
interface SnapshotQueryOptions extends PaginationOptions {
  marketId: string;
  from?: bigint; // timestamp
  to?: bigint;   // timestamp
}

Data Types

All data uses branded types from @silo-finance/primitives:

import type { MarketData, PositionData, TokenData } from "@silo-finance/indexer";

// MarketData includes:
// - address, chainId, siloId
// - inputToken, sToken, spToken, dToken (TokenData)
// - maxLtv, liquidationThreshold, liquidationFee (Percent)
// - totalSupply, totalBorrowed, liquidity (Amount)
// - utilization, borrowRate, depositRate (Percent)

// PositionData includes:
// - accountAddress, marketId, chainId
// - collateralBalance, protectedBalance, debtBalance (Amount)
// - isOpen, lastUpdatedTimestamp

Using with SDK Calculations

Combine indexer data with @silo-finance/core for calculations:

import { createIndexerClient } from "@silo-finance/indexer";
import { calculateLtv } from "@silo-finance/core";

const client = createIndexerClient({ url: "..." });

const market = await client.getMarket(marketAddress, chainId);
const positions = await client.getPositions({ account: userAddress, chainId });

// Use data with SDK calculations
const ltv = calculateLtv({
  collateralSilo: {
    tokenAddress: market.inputToken.address,
    decimals: market.inputToken.decimals,
    collateralBalance: positions[0].collateralBalance,
    // ...
  },
  debtSilo: { /* ... */ },
});

Type-Safe GraphQL

This package uses gql.tada for type-safe GraphQL queries. Types are automatically inferred from the indexer schema.

# Regenerate types after schema changes
pnpm gql:generate

License

MIT