The problem: agents that hallucinate numbers
A Sui DeFi agent that manages a leveraged position on Suilend, or rebalances an LP on Cetus, has to answer quantitative questions: Where do I get liquidated? What's my impermanent loss if SUI doubles? What's the cheapest hedge? If the agent lets the LLM do that arithmetic in-context, it drifts — Black-Scholes Greeks routinely come out 5–30% off, and the model can't tell. On a position with real money, that's not a rounding error; it's a liquidation.
The fix is the same one every serious agent uses: don't let the model compute, let it call a tool. QuantOracle exposes 73 deterministic quant calculators (plus a batch endpoint) behind a plain HTTP API — same inputs, same outputs, every time, citation-tested against Hull and Wilmott. The only question is how to wire it into a Sui agent.
Route A — MCP (recommended, zero code)
The Sui agent ecosystem is MCP-native — the Sui AI Agent Kit standardizes DeFi tool access over the Model Context Protocol, and most agent hosts speak it. QuantOracle runs a hosted MCP server that exposes all 79 tools. Point your agent at it and you're done — no install, no build, no wallet:
{
"mcpServers": {
"quantoracle": {
"url": "https://mcp.quantoracle.dev/mcp"
}
}
}Or run it over stdio with npx quantoracle-mcp. Either way the agent can now call options_price, crypto_liquidation-price, risk_full-analysis, and the rest. The free tier — 1,000 calls per IP per day — needs no API key, so this works for any Sui or Talus agent immediately, regardless of chain.
Route B — the portable tool-pack
If your agent isn't MCP-based — a custom TypeScript agent, or a framework that wants its own tool objects — install the tool-pack instead:
npm install @quantoracle/sui-agent-kit zodEvery tool is a plain { name, description, schema, execute } object (zod schema), so it adapts to any TypeScript agent framework in a few lines. Call one directly:
import { quantOracleTools } from "@quantoracle/sui-agent-kit";
const liq = quantOracleTools.find((t) => t.name === "quant_liquidation_price")!;
const result = await liq.execute({
entry_price: 3.5, // SUI perp entry
collateral: 500,
position_size: 2500,
leverage: 5,
direction: "long",
});
console.log(result.liquidation_price); // deterministic, every timeTo hand the whole set to a LangChain-style executor (the common bridge for Talus/Nexus offchain tools and several Sui kits), the zod schemas plug straight in:
import { DynamicStructuredTool } from "@langchain/core/tools";
import { quantOracleTools } from "@quantoracle/sui-agent-kit";
const tools = quantOracleTools.map(
(t) =>
new DynamicStructuredTool({
name: t.name,
description: t.description,
schema: t.schema,
func: async (args) => JSON.stringify(await t.execute(args)),
})
);A worked example: a Sui DeFi risk agent
Say your agent watches a leveraged SUI position and an LP. The three questions it needs answered map cleanly onto three tools:
quant_liquidation_price— how close is the perp to liquidation? (free)quant_impermanent_loss— what's the LP losing vs holding as SUI moves? (free)quant_risk_full_analysis— the full tearsheet (Sharpe, VaR, CVaR, Kelly leverage, max drawdown) on the strategy's return series, in one call. ($0.04 via x402)
The agent calls the two free tools every tick, and the paid composite when it needs a full risk read before sizing up. Each number is grounded — when the agent says "you're 18% from liquidation and Kelly says de-size," those are computed values it can defend, not vibes.
Payments: free first, x402 when you scale
Most of what an agent does fits the free tier (1,000 calls/IP/day, no wallet). Past that, and for the paid-only composites, endpoints return an HTTP 402 with x402 payment requirements. x402 settles in USDC on Base or Solana today — a Sui agent can pay with a Base or Solana wallet through any x402-capable client. Native Sui settlement will follow as the x402-on-Sui rail (gasless stablecoin transfers) matures. The point: you never pay until you've outgrown free, and there's no signup in the way.
Why deterministic tools beat in-context math
The whole reason Talus emphasizes verifiable agentic actions is that onchain systems need outputs you can trust and reproduce. In-context LLM arithmetic is the opposite — non-deterministic and unauditable. Routing the math through a deterministic API gives you the same property offchain: the agent's recommendation is a pure function of its inputs, so it can be logged, replayed, and audited later. That's the bar for an agent touching real positions.
Get started
The fastest path is Route A — drop the MCP URL into your agent config and start calling. The tool-pack source, the curated tool list, and adapter snippets live in the integration on GitHub. Spot-check any tool's output against the free liquidation and impermanent-loss calculators on the site before you wire it into anything that moves money.
Related
- Add 73 quant tools to your agent with MCP — the MCP server this integration uses, in depth
- Chaining x402 paid tool calls — how the paid composites settle in an agent loop
- Batch API calls for speed — price a whole option chain or scan many positions in one request
- Crypto liquidation calculator — the browser version of the tool your agent calls