Insight Logo
Insight
Oracle evidence
Price Query
VerifyPricing

Insight — Reference index

Evidence before execution.

Insight LogoInsight

Oracle transparency and risk infrastructure for DeFi. 15-minute price verification, cross-oracle comparison, position safety checks, and programmatic data access across 10+ providers and 40+ blockchain networks.

Platform

  • Home
  • Price Query
  • Price Insight
  • Oracle Directory
  • Daily Reports
  • API
  • Pricing
  • AI Agents
  • Guard SDK

Safety

  • Safety Check
  • Pre-Trade Safety Check
  • Oracle Watch
  • Stablecoin Depeg
  • Wrapped Asset Peg

Resources

  • Documentation
  • API Reference
  • AI / MCP Docs
  • Guard SDK Docs
  • GitHub

© 2026 Insight. All rights reserved.

Privacy PolicyTerms of ServiceRefund PolicyContact

12 — Integrate

Guard SDK reference · Server-side workflow orchestration

View SDK overview

Build the safe execution path into your agent.

Guard is a TypeScript client over Insight’s existing API. It does not carry local risk rules or signing keys: API-side verdicts, attestations, audit records, and credits remain authoritative.

  • 01Typed workflow
  • 02Server-side key use
  • 03Verifiable receipts

01 — Install

Use a trusted server or agent runtime.

The API key unlocks paid endpoints, so keep it in a server environment variable. Do not ship it to a browser or client wallet application.

Install
npm install oracle-insight-guard

02 — Pre-trade gate

Check before creating a transaction.

check() returns an explicit decision. assertSafe() is available for executors that prefer an exception on DANGER or BLOCK. Guard defaults new checks to signed schema v3.

Pre-trade gate
const guard = new InsightGuard({
  apiKey: process.env.INSIGHT_API_KEY!,
});

const decision = await guard.check({
  asset: 'ETH',
  chainId: 1,
  action: 'swap',
  tradeAmountUsd: 100_000,
  destinationAsset: 'USDC',
});

if (!decision.allowed) {
  // Do not create or submit a transaction.
  return decision.result;
}

03 — Verified receipt workflow

Supply both sides of a swap before submitting it.

A destination-per-source fill price needs two independent pre-trade proofs. Guard validates that the pair is reciprocal before calling your transaction submitter, then sends both originals with the settled transaction hash to the receipt issuer.

executeSwap
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 },
  receipt: { settlementChainId: 1, maxSlippageBps: 50 },
  submitTransaction: async () => ({ txHash: await submitSwap() }),
});

if (result.status === 'executed') {
  // bindingMode is VERIFIED because both signed pre-trade proofs were supplied.
  console.log(result.receipt.attestation.uid);
}

04 — Oracle Watch

Wire halt to a real pause action.

Normal cadence

watch() defaults to 15 minutes. Faster polling needs an explicit opt-in because it consumes more C3 calls and usually yields no fresher data.

Halt semantics

Bind onHalt to pause your executor. Pass the same watchTargetto executeSwap to prevent a new submission while that halt is active.

Billing and verification boundary

Guard uses the same API key and credit wallet as direct API calls. Pre-Trade and Oracle Watch are C3 calls; execution receipt issuance is C4. A successful two-sidedexecuteSwap() uses two C3 calls and one C4 call (20 credits at current prices), before optional Watch polling. REST API, AI/MCP, and Guard are distinct integration surfaces that draw from the same wallet. A valid signed receipt proves the issuer and integrity of its bytes; it is not a guarantee that the market price or trade was correct.

API access and keysAPI reference