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

@quantoracle/agentkit

v0.1.1

Published

Deterministic quant finance math for Coinbase AgentKit agents — Black-Scholes, Kelly, Monte Carlo, full risk audit, hedge recommendations. Free tier + x402 micropayments for paid composites.

Readme

QuantOracle for Coinbase AgentKit

Deterministic quant finance math for autonomous agents built with Coinbase AgentKit.

📖 Read the full integration comparison: AgentKit vs LangChain vs Direct HTTP — picking the right integration for paid agent APIs (dev.to, May 2026)

Why this exists: AI agents trying to compute Black-Scholes prices, Kelly fractions, or Monte Carlo simulations in-context drift. The numbers are wrong, the Greeks are hallucinated, and the agent can't tell. QuantOracle is grounded math: same inputs, same outputs, every time. Free tier covers calculator endpoints; paid composites (full risk audit, hedge recommendations) settle automatically via your AgentKit wallet using x402 micropayments on Base or Solana.

What this provides

5 high-leverage actions covering the financial decisions an autonomous trading or finance agent typically faces:

| Action | What it does | Cost | |---|---|---| | price_option | Black-Scholes pricing with full Greeks (delta, gamma, vega, theta, rho) | Free | | calculate_kelly | Kelly Criterion optimal sizing (full / half / quarter Kelly) | Free | | simulate_portfolio | Monte Carlo simulation with contributions, withdrawals, probability of ruin | Free | | assess_portfolio_risk | Composite audit: Sharpe, Sortino, Calmar, max DD, VaR, CVaR, Kelly, Hurst | $0.04 USDC via x402 | | recommend_hedge | Ranked hedge structures (collar, protective put, partial put, inverse) for any position | $0.04 USDC via x402 |

The full QuantOracle API has 73 endpoints plus a /v1/batch endpoint that bundles up to 100 sub-requests into one HTTP call (charged as the sum of the component prices — same per-call cost, one HTTP roundtrip, one x402 settlement). This provider exposes a curated subset. For the long tail (exotic options, FX models, technical indicators) or for bulk computation via batch, agents can call the raw API at https://api.quantoracle.dev/v1/* directly.

Free tier

  • 1,000 calls per IP per day, no signup, no API key
  • Covers price_option, calculate_kelly, simulate_portfolio for almost any agent
  • Resets daily at 00:00 UTC

Paid endpoints (x402)

assess_portfolio_risk and recommend_hedge are composite endpoints that wrap 5-15 calculator calls into a single response. They cost $0.04 USDC each, settled on-chain via the x402 protocol on Base mainnet or Solana mainnet.

Your AgentKit wallet handles payment automatically. No API key, no signup, no billing setup. The wallet just needs to hold a small amount of USDC on Base or Solana.

Installation

Recommended — install the npm package:

npm install @quantoracle/agentkit

It ships built ESM + CJS + TypeScript types. @coinbase/agentkit and zod are peer dependencies — both already present in a create-onchain-agent project.

Alternative — vendor the source. If you'd rather copy the provider into your repo (to customize it, or pin a specific version), pull the four files directly:

mkdir -p src/quantoracle
curl -sL https://raw.githubusercontent.com/QuantOracledev/quantoracle/main/integrations/agentkit/quantoracleActionProvider.ts -o src/quantoracle/quantoracleActionProvider.ts
curl -sL https://raw.githubusercontent.com/QuantOracledev/quantoracle/main/integrations/agentkit/schemas.ts -o src/quantoracle/schemas.ts
curl -sL https://raw.githubusercontent.com/QuantOracledev/quantoracle/main/integrations/agentkit/constants.ts -o src/quantoracle/constants.ts
curl -sL https://raw.githubusercontent.com/QuantOracledev/quantoracle/main/integrations/agentkit/index.ts -o src/quantoracle/index.ts

If you vendor the files this way, import from ./quantoracle instead of @quantoracle/agentkit in the usage example below.

Usage

import { AgentKit, CdpEvmWalletProvider } from "@coinbase/agentkit";
import { quantoracleActionProvider } from "@quantoracle/agentkit";

const walletProvider = await CdpEvmWalletProvider.configureWithWallet({
  apiKeyId: process.env.CDP_API_KEY_ID!,
  apiKeySecret: process.env.CDP_API_KEY_SECRET!,
  networkId: "base-mainnet",
});

const agentkit = await AgentKit.from({
  walletProvider,
  actionProviders: [quantoracleActionProvider()],
});

// The agent now has 5 new actions:
//   price_option, calculate_kelly, simulate_portfolio,
//   assess_portfolio_risk, recommend_hedge

A complete runnable example is at example-agent.ts. Additional examples:

  • example-agent-solana.ts — Same agent but routes x402 payments through a Solana mainnet wallet (SPL USDC) instead of Base. Useful for agents already operating in the Solana ecosystem.
  • example-chained-workflow.ts — Scripted demo showing the natural assess_portfolio_riskrecommend_hedge chained workflow. Pre-baked prompts walk the agent through risk audit → hedge analysis → final recommendation. Spends ~$0.08 USDC per run on real x402 settlements.

For a side-by-side comparison of integration patterns (direct HTTP vs AgentKit vs LangChain Python), see COMPARISONS.md.

Example agent prompts

Try these in your AgentKit chat:

  • "Price a 30-day NVDA call with strike $185, spot $180, 28% IV" → uses price_option
  • "I have 55% win rate, $150 avg win, $100 avg loss — what's my Kelly?" → uses calculate_kelly
  • "Simulate $100K over 30 years with 7% return, 16% vol, 4% withdrawal" → uses simulate_portfolio
  • "Audit risk on my last 252 daily returns: [...]" → uses assess_portfolio_risk (paid)
  • "Recommend hedges for my $100K long NVDA position over 30 days" → uses recommend_hedge (paid)

Try without code

15 free interactive calculators backed by the same engine are at quantoracle.dev — useful for verifying outputs before wiring the action provider into your agent.

Why deterministic finance math matters for agents

Three failure modes when LLMs do financial math in-context:

  1. Black-Scholes calculations drift. GPT-4o's Greeks are wrong by 5-30% depending on moneyness. The agent can't tell.
  2. Compound interest computations skip steps. A 30-year projection at 8% loses meaningful precision over many tokens.
  3. Kelly and VaR formulas are mis-applied. LLMs often confuse arithmetic vs geometric returns or fail to annualize correctly.

Grounded tools fix all three: the API is bytes-exact against textbook implementations (Hull, Wilmott, Lopez de Prado), tested across 120 accuracy benchmarks, and returns the same value for the same inputs every time. The agent can cite a specific tool call as the source for any number it presents.

Repository

Source: github.com/QuantOracledev/quantoracle API: api.quantoracle.dev Calculators: quantoracle.dev OpenAPI spec: api.quantoracle.dev/openapi.json

License

MIT — same as the rest of QuantOracle.