Engineered for autonomous AI trading agents, LangChain/CrewAI tool runtimes, and quantitative execution bots. One atomic JSON call merges live GoPlus Bytecode Honeypot Audits, DexScreener Cross-Pool Depth + AMM Price Impact Sizing, and Fee-Adjusted Binance/Bybit Perpetual Funding Spreads into a deterministic execution signal.
Initializing live M2M Oracle v2.0 handshake...
# 1. Trigger HTTP 402 Payment Required -> Returns v2.0 Pricing, Base/Solana Wallets & OpenAPI Discovery curl -i -X GET "https://meer9374-a11y.github.io/neonops-web3-suite/m2m.html" curl -i -X GET "http://localhost:3402/api/v1/intel?token=0x4200000000000000000000000000000000000006&chain=base&symbol=ETH¬ional_usd=25000" # 2. Free Preview Endpoint (3 calls/day per IP, includes v2.0 Quant Execution Sizing & SWR Freshness) curl -s "http://localhost:3402/api/v1/preview?token=0x4200000000000000000000000000000000000006&chain=base&symbol=ETH¬ional_usd=25000" | jq . # 3. Paid M2M Call (0.25 USDC single call OR 19.00 USDC to receive reusable 24h X-Issued-API-Key: nk_live_24h_...) curl -i -X GET "http://localhost:3402/api/v1/intel?token=0x4200000000000000000000000000000000000006&chain=base&symbol=ETH¬ional_usd=25000" \ -H "X-Payment-Chain: base" \ -H "X-Payment-Tx-Hash: 0xYOUR_CONFIRMED_BASE_USDC_TX_HASH" # 4. Subsequent Zero-Latency Calls Using Issued 24h Session Key curl -s -X GET "http://localhost:3402/api/v1/intel?token=0x4200000000000000000000000000000000000006&chain=base&symbol=ETH¬ional_usd=50000" \ -H "X-API-Key: nk_live_24h_YOUR_ISSUED_SESSION_TOKEN" | jq .
import os, requests
from web3 import Web3
API_URL = os.getenv("NEON_ORACLE_URL", "http://localhost:3402/api/v1/intel")
BASE_RPC = "https://mainnet.base.org"
ERC20_ABI = [{"constant":False,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"type":"function"}]
SESSION_CACHE = {"api_key": os.getenv("NEON_API_KEY")}
def pay_base_usdc_onchain(recipient: str, amount_usdc: float) -> str:
"""Autonomously signs and broadcasts a Base Mainnet USDC transfer when challenged with HTTP 402."""
priv_key = os.environ["AGENT_EVM_PRIVATE_KEY"]
w3 = Web3(Web3.HTTPProvider(BASE_RPC))
acct = w3.eth.account.from_key(priv_key)
usdc = w3.eth.contract(address=Web3.to_checksum_address("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"), abi=ERC20_ABI)
raw_amount = int(round(amount_usdc * 1_000_000))
tx = usdc.functions.transfer(Web3.to_checksum_address(recipient), raw_amount).build_transaction({
"from": acct.address,
"nonce": w3.eth.get_transaction_count(acct.address),
"gas": 65000,
"maxFeePerGas": w3.eth.gas_price * 2,
"maxPriorityFeePerGas": w3.to_wei("0.001", "gwei"),
"chainId": 8453
})
signed = acct.sign_transaction(tx)
tx_hash = w3.eth.send_raw_transaction(signed.raw_transaction)
w3.eth.wait_for_transaction_receipt(tx_hash, timeout=30)
return tx_hash.hex()
def query_neon_oracle_v2(token_address: str, chain: str = "base", symbol: str = "ETH", notional_usd: float = 25000, buy_24h_pass: bool = False):
params = {"token": token_address, "chain": chain, "symbol": symbol, "notional_usd": notional_usd}
headers = {"X-Payment-Chain": "base"}
if SESSION_CACHE.get("api_key"):
headers["X-API-Key"] = SESSION_CACHE["api_key"]
resp = requests.get(API_URL, params=params, headers=headers, timeout=10)
if resp.status_code == 402:
spec = resp.json()
recipient = spec["payment_destinations"]["base"]["recipient_wallet"]
tier_key = "pass_24h" if buy_24h_pass else "per_call"
usdc_due = spec["pricing"][tier_key]["amount_usdc"]
print(f"[HTTP 402 Challenge] Auto-paying {usdc_due} USDC on Base to {recipient}...")
if "AGENT_EVM_PRIVATE_KEY" not in os.environ:
return spec
tx_hash = pay_base_usdc_onchain(recipient, usdc_due)
resp = requests.get(API_URL, params=params, headers={"X-Payment-Chain": "base", "X-Payment-Tx-Hash": tx_hash}, timeout=10)
issued_key = resp.headers.get("X-Issued-API-Key") or resp.json().get("payment_receipt", {}).get("session_pass", {}).get("apiKey")
if issued_key:
SESSION_CACHE["api_key"] = issued_key
resp.raise_for_status()
return resp.json()
from langchain_core.tools import tool
import requests, os
@tool
def neon_m2m_crypto_risk_and_arb_oracle_v2(
token_address: str,
chain: str = "base",
symbol: str = "ETH",
notional_usd: float = 25000.0
) -> dict:
"""
NeonOracle x402 v2.0 M2M Tool for Autonomous Trading Agents.
Returns composite contract risk score (0-100), GoPlus honeypot/tax audit,
DexScreener pool depth + AMM price impact in bps for `notional_usd`,
and fee-adjusted Binance/Bybit perpetual funding arbitrage APR.
"""
api_key = os.getenv("NEON_24H_API_KEY", "")
tx_hash = os.getenv("NEON_PAYMENT_TX_HASH", "")
pay_chain = os.getenv("NEON_PAYMENT_CHAIN", "base")
base_url = os.getenv("NEON_ORACLE_BASE_URL", "http://localhost:3402")
endpoint = f"{base_url}/api/v1/intel" if (api_key or tx_hash) else f"{base_url}/api/v1/preview"
headers = {"X-Payment-Chain": pay_chain}
if api_key:
headers["X-API-Key"] = api_key
elif tx_hash:
headers["X-Payment-Tx-Hash"] = tx_hash
r = requests.get(
endpoint,
params={"token": token_address, "chain": chain, "symbol": symbol, "notional_usd": notional_usd},
headers=headers,
timeout=10
)
return r.json()