---
name: chainray.online
description: ChainRay provides on-chain data and analytics for EVM-compatible blockchains, covering token pricing, block metadata, gas fee forecasting, stablecoin supply, impermanent loss calculation, and MEV risk assessment. All endpoints are single-shot lookups sourced from on-chain DEX feeds, aggregators, and block data — no streaming or subscription capability is offered. The host targets agents that need factual, timestamped EVM chain data before or during DeFi decision-making.
host: chainray.online
---

# chainray.online

ChainRay is a read-only EVM analytics host serving agents that need structured on-chain data across networks such as Ethereum, Base, Arbitrum, and Polygon. It covers the pre-trade and monitoring use cases most relevant to DeFi workflows: current token prices, gas cost comparison, block inspection, stablecoin supply snapshots, LP impermanent loss quantification, and MEV risk heuristics. It does not execute transactions, stream live data, or support non-EVM chains like Solana or Bitcoin.

## When to use this host

Use ChainRay when an agent needs structured, timestamped EVM on-chain data for token prices, gas fees, block metadata, stablecoin supply, LP impermanent loss, or pre-trade MEV risk — particularly across Base, Ethereum, Arbitrum, and Polygon. The gas oracle is especially useful when chain selection is undecided and cost minimization matters. Do not use ChainRay for non-EVM chains (Solana, Bitcoin, etc.), real-time streaming or tick data, transaction execution or routing, private mempool access, or multi-asset (3+ token) pool calculations. For guaranteed MEV protection or private transaction routing, use Flashbots or a private RPC provider instead. For historical OHLCV or candlestick data, use a dedicated market data provider such as CoinGecko or Kaiko.

## Capabilities

### Token Pricing

Retrieves the current USD spot price and 24-hour market statistics for a token on a specified EVM chain, sourced from on-chain DEX and aggregator feeds.

- **`fetch-chainray-token-price`** — Returns the current spot price and 24h market data for a token on a specified blockchain network, sourced from on-chain DEX and aggregator feeds.

### Block Inspection

Fetches detailed metadata for a specific EVM block — including height, hash, timestamp, gas stats, transaction count, and miner — for either the latest or a historical block.

- **`fetch-block-info`** — Returns detailed metadata for a specified EVM blockchain block including height, hash, timestamp, gas stats, transaction count, and miner address.

### Gas Fee Intelligence

Provides both single-chain near-term gas fee forecasts with timing recommendations and multi-chain gas cost comparisons to identify the cheapest network for a transaction.

- **`fetch-gas-prediction`** — Returns a near-term gas fee forecast for a specified EVM chain, including current base fee, low/mid/high projections, trend direction, and a transaction-timing recommendation.
- **`fetch-gas-oracle`** — Returns real-time gas prices and ETH transfer cost estimates across up to 16 EVM chains, ranked by cost, with a cheapest-chain recommendation.

### Stablecoin Analytics

Returns on-chain stablecoin supply figures for a specific EVM network alongside global circulating supply and price data for major stablecoins like USDC, USDT, and DAI.

- **`fetch-stablecoin-supply`** — Returns on-chain stablecoin total supply for a specified EVM chain plus global circulating supply and price data for the top stablecoins across all chains.

### DeFi Position Risk

Quantifies impermanent loss for a two-asset LP position given entry and current prices, and provides a heuristic MEV risk assessment — including sandwich attack likelihood and recommended slippage — before a swap is executed.

- **`compute-impermanent-loss`** — Computes impermanent loss percentage and dollar loss per $10,000 for a liquidity provider position given entry and current token prices on a specified chain.
- **`fetch-mev-shield-advisory`** — Returns a heuristic MEV risk assessment for a swap on a specified blockchain, including sandwich risk score, recommended slippage, mitigations, and gas context.

## Workflows

### Pre-Swap Risk Check

*Use when an agent needs to evaluate the full cost and risk profile of a swap before submission, covering gas cost, MEV exposure, and current token price.*

1. **`fetch-chainray-token-price`** — Retrieve the current spot price of the input token to establish trade context and USD value.
2. **`fetch-gas-prediction`** — Fetch the near-term gas fee forecast for the target chain to determine optimal gas pricing and whether to delay the transaction.
3. **`fetch-mev-shield-advisory`** — Run a pre-trade MEV risk assessment using the token, chain, and trade amount to get sandwich risk score, recommended slippage, and mitigation strategies.

### Cross-Chain Gas Optimization

*Use when an agent needs to select the cheapest EVM chain for a transaction and then confirm the precise gas parameters on that chain before proceeding.*

1. **`fetch-gas-oracle`** — Compare current gas costs across up to 16 EVM chains to identify the cheapest network for the intended transaction.
2. **`fetch-gas-prediction`** — Fetch a detailed near-term gas forecast for the recommended cheapest chain to get low/mid/high projections and a timing recommendation.

### LP Position Evaluation

*Use when an agent needs to assess an existing or prospective liquidity provider position by combining current market price with impermanent loss calculation.*

1. **`fetch-chainray-token-price`** — Retrieve the current spot price of the token to use as the current price input for the IL calculation.
2. **`compute-impermanent-loss`** — Compute impermanent loss percentage and dollar loss using the entry price and the current price retrieved in the previous step.

## Skill reference

### `fetch-chainray-token-price`

**ChainRay Token Price** — Returns the current spot price and 24h market data for a token on a specified blockchain network, sourced from on-chain DEX and aggregator feeds.

*Use when:* Use when an agent needs the current USD spot price, market cap, 24h volume, or 24h price change for a token (e.g. ETH) on a specific chain (e.g. Base), with on-chain proof of the data.

*Not for:* Do not use for historical price data or price feeds on chains other than those supported by ChainRay. Not suitable for streaming or real-time tick data.

**Inputs:**

- `token` (string, required) — Token symbol or contract address to look up (e.g. ETH).
- `chain` (string) — Blockchain network to query (e.g. base).

**Returns:** Returns token symbol, priceUsd, source, chain, confidence, timestamp, marketCap, marketCapUsd, volume24h, volume24hUsd, priceChange24h, sources array, and an on-chain _proof object with block and data hash details.

**Example:** `GET https://chainray.online/price/ETH?chain=base&token=ETH`

---

### `fetch-block-info`

**ChainRay BlockLens** — Returns detailed metadata for a specified EVM blockchain block including height, hash, timestamp, gas stats, transaction count, and miner address.

*Use when:* Use when an agent needs on-chain block metadata (block number, hash, timestamp, gas usage, transaction count, miner) for a specific EVM network, either for the latest block or a historical block number.

*Not for:* Do not use for non-EVM chains (e.g., Solana, Bitcoin). Not suitable for streaming block data or subscribing to new blocks — this is a single-shot lookup.

**Inputs:**

- `chain` (string) — EVM chain to query. Supported values: base, ethereum, arbitrum, optimism, polygon, bsc, avalanche, zksync, linea, scroll, blast, mantle, gnosis, polygon-zkevm, mode, sei, celo, manta, taiko, fantom, cronos, opbnb, zora, worldchain, metis, fraxtal, kava, zetachain, filecoin, core-dao, aurora, moonbeam, klaytn, bob, canto. Defaults to base.
- `block` (integer) — Block number to retrieve. Omit to get the latest block.

**Returns:** Returns a JSON object with block number, hash, parent hash, ISO timestamp, gas used/limit, base fee, transaction count, miner address, block size, and a cryptographic proof object.

**Example:** `GET https://chainray.online/block-info?chain=base&block=45773062`

---

### `fetch-gas-prediction`

**ChainRay GasPredict** — Returns a near-term gas fee forecast for a specified EVM chain, including current base fee, low/mid/high projections, trend direction, and a transaction-timing recommendation.

*Use when:* Use when an agent needs to determine optimal gas pricing before submitting an EVM transaction, or when a user asks about current or near-term gas fees on a supported EVM network such as Base, Ethereum, Arbitrum, or Polygon.

*Not for:* Do not use for non-EVM chains (e.g., Solana, Bitcoin). Not suitable for real-time streaming gas feeds — this is a single-shot snapshot based on the last 20 blocks.

**Inputs:**

- `chain` (string) — EVM chain to query. Supported values: base, ethereum, arbitrum, optimism, polygon, bsc, avalanche, zksync, linea, scroll, blast, mantle, gnosis, polygon-zkevm, mode, sei, celo, manta, taiko, fantom, cronos, opbnb, zora, worldchain, metis, fraxtal, kava, zetachain, filecoin, core-dao, aurora, moonbeam, klaytn, bob, canto. Defaults to base.

**Returns:** Returns current base fee in Gwei, a 5-20 block forecast with low/mid/high values, trend direction and change percent, sampling stats, a transaction-timing recommendation, and an on-chain provenance proof object.

**Example:** `GET https://chainray.online/gas-predict?chain=base`

---

### `fetch-gas-oracle`

**ChainRay Gas Oracle** — Returns real-time gas prices and ETH transfer cost estimates across up to 16 EVM chains, ranked by cost, with a cheapest-chain recommendation.

*Use when:* Use when an agent needs to compare current gas costs across EVM chains to determine the cheapest network for executing a transaction or transfer.

*Not for:* Do not use for per-chain gas estimates on a single specific chain in isolation; the response always returns a multi-chain ranking. Not suitable for non-EVM chains.

**Inputs:**

- `chain` (string) — Blockchain network to use as the proof/anchor chain for the response (e.g., base, ethereum, polygon). Defaults to 'base'.

**Returns:** Returns a recommendation object (cheapest/most expensive chain, savings), a ranked array of up to 16 EVM chains with gasGwei and USD transfer cost, ETH price used, and an on-chain proof block.

**Example:** `GET https://chainray.online/gas-oracle?chain=base`

---

### `fetch-stablecoin-supply`

**Stablecoin Supply** — Returns on-chain stablecoin total supply for a specified EVM chain plus global circulating supply and price data for the top stablecoins across all chains.

*Use when:* Use when an agent needs on-chain stablecoin supply figures for a specific EVM network (e.g., Base, Ethereum, Arbitrum) or wants global circulating supply, price, and chain-count data for major stablecoins like USDC, USDT, or DAI.

*Not for:* Do not use for non-EVM chains (e.g., Solana, Bitcoin); only the listed EVM networks are supported. Not suitable for real-time streaming price feeds — this is a single-shot snapshot.

**Inputs:**

- `chain` (string) — EVM chain to query on-chain stablecoin supply for. Supported values: base, ethereum, arbitrum, optimism, polygon, bsc, avalanche, zksync, linea, scroll, blast, mantle, gnosis, polygon-zkevm, mode, sei, celo, manta, taiko, fantom, cronos, opbnb, zora, worldchain, metis, fraxtal, kava, zetachain, filecoin, core-dao, aurora, moonbeam, klaytn, bob, canto. Defaults to base.

**Returns:** Returns on-chain totalSupply per stablecoin for the queried EVM chain, cross-chain aggregated totals, global top-15 stablecoin circulating supplies and prices, and an on-chain proof object.

**Example:** `GET https://chainray.online/stablecoin-supply?chain=base`

---

### `compute-impermanent-loss`

**Impermanent Loss Calculator** — Computes impermanent loss percentage and dollar loss per $10,000 for a liquidity provider position given entry and current token prices on a specified chain.

*Use when:* Use when an agent or user needs to quantify impermanent loss for an LP position by supplying the token price at entry and the current token price, optionally scoped to a specific blockchain.

*Not for:* Do not use for real-time price feeds or swap quotes; use a DEX quote API instead. Not suitable for multi-token (3+ asset) pool IL calculations.

**Inputs:**

- `entryPrice` (string, required) — Token price at the time of LP entry, as a numeric string.
- `currentPrice` (string, required) — Current token price, as a numeric string.
- `chain` (string) — Target blockchain identifier. Defaults to 'base'. Supported values include base, ethereum, arbitrum, optimism, polygon, bsc, avalanche, solana, and many others.

**Returns:** Returns an array of IL simulations each with priceChange, ilPercent, and lossPerTenK, plus the current ETH price, the IL formula used, a timestamp, and an on-chain proof object.

**Example:** `GET https://chainray.online/impermanent-loss?chain=base&entryPrice=1800&currentPrice=1900`

---

### `fetch-mev-shield-advisory`

**ChainRay MEV Shield Advisory** — Returns a heuristic MEV risk assessment for a swap on a specified blockchain, including sandwich risk score, recommended slippage, mitigations, and gas context.

*Use when:* Use when an agent needs a pre-trade MEV risk advisory before executing a swap, to determine sandwich attack likelihood, recommended slippage tolerance, and mitigation strategies on chains like Base, Ethereum, Arbitrum, or others.

*Not for:* Do not use for real-time mempool monitoring or guaranteed MEV protection; this is a statistical heuristic advisory only and does not observe pending transactions. Not a substitute for private RPC or flashbots-style transaction routing.

**Inputs:**

- `chain` (string) — Target blockchain network. Supported values include base, ethereum, arbitrum, optimism, polygon, bsc, avalanche, zksync, linea, scroll, blast, solana, and many others. Defaults to base.
- `action` (string) — Type of transaction action being assessed. Defaults to swap.
- `tokenIn` (string) — Symbol or address of the input token for the trade being assessed.
- `amount` (string) — Trade amount, used to compute size-based risk factor.

**Returns:** Returns a MEV risk advisory with sandwichRisk score, riskLevel, recommended slippage, mitigation strategies, gas context, native token price, methodology notes, and an on-chain proof block hash.

**Example:** `GET https://chainray.online/mev-shield?chain=base&action=swap&tokenIn=USDC&amount=1000`

---
