Intent Submission

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

FieldTypeRequiredDescription
typestringYesIntent type: swap, bridge, or generic
source_chainstringYesSource chain identifier (e.g., ethereum, arbitrum)
destination_chainstringNoDestination chain for cross-chain intents. Defaults to source_chain.
token_instringYesInput token contract address
token_outstringYesOutput token contract address
amount_instringYesInput amount in wei/smallest unit
min_amount_outstringYesMinimum acceptable output amount
senderstringYesAddress submitting the intent
recipientstringNoAddress to receive output tokens. Defaults to sender.
deadlinenumberYesUnix timestamp after which the intent expires
metadataobjectNoArbitrary 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

StatusDescription
openIntent submitted and visible to solvers. Awaiting solutions.
solvingOne or more solvers have submitted candidate solutions. Auction in progress.
filledWinning solution selected and executed on-chain. Intent complete.
expiredDeadline passed without a valid solution. No execution occurred.
cancelledIntent 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']}")
Edit this page