Intents let you specify a desired outcome (e.g., "swap 1 ETH for at least 2500 USDC") without constructing the transaction yourself. Solvers compete to fill your intent at the best price, and the winning solution is executed on-chain.
Submit an Intent
POST /intent
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Intent type: swap, bridge, or generic |
source_chain | string | Yes | Source chain identifier (e.g., ethereum, arbitrum) |
destination_chain | string | No | Destination chain for cross-chain intents. Defaults to source_chain. |
token_in | string | Yes | Input token contract address |
token_out | string | Yes | Output token contract address |
amount_in | string | Yes | Input amount in wei/smallest unit |
min_amount_out | string | Yes | Minimum acceptable output amount |
sender | string | Yes | Address submitting the intent |
recipient | string | No | Address to receive output tokens. Defaults to sender. |
deadline | number | Yes | Unix timestamp after which the intent expires |
metadata | object | No | Arbitrary key-value pairs for solver hints |
Intent Types
Swap
A single-chain token swap. Solvers find the best execution path across DEXs.
{
"type": "swap",
"source_chain": "ethereum",
"token_in": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"token_out": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amount_in": "1000000000000000000",
"min_amount_out": "2500000000",
"sender": "0xYourAddress",
"deadline": 1742068800
}
Bridge
A cross-chain transfer or swap. Solvers handle bridging and execution on the destination chain.
{
"type": "bridge",
"source_chain": "ethereum",
"destination_chain": "arbitrum",
"token_in": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"token_out": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
"amount_in": "1000000000000000000",
"min_amount_out": "990000000000000000",
"sender": "0xYourAddress",
"recipient": "0xYourAddressOnArbitrum",
"deadline": 1742068800
}
Generic
A freeform intent with custom execution logic described in metadata.
{
"type": "generic",
"source_chain": "ethereum",
"token_in": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"token_out": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amount_in": "5000000000000000000",
"min_amount_out": "12000000000",
"sender": "0xYourAddress",
"deadline": 1742068800,
"metadata": {
"strategy": "twap",
"intervals": 5,
"interval_seconds": 60
}
}
Intent Lifecycle
| Status | Description |
|---|---|
open | Intent submitted and visible to solvers. Awaiting solutions. |
solving | One or more solvers have submitted candidate solutions. Auction in progress. |
filled | Winning solution selected and executed on-chain. Intent complete. |
expired | Deadline passed without a valid solution. No execution occurred. |
cancelled | Intent cancelled by the sender before filling. |
Code Examples
Submit an Intent
const response = await fetch("https://api.yoorquezt.io/intent", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
body: JSON.stringify({
type: "swap",
source_chain: "ethereum",
token_in: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
token_out: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
amount_in: "1000000000000000000",
min_amount_out: "2500000000",
sender: "0xYourAddress",
deadline: Math.floor(Date.now() / 1000) + 3600,
}),
});
const { intent_id, status } = await response.json();
console.log(`Intent ${intent_id}: ${status}`);
Query Intent Status
const response = await fetch(`https://api.yoorquezt.io/intent/${intentId}`, {
headers: { "Authorization": "Bearer YOUR_API_KEY" },
});
const intent = await response.json();
console.log(`Status: ${intent.status}`);
console.log(`Solutions: ${intent.solutions_count}`);
Cancel an Intent
const response = await fetch(`https://api.yoorquezt.io/intent/${intentId}/cancel`, {
method: "POST",
headers: { "Authorization": "Bearer YOUR_API_KEY" },
});
const { status } = await response.json();
console.log(`Intent status: ${status}`); // "cancelled"
Python Example
import requests
response = requests.post(
"https://api.yoorquezt.io/intent",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
json={
"type": "swap",
"source_chain": "ethereum",
"token_in": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"token_out": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amount_in": "1000000000000000000",
"min_amount_out": "2500000000",
"sender": "0xYourAddress",
"deadline": int(time.time()) + 3600,
},
)
data = response.json()
print(f"Intent {data['intent_id']}: {data['status']}")