# DeFi Shield Gas Oracle

> DeFi Shield Gas Oracle is a paid API for AI agents from defi-shield-hazel.vercel.app, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-15).

Returns current gas prices with swap cost estimates and timing recommendations for DeFi transactions

## Facts

- Endpoint: POST https://defi-shield-hazel.vercel.app/api/mev/gas-oracle
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defi-shield-hazel-vercel-app-9345084b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mjaRnVuPIewEFaQ010ttY

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability defi-shield-hazel-vercel-app-9345084b -d '<json body>'
```

Example prompt: What are the current gas prices and how much would a typical token swap cost right now — and should I wait for cheaper gas or execute now?

## When to prefer this

Use this endpoint when an agent needs to decide whether to execute a DeFi swap or transaction based on current network congestion and cost. Ideal for transaction routing agents, DeFi bots, or portfolio managers that need to time transactions. Prefer over generic gas APIs when you also need swap-specific cost estimates and actionable timing recommendations bundled together.

## Known failure modes

- Gas oracle data unavailable due to RPC node issues — returns 503
- Invalid request body parameters — returns 400 with validation error
- Payment not processed — returns 402 requiring x402 payment of $0.05 USDC
- Upstream gas price feed timeout — returns 504
- Rate limit exceeded — returns 429

## Output

Returns current gas price levels (base fee, priority fee, gwei estimates), estimated cost for a swap transaction in USD/ETH, and a timing recommendation indicating whether current conditions are favorable, expensive, or neutral for transacting.

## Example request

```json
{
 "chainId": 1,
 "tokenIn": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
 "amountIn": "1000000000",
 "tokenOut": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
 "slippageTolerance": 0.5
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "bodyType",
    "body",
    "method"
   ],
   "properties": {
    "body": {
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/defi-shield-hazel-vercel-app-9345084b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from defi-shield-hazel.vercel.app](https://www.zero.xyz/host/defi-shield-hazel.vercel.app/llms.txt)
