PolyClaw records every trade in a local JSON file atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/deniszidbaev-cmyk/polyclaw-cmyk/llms.txt
Use this file to discover all available pages before exploring further.
~/.openclaw/polyclaw/positions.json. The positions commands read that file, fetch current prices from the Gamma API, and compute live profit/loss for each entry. You can also add positions manually (for importing legacy trades), close them, or delete records.
polyclaw positions
Lists your positions with live P&L fetched from the Gamma API.
Usage
Include closed positions in the output. By default only
open positions are shown.Output as a JSON array instead of a formatted table.
| Column | Description |
|---|---|
ID | First 8 characters of the position UUID |
Side | YES or NO |
Entry | Effective entry price after accounting for CLOB sell recovery |
Now | Current market price from Gamma API |
P&L | Absolute profit/loss in USD |
Market | Truncated market question (first 35 chars) |
polyclaw redeem list is shown.
polyclaw position <position_id>
Shows full details for a single position, including all stored fields and a live P&L breakdown.
Usage
Position ID prefix. As few as 8 characters are sufficient as long as the prefix is unambiguous. The full UUID is shown in
polyclaw positions output.How P&L is calculated
Token count equalsentry_amount because the CTF split always mints 1 token per $1 deposited.
Determine actual cost basis
If the CLOB sell filled (
clob_filled: true), the cost is reduced by the approximate recovery: actual_cost = entry_amount − (token_count × unwanted_price × 0.9). The 0.9 factor models approximately 10% slippage from the FOK discount.If the CLOB sell did not fill, actual_cost = entry_amount (full split amount).Calculate current value
current_value = token_count × current_pricecurrent_price is the live YES or NO price from the Gamma API, depending on your position side.Position data
Positions are stored locally in~/.openclaw/polyclaw/positions.json. Each entry contains:
| Field | Type | Description |
|---|---|---|
position_id | string | UUID assigned at trade time |
market_id | string | Polymarket market ID |
question | string | Market question text |
position | string | "YES" or "NO" |
token_id | string | ERC-1155 token ID for the purchased outcome |
entry_time | string | ISO 8601 timestamp of trade execution |
entry_amount | float | USD amount deposited in the split |
entry_price | float | Market price at entry |
split_tx | string | On-chain splitPosition transaction hash |
clob_order_id | string | null | CLOB order identifier (off-chain) |
clob_filled | bool | Whether the FOK sell was matched |
status | string | "open", "closed", or "resolved" |
condition_id | string | CTF condition ID (used for redemption) |
redeem_tx | string | null | Transaction hash once redeemed, or null |
Advanced subcommands
positions add
Manually add a position record. Useful for importing trades executed outside of PolyClaw.
Market ID.
Position side.
Entry amount in USD.
Entry price (0–1).
Market question text (defaults to
"Manual entry").ERC-1155 token ID for the outcome.
Transaction hash (defaults to
"manual").positions close
Mark a position as closed without deleting the record.
positions delete
Permanently delete a position record from local storage. Prompts for confirmation unless --force is used.
Skip the
[y/N] confirmation prompt. Also accepts -f.