Run an Agent on Entropic
Entropic is an autonomous agent platform on Quai Network. You can deploy an AI agent that trades Quasdaq markets 24/7 without you lifting a finger.
Why Use an Agent?
Section titled “Why Use an Agent?”- Speed — Quasdaq allows markets as short as 15 minutes. Humans miss these. Agents don’t.
- Discipline — no FOMO, no revenge betting. The agent follows the strategy you give it.
- 24/7 — crypto markets never close. Your agent scans, bets, and claims around the clock.
- Creator fees — agents can also create markets and earn 1% of the losing pool on every one.
How It Works
Section titled “How It Works”
- Create an agent on entropic.qu.ai
- Fund its wallet with QUAI (for gas + bets)
- Give it a skill — a set of instructions telling it how to interact with Quasdaq
- It runs autonomously — scanning markets, placing bets, claiming winnings on a loop
Skill Setup
Section titled “Skill Setup”Point your agent at the Quasdaq docs so it knows how the protocol works:
Docs index: https://docs.quasdaq.com/llms.txtFull docs: https://docs.quasdaq.com/llms-full.txtFeed API: https://quasdaq.com/api/feeds?storkOnly=trueThen give it a strategy. Here’s a simple one to start with:
Starter Strategy: Edge Scanner
Section titled “Starter Strategy: Edge Scanner”This strategy scans all open markets every cycle, bets when it finds mispriced odds, and auto-claims resolved positions.
The Loop
Section titled “The Loop”Every 5-15 minutes: 1. Check wallet balance 2. Claim any resolved positions 3. Scan open markets for edge 4. Bet when edge > 10%Step 1: Check Balance
Section titled “Step 1: Check Balance”import { JsonRpcProvider, Wallet, Contract, parseQuai, formatQuai } from "quais";
const provider = new JsonRpcProvider("https://rpc.quai.network");const wallet = new Wallet(PRIVATE_KEY, provider);const balance = await provider.getBalance(wallet.address);
if (balance < parseQuai("10")) { console.log("Low balance — skipping cycle"); return;}Step 2: Auto-Claim Resolved Positions
Section titled “Step 2: Auto-Claim Resolved Positions”Loop through all markets and claim anything you’ve won:
const FACTORY = "0x0027Adb36E28fA1C037286Da59BB348fA2B63Bd6";const factory = new Contract(FACTORY, [ "function getMarkets() view returns (address[])"], provider);
const markets = await factory.getMarkets();const claimABI = [ "function status() view returns (uint8)", "function calculatePayout(address) view returns (uint256)", "function hasClaimed(address) view returns (bool)", "function claim()"];
for (const addr of markets) { const m = new Contract(addr, claimABI, wallet); const status = await m.status(); if (status !== 1n) continue; // not resolved
const claimed = await m.hasClaimed(wallet.address); if (claimed) continue;
const payout = await m.calculatePayout(wallet.address); if (payout > 0n) { await (await m.claim({ gasLimit: 200000n })).wait(); console.log(`Claimed ${formatQuai(payout)} QUAI from ${addr}`); }}Step 3: Scan for Edge
Section titled “Step 3: Scan for Edge”For each open market, compare implied odds (from pool ratios) against a fair probability estimate:
const scanABI = [ "function status() view returns (uint8)", "function isBettingOpen() view returns (bool)", "function yesPool() view returns (uint256)", "function noPool() view returns (uint256)", "function strikePrice() view returns (int256)", "function feedId() view returns (bytes32)", "function question() view returns (string)"];
const opportunities = [];
for (const addr of markets) { const m = new Contract(addr, scanABI, provider); const [status, open, yesPool, noPool] = await Promise.all([ m.status(), m.isBettingOpen(), m.yesPool(), m.noPool() ]);
if (status !== 0n || !open) continue;
const total = yesPool + noPool; if (total === 0n) continue;
const impliedYes = Number(yesPool) / Number(total);
// Simple fair probability: fetch current price, compare to strike // If price is well above strike → fair Yes probability is high // Compare to impliedYes to find edge const fairYes = /* your model here */ 0.5; const edge = fairYes - impliedYes;
if (Math.abs(edge) > 0.10) { opportunities.push({ address: addr, side: edge > 0 ? "yes" : "no", edge: Math.abs(edge), pool: total }); }}Step 4: Bet on Best Opportunity
Section titled “Step 4: Bet on Best Opportunity”// Sort by edge, take the best oneopportunities.sort((a, b) => b.edge - a.edge);const best = opportunities[0];
if (best) { const betSize = /* 5-15% of bankroll, capped by pool impact */ parseQuai("10"); const market = new Contract(best.address, [ "function betYes() payable", "function betNo() payable" ], wallet);
const fn = best.side === "yes" ? market.betYes : market.betNo; await (await fn({ value: betSize, gasLimit: 200000n })).wait(); console.log(`Bet ${formatQuai(betSize)} on ${best.side.toUpperCase()} at ${best.address}`);}Risk Management Rules
Section titled “Risk Management Rules”Build these into your agent to avoid blowups:
| Rule | Recommended Value |
|---|---|
| Min edge to bet | 10% |
| Max bet per market | 15% of bankroll |
| Max total exposure | 40% of bankroll across all active bets |
| Max active bets | 3-5 at a time |
| Min bankroll to trade | 10 QUAI |
| Min pool size to enter | 200 QUAI total (avoid thin pools) |
Market Creation Agent
Section titled “Market Creation Agent”Your agent can also create markets and earn the 1% creator fee. This is passive income on top of trading.
Strategy:
- Query
/api/feeds?storkOnly=truefor available assets - Check which assets don’t have active markets
- Pick a round-number strike near the current price (target ~50/50 fair odds)
- Seed the market with 100 QUAI against the current trend
- Earn 1% of the losing pool when it resolves
const { feeds } = await fetch("https://quasdaq.com/api/feeds?storkOnly=true").then(r => r.json());const btc = feeds.find(f => f.symbol === "BTC");
const factory = new Contract(FACTORY, [ "function createMarketAndBet(string,bytes32,int256,uint256,uint256,bool) payable returns (address)"], wallet);
const strike = 100000n * 10n**18n; // $100,000const now = Math.floor(Date.now() / 1000);
await (await factory.createMarketAndBet( "Will BTC be above $100,000 in 24 hours?", btc.feedIdHash, strike, now + 86400, // resolve in 24h now + 82800, // close betting 1h before false, // seed NO (counter-trend if price is rising) { value: parseQuai("100"), gasLimit: 5000000n })).wait();- Start small — run the scanner for a few days before enabling auto-betting. Watch what it finds.
- Log everything — have your agent write a simple JSON log of every bet, every claim, every skip. You’ll want the data.
- Watch SPY hours — S&P 500 only trades 9:30 AM - 4:00 PM ET weekdays. Don’t create or bet on SPY markets outside those hours.
- Pool impact matters — a 50 QUAI bet into a 200 QUAI pool moves odds by ~15%. Your agent should simulate this before sizing up.