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

@strigival/sdk

v1.2.2

Published

Official TypeScript/JavaScript SDK for STRIGIVAL Trading Strategies Marketplace

Readme

STRIGIVAL TypeScript SDK

Official TypeScript/JavaScript SDK for the STRIGIVAL Trading Strategies Marketplace.

Installation

npm install @strigival/sdk
# or
yarn add @strigival/sdk
# or
pnpm add @strigival/sdk

Quick Start

import { StrigivalClient, Protocol, TradeAction } from '@strigival/sdk';

// Initialize client
const client = new StrigivalClient({
  apiUrl: 'https://api.strigival.com',
  privateKey: '0x...', // Your private key
  chain: 'sepolia', // or 'arbitrum'
});

// List available strategies
const strategies = await client.listStrategies({ sortBy: 'sharpe', limit: 10 });
for (const strategy of strategies) {
  console.log(`${strategy.name}: Sharpe ${strategy.sharpeRatio}`);
}

// Get a quote for a swap
const quote = await client.getQuote({
  vaultAddress: '0x...',
  tokenIn: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
  tokenOut: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', // WETH
  amount: 1000_000000n, // 1000 USDC (6 decimals)
  protocol: Protocol.UNISWAP_V3,
  slippageBps: 50, // 0.5%
});

console.log(`Quote: ${quote.amountOut} WETH`);
console.log(`Price impact: ${quote.priceImpactBps} bps`);
console.log(`Gas cost: $${quote.gasCostUsd}`);

// Execute the trade
const trade = await client.executeTrade(quote, '0x...');
console.log(`Trade executed: ${trade.txHash}`);

Features

  • TypeScript First: Full type safety with TypeScript
  • Authentication: Web3 signature-based authentication
  • Quotes: Get real-time quotes from multiple protocols
  • Trading: Execute trades via your vault
  • Analytics: Access institutional-grade KPIs
  • History: Query trade history and performance

API Reference

StrigivalClient

const client = new StrigivalClient({
  apiUrl: string,           // API base URL
  privateKey?: `0x${string}`, // Ethereum private key
  address?: Address,        // Ethereum address (if no privateKey)
  chain?: 'sepolia' | 'arbitrum',
  timeout?: number,         // Request timeout (ms)
});

Methods

Quotes

// Get a quote
const quote = await client.getQuote({
  vaultAddress: Address,
  tokenIn: string,
  tokenOut: string,
  amount: bigint,
  protocol?: Protocol,
  action?: TradeAction,
  slippageBps?: number,
});

// List supported protocols
const protocols = await client.getProtocols();

Trading

// Execute a trade
const trade = await client.executeTrade(quote, vaultAddress);

// Get trade history
const history = await client.getTradeHistory(vaultAddress, { limit: 50 });

// Get trade details
const trade = await client.getTrade(vaultAddress, txHash);

Vault

// Get vault status
const status = await client.getVaultStatus(vaultAddress);

// Get authorized tokens
const tokens = await client.getAuthorizedTokens(vaultAddress);

Analytics

// Get all KPIs
const kpis = await client.getKPIs(vaultAddress);
console.log(`Sharpe: ${kpis.sharpeRatio}`);
console.log(`Max DD: ${kpis.drawdown.maxDrawdown}`);

// Get Sharpe ratio
const sharpe = await client.getSharpeRatio(vaultAddress, 365);

Types

Quote

interface Quote {
  quoteId: string;
  expiresAt: Date;
  amountIn: bigint;
  amountOut: bigint;
  amountOutMin: bigint;
  price: number;
  priceImpactBps: number;
  estimatedGas: number;
  gasPriceGwei: number;
  gasCostUsd: number;
  protocol: string;
  route: string[];
}

Trade

interface Trade {
  txHash: string;
  success: boolean;
  gasUsed?: number;
  amountIn?: bigint;
  amountOut?: bigint;
  slippageActualBps?: number;
  error?: string;
}

KPIs

interface KPIs {
  sharpeRatio: number;
  sortinoRatio: number;
  calmarRatio: number;
  volatilityAnnual: number;
  drawdown: DrawdownInfo;
  winRate: WinRateInfo;
  alpha: number;
  beta: number;
}

Error Handling

import {
  StrigivalError,
  AuthenticationError,
  QuoteError,
  TradeError,
  RateLimitError,
} from '@strigival/sdk';

try {
  const quote = await client.getQuote({ ... });
} catch (error) {
  if (error instanceof RateLimitError) {
    console.log(`Rate limited, retry after ${error.retryAfter}s`);
  } else if (error instanceof QuoteError) {
    console.log(`Quote failed: ${error.message}`);
  } else if (error instanceof StrigivalError) {
    console.log(`Error [${error.code}]: ${error.message}`);
  }
}

License

Proprietary License - see LICENSE file for details.