@quantish/agent 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +50 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2751,7 +2751,28 @@ const data = await response.json();
|
|
|
2751
2751
|
const result = JSON.parse(data.result.content[0].text);
|
|
2752
2752
|
\`\`\`
|
|
2753
2753
|
|
|
2754
|
+
### \u26A0\uFE0F CRITICAL: Tool-to-Server Mapping (MEMORIZE THIS)
|
|
2755
|
+
|
|
2756
|
+
| Tool Name | Server | Auth Required | Helper Function |
|
|
2757
|
+
|-----------|--------|---------------|-----------------|
|
|
2758
|
+
| \`get_balances\` | TRADING | Yes (QUANTISH_API_KEY) | callTradingTool() |
|
|
2759
|
+
| \`get_positions\` | TRADING | Yes | callTradingTool() |
|
|
2760
|
+
| \`place_order\` | TRADING | Yes | callTradingTool() |
|
|
2761
|
+
| \`cancel_order\` | TRADING | Yes | callTradingTool() |
|
|
2762
|
+
| \`get_orders\` | TRADING | Yes | callTradingTool() |
|
|
2763
|
+
| \`get_orderbook\` | TRADING | Yes | callTradingTool() |
|
|
2764
|
+
| \`get_price\` | TRADING | Yes | callTradingTool() |
|
|
2765
|
+
| \`get_deposit_addresses\` | TRADING | Yes | callTradingTool() |
|
|
2766
|
+
| \`transfer_usdc\` | TRADING | Yes | callTradingTool() |
|
|
2767
|
+
| \`search_markets\` | DISCOVERY | No (public key) | callDiscoveryTool() |
|
|
2768
|
+
| \`get_market_details\` | DISCOVERY | No | callDiscoveryTool() |
|
|
2769
|
+
| \`get_trending_markets\` | DISCOVERY | No | callDiscoveryTool() |
|
|
2770
|
+
| \`find_arbitrage\` | DISCOVERY | No | callDiscoveryTool() |
|
|
2771
|
+
|
|
2754
2772
|
### Key Trading Tools (require QUANTISH_API_KEY)
|
|
2773
|
+
URL: https://quantish-sdk-production.up.railway.app/mcp/execute
|
|
2774
|
+
Format: JSON-RPC 2.0 ({ jsonrpc, method, params, id })
|
|
2775
|
+
|
|
2755
2776
|
- \`get_balances\`: Returns { usdc, nativeUsdc, matic } for EOA and Safe wallets
|
|
2756
2777
|
- \`get_positions\`: Returns array of current share holdings with market info
|
|
2757
2778
|
- \`place_order\`: Place order. Args: { conditionId, tokenId, side: "BUY"|"SELL", price: 0.01-0.99, size: number }
|
|
@@ -2763,6 +2784,8 @@ const result = JSON.parse(data.result.content[0].text);
|
|
|
2763
2784
|
- \`transfer_usdc\`: Send USDC. Args: { toAddress, amount }
|
|
2764
2785
|
|
|
2765
2786
|
### Key Discovery Tools (free, no auth required)
|
|
2787
|
+
URL: https://quantish.live/mcp/execute
|
|
2788
|
+
Format: Simple ({ name, arguments }) - NOT JSON-RPC!
|
|
2766
2789
|
Discovery uses a SIMPLER request format (not full JSON-RPC):
|
|
2767
2790
|
\`\`\`javascript
|
|
2768
2791
|
// Discovery API - uses simple { name, arguments } format
|
|
@@ -2800,6 +2823,19 @@ Example flow:
|
|
|
2800
2823
|
3. Extract tokenId for YES/NO outcome you want
|
|
2801
2824
|
4. place_order({ conditionId, tokenId, side: "BUY", price: 0.55, size: 100 })
|
|
2802
2825
|
|
|
2826
|
+
### \u26A0\uFE0F CRITICAL: Market Search Behavior
|
|
2827
|
+
When searching for markets:
|
|
2828
|
+
1. **ALWAYS look at the actual results** - Don't say "I don't see any" without checking
|
|
2829
|
+
2. **Be flexible with timeframes** - If user asks for "15 minute" market, use any similar short-term market (5min, 10min, 30min)
|
|
2830
|
+
3. **Show what IS available** - If exact match not found, show the user what markets ARE available
|
|
2831
|
+
4. **Extract and use the data** - The search returns clobTokenIds, conditionId, etc. - USE THEM
|
|
2832
|
+
5. **Parse the results properly** - Results are in data.result.content[0].text as JSON string
|
|
2833
|
+
|
|
2834
|
+
The search results contain EVERYTHING needed:
|
|
2835
|
+
- \`markets[].markets[].clobTokenIds\` - Parse this JSON string to get token IDs
|
|
2836
|
+
- \`markets[].markets[].conditionId\` - The condition ID for orders
|
|
2837
|
+
- \`markets[].title\` - Market title with timeframe info
|
|
2838
|
+
|
|
2803
2839
|
### Bot Code Template (Node.js)
|
|
2804
2840
|
\`\`\`javascript
|
|
2805
2841
|
#!/usr/bin/env node
|
|
@@ -2861,14 +2897,24 @@ When generating ANY code that uses Quantish/MCP (bots, apps, scripts, APIs, etc.
|
|
|
2861
2897
|
|
|
2862
2898
|
### MANDATORY Requirements
|
|
2863
2899
|
|
|
2864
|
-
1. **ALWAYS include
|
|
2865
|
-
2. **
|
|
2866
|
-
|
|
2900
|
+
1. **ALWAYS include BOTH callTradingTool() AND callDiscoveryTool() helper functions** - Copy them EXACTLY from the template
|
|
2901
|
+
2. **USE THE CORRECT HELPER FOR EACH TOOL** - Check the tool-to-server mapping table above!
|
|
2902
|
+
- Trading tools (get_price, get_orderbook, place_order, etc.) \u2192 callTradingTool()
|
|
2903
|
+
- Discovery tools (search_markets, get_market_details, etc.) \u2192 callDiscoveryTool()
|
|
2904
|
+
3. **NEVER hardcode prices, market data, or API responses** - Always fetch live data
|
|
2867
2905
|
4. **NEVER comment out MCP calls** - All API calls must be real, working, executable code
|
|
2868
2906
|
5. **ALWAYS create .env.example** - Document all required environment variables
|
|
2869
|
-
6. **ALWAYS validate QUANTISH_API_KEY exists** - Fail fast with clear error if missing
|
|
2907
|
+
6. **ALWAYS validate QUANTISH_API_KEY exists** when using Trading tools - Fail fast with clear error if missing
|
|
2870
2908
|
7. **ALWAYS use dotenv** - \`require('dotenv').config()\` at the top of every file
|
|
2871
2909
|
|
|
2910
|
+
### \u26D4 NEVER DO WORKAROUNDS
|
|
2911
|
+
|
|
2912
|
+
- **NEVER try to "work around" missing tools** - If a tool requires auth, use auth
|
|
2913
|
+
- **NEVER substitute one tool for another** - get_market_details is NOT a replacement for get_price
|
|
2914
|
+
- **NEVER use the Discovery API for tools that require Trading API** - They are separate servers
|
|
2915
|
+
- **NEVER mock or simulate API responses** - Always make real API calls
|
|
2916
|
+
- **If a feature requires QUANTISH_API_KEY, tell the user they need one** - Don't try to avoid it
|
|
2917
|
+
|
|
2872
2918
|
### File Structure for ANY Application
|
|
2873
2919
|
|
|
2874
2920
|
When creating an application, ALWAYS create these files:
|