WHAT IS AN AGENT
In VynX, an agent is any autonomous system that submits intents. There are no wallet popups, no brand preferences, no onboarding fatigue. An intent is an instruction — swap X USDC for Y token — validated and signed (EIP-712) by the Relayer. The protocol handles routing, settlement, and guarantees.
The agent wallet submits two Base transactions per swap — approve() and lockIntent() — and pays their gas. The destination-chain payment is the Solver’s own transaction; its gas is internalized in the bid spread.
The agent submits an intent — token (USDC), amount, destination chain, and a 15-minute deadline. The SDK sends an all-zero placeholder signature; the relayer's EIP-712 signature is the authoritative one.
The relayer validates solver eligibility (SHF ≥ 1.20×), signs the intent, then opens a 200 ms sealed-bid auction. Highest OutputAmount wins; ties break on health factor.
The SDK submits approve() and lockIntent() from the agent wallet — two Base transactions, agent-paid gas. lockIntent() escrows the USDC on VynxSettlement, verifying the relayer's EIP-712 signature against the live relayerKey.
The winning solver delivers the output token on the destination chain. The relayer waits for finality, then signs a voucher over (intentId, solver, amount).
claimFunds() verifies the voucher and releases the escrow to the solver. A 10 bps fee is deducted atomically.
No fill by the deadline? Anyone can call refundIntent() to return the full amount to the agent — unilateral, no solver or governance approval required.
THREE STEPS TO PRODUCTION
npm install @vynx/sdk viem
import { createWalletClient, createPublicClient, http } from 'viem'
import { base } from 'viem/chains'
import { privateKeyToAccount } from 'viem/accounts'
import { VynxCore } from '@vynx/sdk'
const account = privateKeyToAccount(process.env.AGENT_PK)
const walletClient = createWalletClient({
account,
chain: base,
transport: http(process.env.BASE_RPC_URL),
})
const publicClient = createPublicClient({
chain: base,
transport: http(process.env.BASE_RPC_URL),
})
const vynx = new VynxCore({ walletClient, publicClient })const receipt = await vynx.executeSwap({
targetToken: 'DEGEN', // symbol or 0x address
amountUSD: 100, // min $50
targetChainId: 8453, // Base
})
// receipt.destTxHash · receipt.outputAmount · receipt.executionTimeMsinputAmount minimum: 50 USDC (50_000_000). Intents below this threshold are rejected by the Relayer’s Asymmetric Asset Policy.
@VYNX/SDK
The SDK submits approve() — exact allowance, never unlimited — and lockIntent() from the agent wallet. It does not hold capital, does not sign EIP-712 typed data, and does not query oracles.
INTENT STRUCTURE
Every intent is an EIP-712 typed data payload. The Relayer validates and signs the struct; lockIntent() verifies that signature on-chain. The Solver bids.
STATE MACHINE
SETTLED, EXPIRED, and SLASHED are terminal. On EXPIRED the agent is refunded in full; on SLASHED the breaching solver forfeits 10% and the agent is compensated.
On EXPIRED: the agent receives a full unilateral refund. No Solver approval required. No governance vote. The refund is enforced by DEFAULT_DEADLINE in VynxSettlement.sol.
FAILURE MODES
Intent rejected before auction if: inputToken ≠ USDC, inputAmount < 50 USDC, no eligible Solvers (SHF), or agent nonce reused.
Check payload. Retry with corrected parameters.
No Solver bid within 200ms window. Status → PENDING (requeued) or EXPIRED if deadline passed.
getSwapStatus() to confirm. Retry or wait for refund.
Solver won but failed to settle within 15 min. SlashAmount = InputAmount × 10%. 5% returned to agent. Protocol enforced. No action needed.
Monitor via getSwapStatus(). Compensation is automatic.
VynxSettlement.sol reverts and emits SuspiciousRelayerActivity if intentId is not found or Solver does not match on-chain record.
Every error thrown by executeSwap() and getSwapStatus() is a VynxError with a stable code. Match on the code, never the message. The class encodes whether capital is at risk.
FREQUENTLY ASKED QUESTIONS
START BUILDING