Skip to content

feat: add QuantOracle — 9 quant finance actions for composite workflows#558

Open
fel123 wants to merge 1 commit into
sendaifun:v2from
fel123:feat/add-quantoracle
Open

feat: add QuantOracle — 9 quant finance actions for composite workflows#558
fel123 wants to merge 1 commit into
sendaifun:v2from
fel123:feat/add-quantoracle

Conversation

@fel123
Copy link
Copy Markdown

@fel123 fel123 commented Apr 18, 2026

Summary

Adds QuantOracle to packages/plugin-misc — a deterministic quantitative finance API with 63 underlying calculators + 10 composite workflows. This PR surfaces 9 high-value actions (rather than exposing all 73 endpoints) to keep the scope reviewable.

QuantOracle offers a 1,000 free calls/IP/day tier (no API key, no signup), so the actions work out-of-the-box. Past the free tier, paid endpoints return HTTP 402 with x402 payment requirements (USDC on Base or Solana) — the plugin surfaces a clear error; downstream x402-capable clients can auto-pay if desired.

Actions

Action Description Price past free tier
QUANTORACLE_PRICE_OPTION Black-Scholes + 10 Greeks $0.005
QUANTORACLE_FULL_RISK_ANALYSIS Full risk tearsheet (Sharpe, Sortino, VaR, Kelly, DD, Hurst, CAGR) $0.04 (paid-only)
QUANTORACLE_BACKTEST_STRATEGY SMA / RSI / momentum / Bollinger backtest $0.10 (paid-only)
QUANTORACLE_OPTIONS_STRATEGY_OPTIMIZER Rank options strategies by outlook + vol view $0.08 (paid-only)
QUANTORACLE_RECOMMEND_HEDGE Compare protective put / collar / futures / partial hedges $0.04 (paid-only)
QUANTORACLE_REBALANCE_PLAN Exact rebalance trades + transaction cost estimate $0.05 (paid-only)
QUANTORACLE_MONTE_CARLO_SIM GBM portfolio projection with contributions/withdrawals $0.015
QUANTORACLE_IMPERMANENT_LOSS Uniswap v2/v3 IL calculator $0.005
QUANTORACLE_LIQUIDATION_PRICE Leveraged position liquidation price $0.002

File layout

Mirrors `packages/plugin-misc/src/coingecko/`:

```
packages/plugin-misc/src/quantoracle/
├── actions/
│ ├── backtestStrategy.ts
│ ├── computeImpermanentLoss.ts
│ ├── computeLiquidationPrice.ts
│ ├── optimizeOptionsStrategy.ts
│ ├── planRebalance.ts
│ ├── priceOption.ts
│ ├── recommendHedge.ts
│ ├── runFullRiskAnalysis.ts
│ └── runMonteCarlo.ts
└── tools/
└── index.ts # shared fetch helper + per-endpoint methods
```

Plus wiring in `packages/plugin-misc/src/index.ts` (9 action imports + 9 method entries).

Notes

  • No new dependencies — uses native `fetch`.
  • All actions return `{ status: 'success', result }` on success or `{ status: 'error', message }` on failure, matching the coingecko pattern.
  • Zod schemas use minimal typed field shapes (per contributor guidance from PR fix: replace ZodType<any> with minimal schema type to prevent TS OOM #499 about TS OOM).
  • Could be the first x402-native integration in the kit — happy to extend to all 73 endpoints in a follow-up.

Links

Adds QuantOracle to packages/plugin-misc. QuantOracle is a deterministic
quantitative finance API with 63 calculators + 10 composite workflows,
offering a 1000 free calls/IP/day tier and x402 USDC payments on Base
or Solana for paid endpoints.

This PR surfaces 9 high-value actions (8 composites + Black-Scholes)
rather than exposing all 73 endpoints to keep scope reviewable:

- QUANTORACLE_PRICE_OPTION: Black-Scholes pricing + 10 Greeks
- QUANTORACLE_FULL_RISK_ANALYSIS: Complete risk tearsheet in one call
- QUANTORACLE_BACKTEST_STRATEGY: SMA/RSI/momentum/Bollinger backtests
- QUANTORACLE_OPTIONS_STRATEGY_OPTIMIZER: Rank options strategies by
  outlook + vol view
- QUANTORACLE_RECOMMEND_HEDGE: Compare cheapest hedges for a position
- QUANTORACLE_REBALANCE_PLAN: Generate rebalance trades + cost estimate
- QUANTORACLE_MONTE_CARLO_SIM: GBM portfolio simulation
- QUANTORACLE_IMPERMANENT_LOSS: Uniswap v2/v3 IL calculator
- QUANTORACLE_LIQUIDATION_PRICE: Leveraged position liquidation price

Notes:
- No new dependencies required (uses native fetch).
- Follows the same file layout as packages/plugin-misc/src/coingecko/.
- 402 responses surface a clear payment-required error with x402
  payment instructions (Base + Solana); the plugin itself does not
  auto-pay — downstream x402 clients can handle that.

API: https://api.quantoracle.dev
Repo: https://github.com/QuantOracledev/quantoracle
@fel123
Copy link
Copy Markdown
Author

fel123 commented May 1, 2026

Friendly check-in — this PR has been open for ~13 days with no reviews yet. Happy to address any feedback whenever a maintainer has bandwidth.

Quick status update since opening:

  • Live & in production: the underlying API at https://api.quantoracle.dev has been serving real on-chain x402 settlements continuously, including 9 organic paid composite-workflow calls in the last 14 days (backtest, hedging, full-analysis, rebalance) — so this isn't a stub integration.
  • Listed in CDP Bazaar: all 73 priced endpoints are auto-indexed at https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources with current lastUpdated timestamps tracking real settlements.
  • Multi-chain x402: Base mainnet + Solana mainnet both supported (this is the Solana-relevant part for solana-agent-kit users — paid calls can settle in USDC on Solana directly).
  • MCP registry: io.github.fel123/quantoracle@2.4.0 (latest, active).

Scope kept deliberately small (9 high-leverage actions wrapping composite workflows, not all 73 raw endpoints) so the review is tractable. The free tier (1,000 calls/IP/day, no API key) means anyone reviewing this can run the actions end-to-end without paying anything.

Let me know if you'd like me to adjust the action surface, split the PR, or anything else.

@fel123
Copy link
Copy Markdown
Author

fel123 commented May 14, 2026

Quick update since the May 1 check-in:

Solana-native example shipped today at integrations/agentkit/example-agent-solana.ts — uses SolanaKeypairWalletProvider with networkId="solana-mainnet" and routes x402 paid composites through SPL USDC. Pattern would translate cleanly to a solana-agent-kit action if this PR lands.

Mainnet usage: QuantOracle's x402 endpoints have now processed 171 settled transactions ($2.50 USDC) across Base and Solana, including confirmed Solana mainnet settlements via the Coinbase facilitator. The Solana facilitator route has noticeably lower per-call overhead than Base (sub-second settlement vs ~2s), which makes Solana the better fit for high-frequency agent workflows — exactly the audience solana-agent-kit serves.

Happy to address any feedback whenever a maintainer has bandwidth. Nothing in the PR requires changes from your side; just wanted to flag the new Solana-specific work in case it's helpful context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant