# Copy of MetaLayer API

## Introduction

**MetaLayer API** is a comprehensive solution for projects that need token transfer functionality between blockchains. Instead of building and maintaining your own bridge infrastructure (validators, relayers, smart contracts), you can use our unified API.

This saves months of development and significant operational costs, allowing you to focus on growing your core product.

***

### The Problem

#### Who This Is For

Teams that need cross-chain transfers in their product:

* Crypto wallets
* DEX and aggregators
* DeFi protocols
* Payment gateways
* Financial services

#### Challenges of Building Your Own

* Smart contract development and auditing for each network
* Maintaining and securing validators and relayers
* 24/7 monitoring and support
* Continuously expanding the list of supported networks
* Finding optimal routes for users

***

### The Solution: MetaLayer API

We provide all the complex cross-chain bridge infrastructure through a single REST API.

#### What You Get

| Capability               | Description                                   |
| ------------------------ | --------------------------------------------- |
| **Single API**           | One interface for dozens of blockchains       |
| **Route aggregation**    | Automatic search for best transfer paths      |
| **Ready transactions**   | API builds calldata — just send to blockchain |
| **Status tracking**      | Monitor operations from start to finish       |
| **Fee configuration**    | Flexible business logic for your product      |
| **Continuous expansion** | New networks and tokens added by our team     |

***

### Core Features

#### Route Aggregation

Search for optimal transfer path among multiple available routes and liquidity pools. The algorithm considers:

* Network and protocol fees
* Available liquidity
* Execution time
* Price impact

#### Priority Routes

Ability to configure exclusive, most favorable routes for your project. Partnership terms available upon request.

#### Simple Integration

* All operations via REST API
* No need for your own nodes
* Ready calldata for transactions
* Detailed documentation and examples

#### Extensive Network Support

| Category | Networks                                |
| -------- | --------------------------------------- |
| EVM L1   | Ethereum, BSC, Polygon, Avalanche       |
| EVM L2   | Arbitrum, Optimism, Base, zkSync, Linea |
| Others   | Continuously expanding                  |

### How It Works

```
┌─────────────────┐      ┌─────────────────┐      ┌─────────────────┐
│      Your       │      │   MetaLayer     │      │   Blockchain    │
│   Application   │◀────▶│      API        │      │    (Source)     │
└────────┬────────┘      └─────────────────┘      └────────▲────────┘
         │                                                  │
         │                 User sends TX                    │
         └──────────────────────────────────────────────────┘
                                                            │
                                                  Relayers / Validators
                                                            │
                                                            ▼
                                                 ┌─────────────────┐
                                                 │   Blockchain    │
                                                 │  (Destination)  │
                                                 └─────────────────┘
```

#### Step 1: Request Routes

Your application requests possible routes for transfer from network A to network B.

```
POST /routing/scan
{
  "params": {
    "chainIdIn": 1,        // Ethereum
    "chainIdOut": 42161,   // Arbitrum
    "tokenIn": "0x...",
    "tokenOut": "0x...",
    "amountIn": "1000000000000000000"
  },
  "slippage": 1
}
```

#### Step 2: Select Route

API returns options with estimated time, fees, and output amount. Your application selects the best one.

```json
{
  "amountOut": "998500000",
  "priceImpact": 0.15,
  "totalFee": { "percent": "0.15" },
  "expectedFinalitySeconds": "180"
}
```

#### Step 3: Get Estimate

Request signature and final parameters for the selected route.

```
POST /estimate
→ { "executionPrice": "...", "deadline": "...", "signature": "0x..." }
```

#### Step 4: Build Transaction

Get ready data for blockchain submission.

```
POST /tx/create (with buildCalldata: true)
→ { "to": "0x...", "data": "0x...", "value": "0" }
```

#### Step 5: Send and Track

User signs and sends transaction. Monitor status via REST API or WebSocket.

```
GET /transaction/{requestId}
→ { "status": "in progress" | "completed" }
```

#### Step 6: Completion

Transfer completes in the destination network. All confirmation and relay logic is handled by MetaLayer infrastructure.

***

### Getting Started

#### For Developers

Detailed technical documentation with code examples:

* **API Reference**: Complete description of all endpoints
* **Quick Start**: Step-by-step integration guide

**Go to Developer Documentation →**

#### Resources

| Resource      | Link                                  |
| ------------- | ------------------------------------- |
| Swagger UI    | <https://api.crosscurve.fi/api-docs/> |
| API Base URL  | <https://api.crosscurve.fi>           |
| Documentation | <https://docs.crosscurve.fi>          |

#### For Business

To discuss integration terms, partnership rates, and get test access, contact our team:

* Custom terms discussion
* Priority routes for your project


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.crosscurve.fi/crosscurve-metalayer-1/what-is-crosscurve-metalayer/copy-of-metalayer-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
