Recipes
1. Always-on agent loop
import { AgentLoop, currentRatioBps, DEFAULT_POLICY } from "@mach/agent";
const loop = new AgentLoop({
manifest, agent, owner, mintA, mintB,
rpc: ER_RPC,
intervalMs: 1_000,
onCycle: (event) => {
eventBus.publishTx({
tSendUnixMs: event.timestampMs,
signature: event.signature,
direction: event.decision.kind === "swap" ? event.decision.direction : null,
// …
});
},
});
loop.start();2. Confirm-status reconciliation
3. Settle on TTL approach
4. Custom-fee grid (USDC)
5. Subscribe to live activity
See also
Last updated
