بنقرة واحدة
relation-discovery
Discover market relations (8 types) that map 1:1 to builtin arbitrage strategies.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Discover market relations (8 types) that map 1:1 to builtin arbitrage strategies.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when the user asks to run the full trading workflow end-to-end, from finding markets to paper trading — covers discover, backtest, and paper-run in sequence.
Run paper trading after backtest passes, with monitoring and intervention.
Manage multi-strategy portfolios and automate lifecycle.
Write spread strategy code as a Strategy subclass and register it.
Backtest strategies against historical data.
Execute live trading with explicit authorization, strict risk and emergency controls.
| name | relation-discovery |
| description | Discover market relations (8 types) that map 1:1 to builtin arbitrage strategies. |
Use this skill when the user asks to find spread, arbitrage, or related market opportunities.
The core idea: every tradable opportunity is a relation between markets. There are 8 relation types mapping to 7 strategy classes. Discovering relations = finding trades.
Detected automatically by market discover --auto-discover. No semantic judgment needed.
1. implication → ImplicationArbStrategy
2. exclusivity → GroupArbStrategy
3. complementary → GroupArbStrategy (same strategy as exclusivity)
Note:
exclusivityandcomplementaryshare the sameGroupArbStrategy. The distinction is semantic (sum <= 1 vs sum = 1) but trading logic is identical.
These require the agent to search, read context, compare resolution rules, and decide. After running market discover, the agent MUST review the output and identify candidates for these types.
4. same_event → DirectArbStrategy
5. correlated → CointSpreadStrategy
6. structural → StructuralArbStrategy
7. conditional → ConditionalArbStrategy
8. temporal → LeadLagStrategy
Start here. Before searching for markets, understand what's happening in the world. Hot topics = active markets = trading opportunities.
coinjure market news --limit 15
Read the headlines and extract keywords for the current news cycle. Group them by theme:
These keywords drive Step 2.
This is the most important step. Use the keywords from Step 1 to search for markets. Finding relations means finding groups of related markets. This requires iterative, exploratory searching — you won't find all the pieces in one query.
The core loop:
Example workflow for discovering a group:
News headlines: "Iran warship sunk", "US gasoline up 17%", "Schumer oil reserves"
→ Keywords: "Iran", "oil", "gasoline", "conflict"
Search "Iran ceasefire" → find 4 ceasefire markets with different dates
→ implication chain (auto-discovered)
Search "Iran" on Kalshi → find matching Kalshi Iran markets
→ Cross-reference → same_event candidates
Search "oil price" → find oil/gasoline markets
→ Cross-reference with Iran conflict markets → correlated candidates
After exhausting news-driven topics, sweep remaining categories:
Use BOTH keyword queries (-q) AND tag filters (-t):
# Keyword search — driven by news topics
coinjure market discover -q "keyword1" -q "keyword2" --exchange polymarket --limit 40
# Tag search — broad category sweep
coinjure market discover -t "Politics" --exchange polymarket --limit 100
# Cross-platform (for same_event discovery)
coinjure market discover -q "keyword1" --exchange kalshi --limit 40
Keep going until you have explored at least 10+ topic areas. Prioritize news-driven topics first — they have the most active markets and price movement. Auto-discover detects intra-event structural relations (implication, exclusivity, complementary) automatically from the results.
After each discover call, review the market output carefully and cross-reference results across queries. The agent must actively connect the dots:
same_event — requires searching the same keywords on both Polymarket and Kalshi, then comparing resolution rulescorrelated — requires searching across related topics (e.g., "ceasefire" results vs "election" results) and judging causal linksstructural — requires finding markets with numerical thresholds on the same metric (e.g., BTC $100K and BTC $120K across different events)conditional — requires reasoning about logical preconditions across eventstemporal — requires identifying leader/follower dynamics across eventsKey principle: Auto-discover only finds relations within a single event. All cross-event and cross-platform relations require the agent to search multiple times, compare results, and make semantic judgments.
coinjure market info --market-id <id> --json
coinjure market relations add \
-m <id1> -m <id2> -m <id3> \
--spread-type <type> \
--hypothesis "price relationship" \
--reasoning "why these are related"
Exchange is auto-detected per market ID (numeric → polymarket, else → kalshi). Override with --exchange polymarket|kalshi.
coinjure market relations list --json
# Remove a single relation
coinjure market relations remove <relation_id>
# Remove ALL relations (no --all flag exists, so loop)
coinjure market relations list 2>&1 \
| grep '│' \
| awk -F'│' '{gsub(/^[ \t]+|[ \t]+$/, "", $2); if ($2 != "" && $2 != "Relation ID") print $2}' \
| while read id; do coinjure market relations remove "$id"; done
Only after accumulating a substantial pool of relations (20+):
coinjure engine backtest --all-relations --json
This uses API price history. Focus on which relations show positive PnL and trades.
All builtin strategies: coinjure/strategy/builtin/
Mapping dict: coinjure.strategy.builtin.STRATEGY_BY_RELATION (relation type → strategy class)
| Type | Method | Valid when |
|---|---|---|
| implication | structural constraint | price_A <= price_B holds |
| exclusivity | structural constraint | sum(prices) <= 1 holds |
| complementary | structural constraint | sum(prices) ~= 1.0 |
| same_event | cross-platform comparison | prices converge (< min_edge) |
| correlated | cointegration + ADF | is_cointegrated == true |
| structural | residual analysis | spread stationary around model |
| conditional | conditional bounds | bounds hold with low violation rate |
| temporal | cross-correlation | lead_lag_significant == true |
Note: constraint violations are the arb opportunities — low violation rates are fine.
discover call, the agent MUST review output and cross-reference with previous search results to identify agent-judged relation candidates.-m to specify each market in the group.