> ## Documentation Index
> Fetch the complete documentation index at: https://docs.caldera.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Intent System

> Declarative cross-chain execution powered by competitive solver markets

Metalayer's bridge aggregation system routes cross-chain transfers through multiple execution paths, including intent-based protocols with competitive solver markets. While not all bridge requests are intents, intent-based execution provides the fastest and most efficient routes for many cross-chain transfers.

## Intent-Based vs Direct Bridge Routes

When you make a bridge request via the Metalayer SDK, Widget, or API, the system may route your transaction through different types of providers:

**Intent-Based Routes** (this page focuses on these):

* **Across Protocol**: Independent intent-based protocol using UMA for verification and settlement
* **Relay Protocol**: Independent intent-based protocol using direct rebalancing for settlement
* **Eco Solver (Caldera)**: Metalayer-Powered solver focused on ETH and native tokens
* **Eco Solver (Eco)**: Metalayer-Powered solver focused on stablecoin routes

**Direct Bridge Routes**:

* **Native Bridges**: Direct integration with L2 canonical bridges (Arbitrum, Optimism, etc.)
* **Other Bridge Providers**: Direct protocols without solver competition

All routes benefit from Metalayer's aggregation, quote optimization, and unified developer experience, but only intent-based routes use the competitive solver model described below.

## How Intents Work

### Declarative Execution

Developers specify **what** they want to achieve (the intent) without needing to define **how** it should be executed across different chains. This abstraction reduces complexity and potential errors in cross-chain operations.

### Competitive Solver Model

Intent-based protocols use a competitive solver ecosystem where multiple entities compete to fulfill user intents:

* **Fast-Fill Networks**: Solvers use their own capital to instantly deliver assets on destination chains
* **Competitive Fulfillment**: Multiple solvers compete on speed, cost, and reliability
* **Risk Management**: Solvers temporarily take on cross-chain settlement risk
* **Proof of Fulfillment**: Solvers must provide cryptographic proof of completion via MetaProver

### Settlement Mechanisms

Different intent-based protocols use different settlement approaches:

* **Across Protocol**: Uses UMA's optimistic verification system
* **Relay Protocol**: Uses direct rebalancing mechanisms
* **Eco Solver**: Uses Metalayer's intent system on supported networks, Hyperlane for all networks

## Intent Flow Example

```
User Intent: "I want 100 USDC on ApeChain, I have ETH on Arbitrum"

1. Intent Processing:
   - Parse user requirements
   - Identify source assets (ETH on Arbitrum)
   - Define destination requirements (100 USDC on ApeChain)

2. Quote Aggregation:
   - Query supported providers for optimal routes
   - See [Aggregated Bridges](/metalayer/resources/aggregated-bridges) for complete provider list

3. Route Selection:
   - Evaluate by speed, fees, and solver capacity constraints
   - Present optimal route to user (may be intent-based or native bridge)

4. Execution (Intent-based route):
   - User signs transaction, funds escrowed in Vault (Metalayer-Powered routes only)
   - Intent registered in IntentSource contract (Metalayer-Powered routes only)
   - Solver fulfills instantly on ApeChain using own capital

5. Settlement (Intent-based route):
   - External protocols (Across, Relay): Handle their own settlement mechanisms
   - Metalayer-Powered routes (Eco):
     - Solver's fulfillment logged in Inbox contract
     - MetaProver generates proof of fulfillment
     - Proof sent via Hyperlane to source chain
     - IntentSource marks intent as complete
     - Solver claims reimbursement from Vault
```

## Security Model

### Intent Verification

* **Cryptographic Commitments**: Intents are cryptographically signed and immutable
* **Execution Guarantees**: System ensures intents are fulfilled as specified
* **Proof of Fulfillment**: Solvers must provide cryptographic proof of completion

### Solver Network Security

* **Capital Commitments**: Solvers deploy their own liquidity and maintain inventory across chains
* **Route-Level Limits**: Caldera enforces per-route maximums and cooldowns to cap exposure
* **Diverse Providers**: Multiple external partners (Across, Relay, Eco) can service the same intent type
* **Operational Monitoring**: Real-time tracking of fill latency, rebalancing health, and fulfillment accuracy

<Note>
  Additional mechanics such as solver slashing and shared staking pools are on the roadmap and will be announced separately.
</Note>

## Integration

For developers building on Metalayer, bridge requests (including intents) are expressed via the Metalayer SDK. The SDK aggregates across multiple providers and may route through intent-based protocols or direct bridges:

```typescript theme={null}
import { MetalayerClient, OrderStatus } from '@metalayer/sdk';

const client = MetalayerClient.init({
  apiKey: process.env.METALAYER_API_KEY!,
  environment: 'mainnet',
});

// Discover supported routes dynamically
const { chains } = await client.getSupportedChains();

const quoteResponse = await client.quote({
  sourceChainId: 42161, // Arbitrum
  sourceTokenAddress: '0x0000000000000000000000000000000000000000', // ETH
  destinationChainId: 33139, // Apechain
  destinationTokenAddress: '0x0000000000000000000000000000000000000000', // ETH
  amount: BigInt('1000000000000000000'), // 1 ETH
  senderAddress: '0xYourWalletAddress',
});

const bestRoute = quoteResponse.quotes[0];
const submittedTxs: string[] = [];

for (const step of bestRoute.steps) {
  switch (step.action.case) {
    case 'transactionRequest':
      const txHash = await walletClient.sendTransaction(step.action.value);
      submittedTxs.push(txHash);
      break;
    case 'eip712Data':
      await walletClient.signTypedData(step.action.value);
      break;
  }
}

const { order } = await client.getOrder({
  sourceTransactionHash: submittedTxs[0],
  sourceChainId: 42161,
});

if (order.status === OrderStatus.FULFILLED) {
  console.log('Bridge order completed successfully');
}
```

The SDK abstracts quote aggregation, calldata assembly, and fulfillment tracking across both intent-based protocols and direct bridges, so you can focus on the user experience rather than managing multiple bridge integrations.

## Next Steps

<CardGroup cols={2}>
  <Card title="Message Passing" icon="message" href="/metalayer/how-it-works/message-passing">
    Learn about the underlying messaging infrastructure
  </Card>

  <Card title="SDK Integration" icon="code" href="/metalayer/sdk/getting-started">
    Start building with intents
  </Card>
</CardGroup>
