# PreFlight Pre-trade & pre-sign checks for autonomous agents: everything an agent verifies BEFORE signing a transaction — token due diligence, calldata red-flag decoding, oracle freshness, holder concentration, bridge routing with executable calldata, cross-venue perp funding, gas and price sanity checks. EVM chains: Ethereum, Base, Arbitrum, Optimism. Settles USDC on Base mainnet via the x402 protocol. No API key, no signup — payment is auth. ## Endpoints - GET https://meryol-agenticmarket-x402.hf.space/search ($0.003 USDC) Web search for agents: real-time results from a self-hosted meta-search engine (multiple engines aggregated). Returns ranked results with title, url, snippet, source engine, and score, plus instant answers and suggestions when available. Query params: ?q= (required), &max_results=1-20, &categories=general|news|it|science. No API key, pay per request. - GET https://meryol-agenticmarket-x402.hf.space/perps/funding/{market} ($0.005 USDC) Pre-trade funding check for perp positions: one call aggregates live funding across Hyperliquid + dYdX + Aevo for a ticker (BTC, ETH, SOL, …). Per-venue 8h funding, annualized APR, open interest USD, mark price, and cross-venue median APR. Spot delta-neutral carry or skewed funding before opening a position. Cached 30s. - POST https://meryol-agenticmarket-x402.hf.space/token/dd ($0.05 USDC) Pre-trade token due diligence in one call: GoPlus security flags + aggregate DEX liquidity across ALL pairs + top-10 holder concentration + LLM narrative. Returns verdict (safe / risky / honeypot / rug_pattern), 0-100 score, top_risks, should_trade, recommended_position_size, and verifiable key_metrics. Partial verdict (never charged for 'unknown') if a source is down. - POST https://meryol-agenticmarket-x402.hf.space/tx/explain ($0.015 USDC) Pre-sign sanity check with a machine-actionable verdict: decoded calldata + 2-3 sentence explanation + verdict (safe / review / danger) + recommended_action (approve / decline / ask_user). The last gate before an agent broadcasts a transaction. POST body: {chain, to, data, value?}. - POST https://meryol-agenticmarket-x402.hf.space/bridge/route ($0.01 USDC) Executable cross-chain bridge route via LiFi: estimated out, fee USD, gas USD, ETA, AND transaction_request — ready-to-sign calldata, so one paid call returns an executable bridge tx. POST body: {from_chain, to_chain, from_token ('usdc' alias ok), to_token, amount (atomic), from_address (required)}. Chains: ethereum, base, arbitrum, optimism, polygon, bsc, avalanche. - POST https://meryol-agenticmarket-x402.hf.space/decode/tx ($0.003 USDC) Pre-sign calldata decode: function signature (OpenChain + 4byte fallback), named/typed arguments, plain-English summary, and red_flags array — unlimited token approvals, approvals to unverified spenders, NFT blanket setApprovalForAll, calls to unverified contracts, native ETH sends. Drainer/permit-attack defense before an agent signs anything. POST body: {chain, to, data, value?}. - GET https://meryol-agenticmarket-x402.hf.space/oracle/freshness/{chain}/{feed} ($0.002 USDC) Pre-execution oracle staleness check: direct eth_call to a Chainlink aggregator's latestRoundData(). feed = 0x-address OR alias (eth-usd, btc-usd, usdc-usd). Returns scaled answer, updated_at, staleness vs the feed's real heartbeat, and is_safe_to_use. Call before borrows or oracle-dependent execution. Chains: ethereum, base, arbitrum, optimism. - GET https://meryol-agenticmarket-x402.hf.space/holders/top/{chain}/{token} ($0.003 USDC) Pre-trade exit-liquidity check for an ERC-20: top-10 holder concentration %, ex-LP/ex-known-router concentration, per-holder balance %, contract-or-EOA flag. High concentration = thin exit liquidity. Chains: ethereum, base, arbitrum, optimism. - GET https://meryol-agenticmarket-x402.hf.space/price/cross/{chain}/{token} ($0.002 USDC) Pre-quote price sanity check: median across CoinGecko + DexScreener + GeckoTerminal with per-source quotes and spread in bps (broken >20%-off sources excluded from spread, kept visible). token = ticker (eth/btc/usdc/usdt/dai/aero…) or any ERC-20 address. Detects stale or divergent feeds before an agent quotes or trades. Chains: ethereum, base, arbitrum, optimism. - GET https://meryol-agenticmarket-x402.hf.space/gas/now/{chain} ($0.001 USDC) Pre-broadcast gas check: base fee + p50/p90 priority fee in gwei from eth_feeHistory, plus USD cost per common tx type (native transfer, ERC-20 transfer, swap) at live ETH/USD. Size gas budgets or postpone txs under congestion. Never returns null costs — degraded upstreams are a free 502, not a paid empty answer. Chains: ethereum, base, arbitrum, optimism. - GET https://meryol-agenticmarket-x402.hf.space/chain/health/{chain} ($0.001 USDC) Pre-burst chain liveness check: probes a pool of public RPCs in parallel; median block number, max lag between RPCs, head age, latency, 0-100 health score. Call before timing a tx burst or switching RPC. Chains: ethereum, base, arbitrum, optimism. - GET https://meryol-agenticmarket-x402.hf.space/farcaster/{query} ($0.002 USDC) Counterparty identity check via Farcaster: pass username (no @) or FID integer. Returns FID, username, display name, bio, pfp URL, follower / following counts, custody address, and verified 0x addresses. Identity primitive for social-aware agents. - GET https://meryol-agenticmarket-x402.hf.space/health (free) Liveness probe; returns receiver address and network. ## Payment - Network: Base mainnet (eip155:8453) - Token: USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) - Protocol: x402 v2 (https://x402.org) - Facilitator: https://api.cdp.coinbase.com/platform/v2/x402 - Gas is paid by the facilitator; you only need USDC on Base. ## Flow 1. GET (or POST) the endpoint without payment → 402 + PAYMENT-REQUIRED header with base64-encoded JSON terms. 2. Sign EIP-3009 transferWithAuthorization with your wallet. 3. Repeat the request with PAYMENT-SIGNATURE header → 200 + JSON body, plus PAYMENT-RESPONSE header containing the on-chain tx hash. ## Discovery - CDP Bazaar: https://api.cdp.coinbase.com/platform/v2/x402/discovery/merchant?payTo=0x8eeF0E8b6a65911f848976388C26b3CcDA4Ab601 - x402 well-known: https://meryol-agenticmarket-x402.hf.space/.well-known/x402 - A2A agent card: https://meryol-agenticmarket-x402.hf.space/.well-known/agent.json - Sitemap: https://meryol-agenticmarket-x402.hf.space/sitemap.xml - OpenAPI: https://meryol-agenticmarket-x402.hf.space/openapi.json