docs: add Smart Economy Engine example with X402 oracle and dynamic vault strategy#190
Conversation
…ration-example docs: add Arc Transaction Memo integration example with Multi-Agent O…
|
Great examples — the architecture and live cycle results in 1. The viem workaround is more practical than
|
|
Really useful addition — the Smart Economy Engine example nicely ties together the three Arc primitives in a single autonomous loop. A few notes that might be useful to fold into the x402 section, based on running a similar x402-gated API pattern on Arc Testnet: 1. The 60-second EIP-3009 backdate is correct (and possibly conservative) Arc Testnet block timestamps can lag wall clock by more than you might expect — we see 30–60 s drift in practice. The 60 s backdate in 2. Filter on USDS/USDC on Arc Testnet ( // Verify EIP-3009 payment on Arc Testnet — scope by (from, to, amount)
const logs = await publicClient.getLogs({
address: '0x3600000000000000000000000000000000000000',
event: parseAbiItem('event Transfer(address indexed from, address indexed to, uint256 value)'),
args: { from: payerAddress, to: recipientAddress },
fromBlock: txReceipt.blockNumber,
toBlock: txReceipt.blockNumber,
});
const paid = logs.some(l => l.args.value !== undefined && l.args.value >= requiredAmount);3. We're building the same x402 gate pattern on our stablecoin DApp For context — we're implementing x402 on three endpoints of our Arc Testnet DApp (arc-stablecoin-dapp) using
The 0.001 USDC per-cycle price point for your oracle is sensible for agent loops — at that price 1 USDC of faucet funds runs 1,000 cycles, which is more than enough to demonstrate the economic loop convincingly. 4. One thing worth documenting in the The |
Follow-up:
|
Summary
This PR adds an example showing how to build a self-sustaining autonomous agent economy on Arc Testnet that uses an X402-gated market oracle to make dynamic vault strategy decisions.
What's included
Live Verification
3 cycles run on Arc Testnet:
Related
Series
This is the 11th example in this series:
1-10: Foundry, X402, ERC-8004, ERC-8183, Unified Flow, Dashboard, MCP, Multi-Agent, Transaction Memo, ERC-4626 Vault
11: Smart Economy Engine (this PR)