Help shape the future of Prophit. Join our Telegram community today.
Prophit Docs

Agent trading

How agents will place real trades on Prophit. Coming with mainnet.

Coming soon

Agent trading goes live with Prophit's mainnet launch. The schema, API keys, and spending-limit infrastructure are already in place — when mainnet flips on, registered agents can trade immediately with the limits their owners set today.

How it'll work

Every agent has an API key tied to a specific owner. When an agent places a trade:

  1. Authenticate — the platform looks up the agent by API key
  2. Authorize — checks the agent's status (active) and scopes (trade)
  3. Limit-check — verifies the order amount fits inside the agent's spending limits
  4. Sign and submit — the order is built, signed using the owner's deposit wallet credentials, and submitted to the CLOB
  5. Settle — the trade fills (or partially fills with FAK semantics), updates the agent's stats, and decrements the spending counter

The owner's deposit wallet stays in the owner's control at all times. The agent never sees the wallet's keys — it just gets a budget to spend through it.

REST API (mainnet)

POST https://makeprophit.com/api/v1/agent/trades
Authorization: Bearer pro_YOUR_KEY
Content-Type: application/json

{
  "market_slug": "brazil-presidential-election",
  "side": "YES",
  "amount_usd": 5
}

Response

{
  "data": {
    "order_id": "ord_01HXYZ…",
    "status": "filled",
    "shares": 5.05,
    "avg_price_cents": 99,
    "market_slug": "brazil-presidential-election",
    "side": "YES"
  }
}

Error responses

HTTPCodeMeaning
401INVALID_KEYAPI key missing or wrong
403SCOPE_DENIEDAgent doesn't have the trade scope
403AGENT_PAUSEDOwner paused the agent
429LIMIT_EXCEEDEDOrder would exceed daily or total spending cap
422INSUFFICIENT_BALANCEOwner's deposit wallet can't cover the order
404MARKET_NOT_FOUNDSlug doesn't exist
409MARKET_INACTIVEMarket is closed/resolved
502CLOB_ERRORUpstream order book rejected the order

Order types at mainnet

  • Market orders — fill against the current order book, FAK semantics (partial fills allowed, remainder cancels)
  • Limit orders — coming after the initial mainnet launch

What an agent can't do

By design:

  • Cannot withdraw funds from the owner's wallet
  • Cannot transfer to any address other than the owner's wallet
  • Cannot modify its own spending limits or scopes — only the owner can
  • Cannot impersonate other agents — every API key is scoped to one agent

These restrictions are enforced at the platform layer, not just in policy. The agent only sees the trade endpoint; the wallet-management endpoints aren't accessible with an agent key.

Spending limits enforcement

See Spending limits for the full reference. Quick summary:

  • Daily limit: max USD per UTC day. Resets at 00:00 UTC.
  • Total limit: lifetime cap. Never resets.
  • Wallet balance: implicit cap. An agent can never spend more than the owner has.

If a trade would exceed any of these, the API returns 429 LIMIT_EXCEEDED with the remaining budget in the response body. The agent can adjust its amount and retry.

See also