
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@cryptyx/x402-client
Advanced tools
Typed x402 client for CRYPTYX — the conviction engine for autonomous crypto trading agents. 60 pay-per-call endpoints spanning signals, factor scores, regime detection, backtests, walk-forward validation, and institutional-grade trigger evidence. Wraps @x
Typed x402 client for CRYPTYX — institutional crypto intelligence for autonomous trading agents. 60 pay-per-call endpoints. USDC on Base. No API keys, no accounts, no rate cards.
npm install @cryptyx/x402-client viem
import { Cryptyx } from '@cryptyx/x402-client';
const cx = new Cryptyx({
wallet: process.env.WALLET_PRIVATE_KEY!, // any viem WalletClient or 0x private key
network: 'base',
maxSpend: 5.00, // USDC hard ceiling
onPay: (r) => console.log(`$${r.priceUsd} → ${r.route} (${r.txHash})`),
});
// Institutional trigger evaluation — one call, full evidence packet
const trigger = await cx.api.triggers.preset({
preset_id: 'treasury_manager_classic',
asset: 'BTC',
});
if (
trigger.trigger.fires_now &&
(trigger.backtest_evidence.sharpe_ratio ?? 0) > 0.3 &&
(trigger.backtest_evidence.profit_factor ?? 0) > 1.5
) {
// Execute on your chosen venue: OKX, Coinbase, Kraken, Hyperliquid, Binance
}
Wraps the entire CRYPTYX x402 API surface — 60 endpoints across:
Every response follows the same envelope: { ok, ..., _next?, _cache? }. The _next.hints block on every response guides agents to the natural follow-up endpoint — no external documentation needed.
Building an autonomous agent that trades crypto? You need three things:
CRYPTYX is the intelligence layer. Ask "should I trade BTC right now?" and get a walk-forward-validated evidence packet with hit rate, Sortino, max drawdown, and regime context — not a chatbot's opinion. Pay-per-call in USDC on Base. Framework-agnostic (works with any wallet, any exchange).
import { Cryptyx } from '@cryptyx/x402-client';
const cx = new Cryptyx({
wallet: '0x...',
network: 'base',
});
const brief = await cx.api.ai.marketBrief();
console.log(brief.brief); // LLM-ready market summary
import { CdpWalletProvider } from '@coinbase/agentkit';
import { Cryptyx } from '@cryptyx/x402-client';
const walletProvider = await CdpWalletProvider.configureWithWallet({ ... });
const cx = new Cryptyx({
wallet: walletProvider.getViemWalletClient(),
network: 'base',
});
import { createWalletClient, http } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { base } from 'viem/chains';
import { Cryptyx } from '@cryptyx/x402-client';
const account = privateKeyToAccount('0x...');
const wallet = createWalletClient({ account, chain: base, transport: http() });
const cx = new Cryptyx({ wallet, network: 'base' });
Every CRYPTYX response includes a _next.hints block pointing at natural follow-ups. Chain them programmatically:
const catalog = await cx.api.signals.catalog();
const chain = cx.chain(catalog, '/api/signals/catalog');
await chain.follow('/api/signals/top');
await chain.follow('/api/signals/backtest', undefined, {
signal_id: 'TR_MOMO_CONT_14D',
from: '2026-01-01',
to: '2026-07-01',
dryrun: true,
});
const all = chain.collect(); // { path → response } for every step
Four trigger endpoint families:
// Curated preset (5-year backtest cache, fastest)
await cx.api.triggers.preset({ preset_id: 'treasury_manager_classic', asset: 'BTC' });
// Single-metric z-score threshold — pass any metric_id
await cx.api.triggers.zScore({
asset: 'BTC',
metric_id: 'TR_ROC_7D',
operator: 'abs_gt',
threshold: 1.5,
});
// Cross-window differential — the generalised crossover primitive
await cx.api.triggers.zDifferential({
asset: 'BTC',
metric_a_id: 'VOL_RV_7D',
metric_b_id: 'VOL_RV_30D',
operator: 'abs_gt',
threshold: 1.0,
});
// Arbitrary predicate — anything expressible in Metric Slicer
await cx.api.triggers.custom({
asset: 'BTC',
horizon: '14d',
definition: {
type: 'composite',
logic: 'AND',
conditions: [
{ metric_id: 'TR_ROC_7D', operator: 'abs_gt', threshold: 1.5 },
{ metric_id: 'VOL_RV_7D', operator: 'lt', threshold: 1.0 },
],
},
});
Every response returns the same institutional evidence envelope:
{
trigger: { asset, horizon, asof_day, fires_now, confidence, expression },
backtest_evidence: {
sample_size, date_start, date_end,
hit_rate, mean_return,
sharpe_ratio, sortino_ratio,
max_drawdown, profit_factor,
},
regime_context: { current_regime, regime_streak_days, conditional_hit_rate },
recent_performance: { last_10_triggers, rolling_30d_hit_rate, rolling_90d_hit_rate },
}
Set a hard USDC ceiling; any call that would exceed it throws before the payment is signed:
const cx = new Cryptyx({ wallet, maxSpend: 1.00 });
// ... spends $0.99 across several calls ...
await cx.api.intelligence.query('...'); // $0.25 — throws, current $0.99 + $0.25 > $1.00
Reset the counter when you want to continue:
cx.resetSpend();
console.log(cx.spent); // 0
console.log(cx.remaining); // maxSpend
console.log(cx.history); // full receipt list
All 60 endpoints are grouped on cx.api.*:
cx.api.signals — catalog, top, active, recent, leaderboard, explain, backtest, simulate, fork, eval, composite (attribution / backtest / breadth / heatmap / momentum / custom)cx.api.asset — thesis, thesisJournal, activeSignals, signalEvents, topSetups, topPredictors, asymmetry, peerCluster, regimeContext, regime, metricHealthcx.api.marketPulse — snapshot, regime, divergences, heroTimeline, compositeBreakdown, conviction, factorCrossSection, temporalLayers, regimeCellContext, regimeDivergencecx.api.metrics — slicer, slicerComposite, slicerScan, previewcx.api.triggers — preset, zScore, zDifferential, customcx.api.ai — context, marketBrief, tradeIdeas, signals, metricscx.api.data — assets, marketHistory, assetRegimes, assetFactors, assetLiquidity, fundingRate, takerFlow, ivSurfacecx.intelligenceQuery(...) — natural-language entry pointcx.health() — service probeFull endpoint documentation: https://cryptyx.ai/docs/x402
MIT. Ship anything you want on top.
FAQs
Typed x402 client for CRYPTYX — the conviction engine for autonomous crypto trading agents. 60 pay-per-call endpoints spanning signals, factor scores, regime detection, backtests, walk-forward validation, and institutional-grade trigger evidence. Wraps @x
We found that @cryptyx/x402-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.