@blockquantbase/agentkit-actions
v1.0.3
Published
Coinbase AgentKit action provider for the BlockQuant B2B Gateway — buy Base Mainnet WETH/USDC tick data and sandboxed backtests over x402, paid automatically in USDC with your agent's own wallet.
Maintainers
Readme
@blockquantbase/agentkit-actions
Coinbase AgentKit action provider for the BlockQuant B2B Gateway.
Give any AgentKit agent the ability to buy Base Mainnet WETH/USDC (0.05%) tick
data and run sandboxed backtests — paid automatically in USDC over the
x402 protocol with the agent's own wallet. No API keys,
no manual invoicing: the agent hits a paid endpoint, the gateway answers 402,
and this provider signs + settles the payment and replays the request.
Actions
| Action | Inputs | Endpoint | Price |
|---|---|---|---|
| download_archive | date | GET /api/v1/data/archive/:date | $5 USDC |
| stream_ticks | date, fromBlock?, limit?, format? | GET /api/v1/data/stream | $1 USDC |
| execute_matrix_sweep | dates, timeframe, profitTarget, stopLoss, bidLayers? | POST /api/v1/matrix/backtest | $25 USDC |
Prices are enforced by the gateway's live 402 challenge — they are never
hardcoded into the payment path, so they can't drift.
Install
npm install @blockquantbase/agentkit-actionsThis package declares peer dependencies it expects your AgentKit project to already provide, plus pulls in the x402 payment client:
npm install @coinbase/agentkit axios zod # peers (you almost certainly have these)
# x402-axios is installed automatically as a dependencyPin the peer ranges to whatever versions your installed AgentKit stack uses.
Wire it into your AgentKit agent
import { AgentKit } from "@coinbase/agentkit";
import { blockquantActionProvider } from "@blockquantbase/agentkit-actions";
// Your existing wallet provider (CDP, viem, etc.) — must be on Base.
// It needs a small USDC balance on Base to pay for calls.
const agentKit = await AgentKit.from({
walletProvider, // your Base wallet provider
actionProviders: [
blockquantActionProvider(), // ← adds the three BlockQuant actions
// ...your other providers
],
});With LangChain
import { getLangChainTools } from "@coinbase/agentkit-langchain";
const tools = await getLangChainTools(agentKit);
// `tools` now includes blockquant_download_archive / blockquant_stream_ticks /
// blockquant_execute_matrix_sweep — hand them to your agent executor.With the Vercel AI SDK
import { getVercelAITools } from "@coinbase/agentkit-vercel-ai-sdk";
const tools = getVercelAITools(agentKit);Configuration
| Env var | Default | Purpose |
|---|---|---|
| BLOCKQUANT_API_BASE_URL | https://api.blockquant.tech | Gateway origin |
| BLOCKQUANT_OUTPUT_DIR | ./blockquant-data | Where download_archive writes the .zip |
Requirements
- Network: Base Mainnet (
8453) or Base Sepolia (84532). The provider gates itself to Base viasupportsNetwork(). - Funds: the agent's wallet needs USDC on Base to settle calls (and a little ETH for gas on settlement).
- Node: >= 20.
How payment works
Every action routes through an x402-axios
payment interceptor:
- The action calls the gateway endpoint with no payment.
- The gateway replies
402 Payment Requiredwith the price, USDC asset, Base network, and pay-to address. - The interceptor signs an EIP-3009
transferWithAuthorizationfor USDC using your AgentKit wallet, attaches it as theX-Paymentheader, and replays the request. - The gateway verifies + settles on-chain and returns the data. The decoded
settlement receipt is included in each action's result (
paymentfield).
License
MIT © BlockQuant
