# Cross-Chain Bridge Arbitrage Detector (`gochujang/cross-chain-bridge-arb`) Actor

Detects cross-chain arbitrage opportunities by comparing asset prices (USDC, USDT, WETH, WBTC, MATIC) across ETH, Arbitrum, Optimism, Polygon, Base, BSC, Avalanche. No API key required.

- **URL**: https://apify.com/gochujang/cross-chain-bridge-arb.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 token analyzeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What does Cross-Chain Bridge Arbitrage Scanner do?

The **cross-chain bridge arbitrage** scanner detects real-time price discrepancies for the same token across Ethereum, Arbitrum, Optimism, Polygon, Base, BSC, and Avalanche. For each token it performs a **bridge rate comparison** across all 21 chain pairs, subtracts heuristic bridge costs, and classifies each opportunity as `excellent`, `good`, `marginal`, or `negative`. This is a true **multi-chain arbitrage scanner** — no API key required, powered by DexScreener and CoinGecko.

### Why use Cross-Chain Bridge Arbitrage Scanner?

- **Cross-chain arbitrage traders** — find actionable **cross-chain bridge arbitrage** opportunities ranked by net profit after estimated bridge costs before the window closes.
- **Market makers and liquidity providers** — identify which chains have persistent price dislocations for tokens you LP on, and rebalance inventory accordingly.
- **Quantitative researchers** — collect systematic **bridge rate comparison** data across chain pairs to build models of cross-chain price convergence speed.
- **Risk managers** — monitor price divergence across chains as an early warning signal for bridge congestion, depegs, or liquidity crises.
- **DeFi protocol teams** — track real-time arbitrage pressure on your token across chains to optimize bridge integrations and liquidity deployment.

### How to use Cross-Chain Bridge Arbitrage Scanner

1. Open the actor on Apify and click **Try for free**.
2. (Optional) Edit `tokens` to scan your target tokens (default: USDC, USDT, WETH, WBTC, MATIC).
3. (Optional) Edit `chains` to restrict to a subset of the 7 supported chains.
4. Set `minPriceDiffPct` to filter out noise (e.g. `0.1` to see only >0.1% dislocations).
5. Enable `onlyProfitable` to show only net-positive opportunities after bridge costs.
6. Set `minLiquidityUsd` to skip illiquid pairs (default: $10,000).
7. Click **Start** — the run completes in under 30 seconds.

### Input

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `tokens` | string\[] | `["USDC","USDT","WETH","WBTC","MATIC"]` | Tokens to scan for **cross-chain bridge arbitrage** |
| `chains` | string\[] | all 7 | Chains to include in the scan |
| `minPriceDiffPct` | number | 0.0 | Minimum price difference (%) to include a pair |
| `onlyProfitable` | boolean | false | Only show opportunities with positive net profit |
| `minLiquidityUsd` | number | 10,000 | Skip pairs below this liquidity threshold |
| `includeSummary` | boolean | true | Include the summary record in the dataset |

### Output

Three record types: per-pair arbitrage opportunities, per-chain prices, and a run summary.

```json
[
  {
    "record_type": "arb_opportunity",
    "token_symbol": "USDC",
    "base_chain": "polygon",
    "quote_chain": "ethereum",
    "base_price_usd": 0.9981,
    "quote_price_usd": 1.0003,
    "price_diff_pct": 0.22,
    "arb_direction": "base_to_quote",
    "estimated_profit_100k_usd": 220,
    "bridge_cost_estimate_pct": 0.08,
    "net_profit_after_bridge": 140,
    "opportunity_tier": "good",
    "is_profitable": true,
    "risk_level": "low"
  },
  {
    "record_type": "per_chain_price",
    "token_symbol": "WETH",
    "chain": "arbitrum",
    "price_usd": 3421.14,
    "liquidity_usd": 4800000,
    "volume_24h_usd": 22000000,
    "price_vs_median_pct": -0.11
  }
]
```

### Data fields

#### Arbitrage opportunity records

| Field | Description |
|-------|-------------|
| `token_symbol` | Token being compared (e.g. `USDC`, `WETH`) |
| `base_chain` | Chain with the lower price (buy here) |
| `quote_chain` | Chain with the higher price (sell here) |
| `base_price_usd` | Token price on the base chain |
| `quote_price_usd` | Token price on the quote chain |
| `price_diff_pct` | Absolute price difference as a percentage |
| `arb_direction` | Always `base_to_quote` (buy cheap, sell expensive) |
| `estimated_profit_100k_usd` | Gross estimated profit on a $100K position |
| `bridge_cost_estimate_pct` | Estimated bridge cost as % (route-specific heuristic) |
| `net_profit_after_bridge` | Net profit on $100K after subtracting bridge cost estimate |
| `opportunity_tier` | `excellent` (>0.5%) / `good` (>0.2%) / `marginal` / `negative` |
| `is_profitable` | `true` if net profit after bridge is positive |
| `risk_level` | `low` (stablecoins) / `medium` (WETH, WBTC) / `high` |

#### Per-chain price records

| Field | Description |
|-------|-------------|
| `token_symbol` | Token symbol |
| `chain` | Chain name |
| `price_usd` | Best available price (highest liquidity pair) |
| `liquidity_usd` | Liquidity of the pair used for pricing |
| `volume_24h_usd` | 24h trading volume on this chain |
| `price_vs_median_pct` | % deviation from the median price across all chains |

#### Summary record

| Field | Description |
|-------|-------------|
| `total_arb_pairs_found` | Total chain-pair combinations with price data |
| `total_profitable_pairs` | Count of net-positive arbitrage opportunities |
| `avg_price_diff_pct` | Average price difference across all pairs |
| `best_arb_opportunity` | Single best opportunity found in the run |
| `coingecko_reference_prices` | Reference USD prices from CoinGecko |

### Cost estimation

**Pay-Per-Event (PPE)** — $0.005 per token analyzed + $0.001 actor start fee.

| Scenario | Tokens | Approx. cost |
|----------|--------|--------------|
| Default (5 tokens) | 5 | ~$0.026 |
| Extended (10 tokens) | 10 | ~$0.051 |
| Full token set (20 tokens) | 20 | ~$0.101 |

### Supported chains

`ethereum` · `arbitrum` · `optimism` · `polygon` · `base` · `bsc` · `avalanche`

### FAQ

**How accurate are the bridge cost estimates?**
Bridge costs are heuristic estimates based on typical fee ranges (0.05–0.20%) for the route. Actual costs vary significantly by bridge, gas price, token, and trade size. Always verify exact costs on-chain before executing a **multi-chain arbitrage** trade.

**How fast do arbitrage windows close?**
For major tokens like USDC and WETH on high-liquidity chains, price discrepancies typically close within seconds to minutes as MEV bots and arbitrageurs act on them. This actor is best used for research, monitoring persistent price dislocations, or identifying structural **bridge rate comparison** patterns.

**Why are only 7 chains supported?**
The 7 chains cover the vast majority of cross-chain DeFi volume. Chain coverage will expand in future versions. Use the `chains` input to restrict to a subset for faster runs.

> **Disclaimer**: Arbitrage opportunity data is based on real-time DEX spot prices from DexScreener and CoinGecko at the time of the run. Prices reflect spot liquidity — large trade sizes will experience slippage. Bridge cost estimates are heuristic and may not reflect actual on-chain fees. **Cross-chain bridge arbitrage** involves significant execution risk. This actor is for informational and research purposes only and does not constitute financial advice. Always verify opportunities on-chain before executing trades.

***

### Related actors

- [Bridge Volume Tracker](https://apify.com/gochujang/bridge-volume-tracker) — Cross-chain bridge flow volume to identify which bridges are carrying arb execution capital
- [DEX Volume Tracker](https://apify.com/gochujang/dex-volume-tracker) — Per-chain DEX volumes to assess liquidity depth for cross-chain arb opportunities
- [CEX Spot Arb Scanner](https://apify.com/gochujang/cex-spot-arb-scanner) — CEX-to-DEX price discrepancies alongside this actor's cross-chain DEX-to-DEX arb view

### Feedback

If this actor powers your arbitrage research, a review helps others find it: [Leave a review on Apify Store](https://apify.com/gochujang/cross-chain-bridge-arb#reviews)

***

**Keywords:** cross-chain arbitrage, bridge arbitrage scanner, USDC price difference chains, WETH cross-chain spread, Arbitrum Optimism Polygon price gap, DeFi arbitrage opportunity, bridge profit calculator, net profit after bridge cost, multi-chain price discrepancy, L2 arbitrage, cross-chain DEX arb, stablecoin peg arbitrage

# Actor input Schema

## `tokens` (type: `array`):

List of token symbols to scan for cross-chain arbitrage. Defaults to USDC, USDT, WETH, WBTC, MATIC.

## `chains` (type: `array`):

List of chain names to compare prices across. Defaults to all 7 supported chains.

## `minPriceDiffPct` (type: `number`):

Only return pairs where price difference exceeds this threshold.

## `onlyProfitable` (type: `boolean`):

If true, only return pairs where net profit after bridge cost is positive.

## `minLiquidityUsd` (type: `number`):

Skip token/chain pairs with liquidity below this threshold.

## `includeSummary` (type: `boolean`):

If true, push a top-level summary record with best opportunity, total profitable pairs, and avg price diff.

## `bridgeFeeUsd` (type: `number`):

Optional parameter: bridgeFeeUsd

## `gasCostUsd` (type: `number`):

Optional parameter: gasCostUsd

## `positionSizeUsd` (type: `number`):

Optional parameter: positionSizeUsd

## Actor input object example

```json
{
  "tokens": [
    "USDC",
    "USDT",
    "WETH",
    "WBTC",
    "MATIC"
  ],
  "chains": [
    "ethereum",
    "arbitrum",
    "optimism",
    "polygon",
    "base",
    "bsc",
    "avalanche"
  ],
  "minPriceDiffPct": 0,
  "onlyProfitable": false,
  "minLiquidityUsd": 10000,
  "includeSummary": true
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gochujang/cross-chain-bridge-arb").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("gochujang/cross-chain-bridge-arb").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call gochujang/cross-chain-bridge-arb --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gochujang/cross-chain-bridge-arb"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/gXHxF9wXjEfxg8pXI/builds/GS2Pa6FzuVd457TYO/openapi.json
