← Back to Skills Marketplace
humanjesse

Agent Market

by human jesse · GitHub ↗ · v0.1.0
cross-platform ⚠ suspicious
1254
Downloads
0
Stars
6
Active Installs
1
Versions
Install in OpenClaw
/install agent-market
Description
Interact with the AgentMarket protocol on Base Sepolia to create, trade, provide liquidity, and resolve USDC-settled YES/NO prediction markets.
README (SKILL.md)

AgentMarket Skill

Interact with the AgentMarket prediction market protocol on Base Sepolia. Create markets, trade YES/NO positions, provide liquidity, and resolve outcomes — all settled in USDC.

Source code & docs: https://github.com/humanjesse/AgentMarket

Deployed Contracts (Base Sepolia)

Contract Address
MarketFactory 0xDd553bb9dfbB3F4aa3eA9509bd58386207c98598
USDC 0x036CbD53842c5426634e7929541eC2318f3dCF7e

The MarketFactory is the single entry point. It deploys all child contracts (Market, AMM, Oracle, position tokens) when you create a market. You only need the factory address to get started.

How It Works

  1. Markets ask a YES/NO question. Users deposit USDC to mint paired YES+NO position tokens (1 USDC = 1 YES + 1 NO).
  2. Trading happens through an automated market maker (constant-product FPMM). Buy YES if you think an event will happen, buy NO if it won't. Prices reflect market probability (e.g. YES at 0.70 = 70% chance).
  3. Resolution uses an Optimistic Oracle: anyone proposes an outcome by posting a USDC bond, then there's a dispute window. If unchallenged, the proposal finalizes. If challenged, a designated arbitrator makes the final call.
  4. Payouts: winners split the entire USDC pool proportional to their token holdings. Losers get nothing. If you bet 10 USDC YES and win with half the YES supply, you get half the pool.

Configuration

Required environment variables:

  • AGENT_MARKET_FACTORY_ADDRESS: The deployed MarketFactory contract address (default: 0xDd553bb9dfbB3F4aa3eA9509bd58386207c98598)
  • USDC_ADDRESS: USDC token address on the network (default: 0x036CbD53842c5426634e7929541eC2318f3dCF7e)
  • RPC_URL: RPC endpoint (default: https://sepolia.base.org)
  • WALLET_PRIVATE_KEY: Your wallet private key

Prerequisites

Your wallet needs:

Quick Start

1. market_list()                                       — Browse existing markets
2. market_buy_yes({ marketAddress, amount: 5 })        — Bet 5 USDC on YES
3. market_propose_outcome({ marketAddress, outcome: true })  — Propose YES won (posts bond)
4. (wait for dispute window to close)
5. market_finalize({ marketAddress })                  — Finalize the outcome
6. market_claim({ marketAddress })                     — Collect your winnings

Tools

Reading

market_list

List active prediction markets with prices and oracle status.

  • limit (number, optional): Number of markets to return (default: 10)
  • offset (number, optional): Offset for pagination

market_get

Get full details for a specific market including AMM prices, oracle state, and claim preview.

  • marketAddress (string): The market contract address

Trading

market_create

Create a new YES/NO prediction market. Costs 2 USDC (1 fee + 1 initial liquidity). You receive LP tokens for the initial liquidity.

  • question (string): The question to be resolved (should have a clear YES/NO answer, max 256 characters)
  • arbitrator (string): Address of the fallback arbitrator for disputed outcomes
  • deadlineDays (number, optional): Emergency withdrawal deadline in days (default: 7, max: 365)

market_buy_yes

Buy YES shares (betting the event will happen). Minimum 2 USDC (a 0.1% protocol fee is deducted before the swap, so the post-fee amount must be at least 1 USDC).

  • marketAddress (string): The market to bet on
  • amount (number): Amount of USDC to spend

market_buy_no

Buy NO shares (betting the event will not happen). Minimum 2 USDC (a 0.1% protocol fee is deducted before the swap, so the post-fee amount must be at least 1 USDC).

  • marketAddress (string): The market to bet on
  • amount (number): Amount of USDC to spend

market_sell_yes

Sell YES shares back for USDC.

  • marketAddress (string): The market
  • amount (number): Amount of YES tokens to sell

market_sell_no

Sell NO shares back for USDC.

  • marketAddress (string): The market
  • amount (number): Amount of NO tokens to sell

market_claim

Claim winnings from a resolved market. Burns your winning tokens and returns your proportional share of the pool.

  • marketAddress (string): The resolved market

Liquidity

Liquidity providers (LPs) deposit USDC to deepen the AMM pool, earning trading fees (0.3% per trade plus 0.1% protocol fee). You receive LP tokens representing your share.

market_add_liquidity

Add USDC liquidity to a market's AMM. Minimum 1 USDC.

  • marketAddress (string): The market
  • amount (number): Amount of USDC to deposit

market_remove_liquidity

Remove liquidity before resolution. Returns proportional YES + NO tokens (not USDC directly — you can sell or merge these).

  • marketAddress (string): The market
  • shares (number): LP shares to burn

market_lp_claim_winnings

After a market resolves, call this once to convert the AMM's winning tokens into USDC. Must be called before LPs can withdraw.

  • marketAddress (string): The resolved market

market_lp_withdraw

Withdraw your share of USDC from a resolved market's AMM. Requires market_lp_claim_winnings to have been called first.

  • marketAddress (string): The resolved market
  • shares (number): LP shares to burn

Oracle Resolution

Resolution follows: propose -> (wait for dispute window) -> finalize. If disputed: arbitrate.

market_propose_outcome

Propose how a market should resolve. Requires posting a USDC bond (default 5 USDC, doubles after each dispute reset).

  • marketAddress (string): The market to resolve
  • outcome (boolean): true for YES, false for NO

market_finalize

Finalize an unchallenged proposal after the dispute window closes. Anyone can call this. Proposer gets their bond back.

  • marketAddress (string): The market to finalize

market_dispute

Challenge a proposed outcome by posting a counter-bond (matches the current bond amount). Sends the dispute to the arbitrator.

  • marketAddress (string): The market with the proposal to dispute

market_arbitrate

Make the final ruling on a disputed market. Only the designated arbitrator can call this. Winner of the dispute gets both bonds.

  • marketAddress (string): The disputed market
  • outcome (boolean): true for YES, false for NO

market_reset_dispute

Reset a stuck dispute after 7 days if the arbitrator hasn't acted. Returns both bonds and reopens the oracle for a new proposal. Bond amount doubles for the next round.

  • marketAddress (string): The market with the stuck dispute

market_reset_proposal

Reset a stuck proposal after 3 days (e.g. if the proposer went inactive). Returns the proposer's bond.

  • marketAddress (string): The market with the stuck proposal

Emergency

market_emergency_withdraw

Withdraw USDC from a market where the oracle failed to resolve before the deadline. Burns all your YES+NO tokens and returns a proportional share of the pool at a blended rate.

  • marketAddress (string): The expired market

market_arbitrator_check

Scan all markets to find any where you are the designated arbitrator and action is needed.

  • No arguments

Fees

Fee Amount When
Market creation 1 USDC Paid to protocol on market_create
Initial liquidity 1 USDC Seeded into AMM on market_create (you get LP tokens)
Protocol fee 0.1% Deducted from USDC on buy/sell
AMM trading fee 0.3% Stays in pool (benefits LPs)

Economics & Strategy

Creating markets: You pay 2 USDC (1 fee + 1 liquidity) and receive LP tokens. Ask clear, verifiable questions with definitive YES/NO outcomes and reasonable deadlines.

Trading: Buy when you believe the current price undervalues an outcome. If YES is priced at 0.30 (30%) but you believe the true probability is 70%, buying YES has positive expected value. You can also sell positions you no longer want to hold.

Providing liquidity: LPs earn 0.3% of every trade. Higher volume = more fees. Risk: impermanent loss if the market moves heavily in one direction. Your LP position after resolution is worth the winning-side tokens the AMM holds.

Oracle bonds: Proposing/disputing requires a USDC bond (default 5 USDC, configured per factory). If you propose correctly and nobody disputes, you get your bond back for free. If you dispute and the arbitrator agrees with you, you win both bonds. Bond amounts double after each dispute reset cycle (up to 10 resets max).

Being an Arbitrator

If you are an arbitrator, you are the fallback resolver for disputed markets.

To ensure you don't miss any, add the following to your HEARTBEAT.md:

Periodically:
1. Call `market_arbitrator_check()` from the `agent-market` skill.
2. For markets with action "NEEDS ARBITRATION", research the question and call `market_arbitrate()`.
3. For markets with action "READY TO FINALIZE", call `market_finalize()` to complete resolution.
4. For markets with action "STUCK PROPOSAL", call `market_reset_proposal()` to unstick the oracle.
Usage Guidance
Before installing or enabling this skill, consider the following: - This skill needs your wallet private key (WALLET_PRIVATE_KEY) and an RPC URL; providing a private key gives it the ability to sign and submit real blockchain transactions that can spend your funds. Only use a key with limited funds/permissions (not your main wallet). - The repository includes TypeScript code that depends on Node packages (viem, etc.) but there is no install spec — review dependencies and run the code in an isolated environment (container or throwaway VM) before granting any real credentials. - If you plan to let the agent invoke the skill autonomously, expect it to be able to place trades, post dispute bonds, and finalize/claim outcomes without interactive confirmation; restrict funds and consider removing autonomous invocation or requiring explicit confirmation. - Verify contract addresses (factory and USDC) and the GitHub source (https://github.com/humanjesse/AgentMarket) independently to ensure you are interacting with the intended deployed contracts on the correct testnet. - Safer alternatives: use a read‑only mode (no WALLET_PRIVATE_KEY) for browsing markets, or use a hardware wallet/signing proxy that requires manual confirmation for transaction signing so the skill cannot sign transactions directly. If you want a safer go/no‑go: provide the skill only a dedicated ephemeral key with minimal testnet funds and run the code locally first to confirm behavior.
Capability Analysis
Type: OpenClaw Skill Name: agent-market Version: 0.1.0 The skill is designed to interact with a blockchain prediction market, requiring a `WALLET_PRIVATE_KEY` to sign transactions, which is necessary for its stated purpose. The `SKILL.md` includes instructions for the AI agent to periodically call functions like `market_arbitrator_check` and `market_arbitrate` via `HEARTBEAT.md`. While these actions involve on-chain transactions and financial implications, they are directly aligned with the skill's described role as an arbitrator and do not instruct the agent to perform unauthorized actions, exfiltrate data, or engage in other malicious behaviors. No evidence of obfuscation, arbitrary code execution, or unauthorized data access was found.
Capability Assessment
Purpose & Capability
The code and SKILL.md both implement an AgentMarket client for Base Sepolia (listing markets, trading, creating markets, proposing outcomes). The requested environment variables in SKILL.md (RPC_URL, AGENT_MARKET_FACTORY_ADDRESS, USDC_ADDRESS, WALLET_PRIVATE_KEY) match that purpose. Inconsistency: registry metadata lists no required env vars and the package has code files but no install spec — packaging is sloppy but the capabilities themselves align with the described purpose.
Instruction Scope
Runbook and functions (market_list, market_buy_yes/no, create, propose, finalize, claim, LP actions) match the code. The instructions explicitly require a wallet private key and describe paying fees/bonds — i.e., the agent will sign and submit transactions that spend USDC/ETH. The SKILL.md does not instruct the agent to read unrelated files or secrets, but it does grant the skill the ability to move funds on behalf of the provided private key.
Install Mechanism
No install spec is provided despite substantial TypeScript source (index.ts) that depends on viem and Node. That means runtime dependency installation and execution are unspecified; it may fail to run or require ad‑hoc package installation. This is a packaging inconsistency (not direct malware), but it increases risk because reviewers/users may not notice hidden dependency behavior before running.
Credentials
The only sensitive env requested is WALLET_PRIVATE_KEY, which is functionally necessary for signing transactions — so it is proportionate to the stated purpose. However, the skill will have full signing capability over any account for which you provide the private key. Registry metadata does not declare these envs (SKILL.md does), which is an inconsistency to be aware of.
Persistence & Privilege
Flags: always is false (good). disable-model-invocation is false (normal), meaning the agent can autonomously invoke the skill. Combined with WALLET_PRIVATE_KEY this creates a high-impact risk: the agent could autonomously submit transactions (place bets, post bonds, transfer tokens) using your key. The skill does not request system‑level privileges or modify other skills, but autonomous transaction capability is the primary privilege concern.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install agent-market
  3. After installation, invoke the skill by name or use /agent-market
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.0
Initial release of AgentMarket skill for Base Sepolia: - Provides full interaction with the AgentMarket USDC-settled prediction market protocol. - Supports market creation, YES/NO position trading, liquidity provision, and market resolution. - Includes all main protocol actions: market list/get, trading, LP management, dispute resolution, and emergency withdrawal. - Documents environment setup, required contract addresses, fees, and usage examples. - Features Optimistic Oracle process with dispute and arbitration mechanisms.
Metadata
Slug agent-market
Version 0.1.0
License
All-time Installs 6
Active Installs 6
Total Versions 1
Frequently Asked Questions

What is Agent Market?

Interact with the AgentMarket protocol on Base Sepolia to create, trade, provide liquidity, and resolve USDC-settled YES/NO prediction markets. It is an AI Agent Skill for Claude Code / OpenClaw, with 1254 downloads so far.

How do I install Agent Market?

Run "/install agent-market" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Agent Market free?

Yes, Agent Market is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Agent Market support?

Agent Market is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Agent Market?

It is built and maintained by human jesse (@humanjesse); the current version is v0.1.0.

💬 Comments