Assess before submitting
Run source and destination Pre-Trade checks. DANGER and BLOCK stop the workflow before your transaction function is called.

Transparency for decisions that matter
A price is a surface. Insight reveals the oracle sources, their agreement, their freshness, and the risk of acting on them — and returns a signed pre-trade verdict for AI agents that act on prices without a human in the loop.
Insight Guard SDK · Oracle intelligence for DeFi agents
Assess oracle risk without submitting a transaction, monitor conditions with Oracle Watch, or use the optional gated swap workflow. Insight supplies assessments and price/fill evidence; your application owns its decisions, signer, and execution.
Observe oracle conditions before and during an execution workflow.
Decide which verdicts halt the strategy and what to submit on-chain.
01 — One guarded workflow · npm v0.5.1
Use REST, MCP, or assessSwap() for oracle assessments. Use executeSwap() when you want the SDK to gate your transaction callback and request execution evidence.
Run source and destination Pre-Trade checks. DANGER and BLOCK stop the workflow before your transaction function is called.
Poll Oracle Watch at a bounded cadence and bind its halt signal to the strategy pause operation.
Bind signed source and destination assessments to observed settlement and report price/fill fidelity in a signed execution receipt.
02 — Quickstart
Install the package in a trusted agent runtime. Never expose an Insight API key in a browser bundle.
npm install oracle-insight-guardimport { InsightGuard } from 'oracle-insight-guard';
const guard = new InsightGuard({ apiKey: process.env.INSIGHT_API_KEY! });
const result = await guard.executeSwap({
source: {
asset: 'ETH', destinationAsset: 'USDC', chainId: 1,
action: 'swap', tradeAmountUsd: 100_000,
},
destination: {
asset: 'USDC', destinationAsset: 'ETH', chainId: 1,
action: 'swap', tradeAmountUsd: 100_000,
},
watchTarget: { symbol: 'ETH', chain: 'ethereum' },
receipt: { settlementChainId: 1, maxSlippageBps: 50 },
submitTransaction: async () => ({ txHash: await submitSwap() }),
});
if (result.status === 'blocked') return; // no transaction was submitted
console.log(result.receipt.executionStatus);03 — Between trades
Guard defaults to a 15-minute Watch cadence. A halt is remembered for that target; pass the same target to executeSwap to prevent a new submission while the halt is active.
const watch = guard.watch(
{ symbol: 'ETH', chain: 'ethereum' },
{
onHalt: async (signal) => strategy.pause(signal.reason),
onError: (error) => logger.error(error),
}
);Guard uses the same API key and the existing C3/C4 credit meter: pre-trade and Watch calls are C3; execution receipt issuance is C4. A successful two-sided guarded swap uses 20 credits at current prices (two C3 gates plus one C4 receipt), excluding Watch polling. There is no second billing model.