@bitget-ai/getagent-skill 0.2.1

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.
Files changed (57) hide show
  1. package/.claude-plugin/marketplace.json +28 -0
  2. package/.claude-plugin/plugin.json +12 -0
  3. package/README.md +99 -0
  4. package/VERSION +1 -0
  5. package/bin/getagent-skill.js +140 -0
  6. package/package.json +45 -0
  7. package/skills/getagent/SKILL.md +129 -0
  8. package/skills/getagent/examples/btc-ema-cross-demo/README.md +61 -0
  9. package/skills/getagent/examples/btc-ema-cross-demo/backtest.yaml +33 -0
  10. package/skills/getagent/examples/btc-ema-cross-demo/manifest.yaml +94 -0
  11. package/skills/getagent/examples/btc-ema-cross-demo/src/main.py +88 -0
  12. package/skills/getagent/examples/btc-ema-cross-demo/src/strategy.py +118 -0
  13. package/skills/getagent/references/api/enable.md +95 -0
  14. package/skills/getagent/references/api/error-responses.md +77 -0
  15. package/skills/getagent/references/api/index.md +38 -0
  16. package/skills/getagent/references/api/list.md +80 -0
  17. package/skills/getagent/references/api/my-playbooks.md +41 -0
  18. package/skills/getagent/references/api/publish.md +76 -0
  19. package/skills/getagent/references/api/run.md +149 -0
  20. package/skills/getagent/references/api/upload.md +76 -0
  21. package/skills/getagent/references/backtest-engine.md +438 -0
  22. package/skills/getagent/references/package-schema.md +552 -0
  23. package/skills/getagent/references/sandbox-runtime.md +201 -0
  24. package/skills/getagent/references/sdk/backtest/catalog.md +208 -0
  25. package/skills/getagent/references/sdk/data/arxiv.md +41 -0
  26. package/skills/getagent/references/sdk/data/catalog.md +56 -0
  27. package/skills/getagent/references/sdk/data/commodity.md +226 -0
  28. package/skills/getagent/references/sdk/data/coverage.md +82 -0
  29. package/skills/getagent/references/sdk/data/crypto.md +2906 -0
  30. package/skills/getagent/references/sdk/data/currency.md +123 -0
  31. package/skills/getagent/references/sdk/data/derivatives.md +269 -0
  32. package/skills/getagent/references/sdk/data/economy.md +1348 -0
  33. package/skills/getagent/references/sdk/data/equity.md +2120 -0
  34. package/skills/getagent/references/sdk/data/etf.md +372 -0
  35. package/skills/getagent/references/sdk/data/famafrench.md +201 -0
  36. package/skills/getagent/references/sdk/data/fixedincome.md +804 -0
  37. package/skills/getagent/references/sdk/data/imf_utils.md +225 -0
  38. package/skills/getagent/references/sdk/data/index.md +216 -0
  39. package/skills/getagent/references/sdk/data/news.md +149 -0
  40. package/skills/getagent/references/sdk/data/playbook-supported.md +9871 -0
  41. package/skills/getagent/references/sdk/data/regulators.md +299 -0
  42. package/skills/getagent/references/sdk/data/sentiment.md +323 -0
  43. package/skills/getagent/references/sdk/data/uscongress.md +126 -0
  44. package/skills/getagent/references/sdk/data/web_search.md +68 -0
  45. package/skills/getagent/references/sdk/data/wikipedia.md +97 -0
  46. package/skills/getagent/references/sdk/llm/catalog.md +117 -0
  47. package/skills/getagent/references/sdk/runtime/catalog.md +195 -0
  48. package/skills/getagent/references/sdk/trade/account.md +61 -0
  49. package/skills/getagent/references/sdk/trade/catalog.md +35 -0
  50. package/skills/getagent/references/sdk/trade/contract.md +331 -0
  51. package/skills/getagent/references/sdk/trade/helpers.md +466 -0
  52. package/skills/getagent/references/sdk/trade/market.md +28 -0
  53. package/skills/getagent/references/sdk/trade/patterns.md +102 -0
  54. package/skills/getagent/references/sdk/trade/spot.md +165 -0
  55. package/skills/getagent/references/sdk.md +198 -0
  56. package/skills/getagent/scripts/validate.py +965 -0
  57. package/skills/getagent/scripts/version_check.sh +62 -0
@@ -0,0 +1,35 @@
1
+ # Trade Reference Catalog
2
+
3
+ This catalog is the self-contained authoring index for `getagent.trade`.
4
+ Use it instead of reading the vendored `trade_sdk` implementation directly.
5
+
6
+ ## Read order
7
+
8
+ 1. Start with [`patterns.md`](patterns.md) for safe end-to-end flows.
9
+ 2. Use the namespace files below for exact method signatures.
10
+ 3. Always call `trade.is_success(result)` after mutations or live queries
11
+ that return envelopes.
12
+
13
+ ## Namespace index
14
+
15
+ | Namespace | File | Methods | Use for |
16
+ |---|---|---:|---|
17
+ | `trade.account` | [account.md](account.md) | 3 | Account queries and internal balance transfers. |
18
+ | `trade.market` | [market.md](market.md) | 1 | Market capability checks before order placement. |
19
+ | `trade.spot` | [spot.md](spot.md) | 8 | Spot query, place, cancel, and modify flows. |
20
+ | `trade.contract` | [contract.md](contract.md) | 15 | USDT futures query, leverage, order, TP/SL, and close flows. |
21
+ | `trade.helpers` | [helpers.md](helpers.md) | 19 | Deterministic symbol, qty, TP/SL, and selector helpers. |
22
+
23
+ ## Contract notes
24
+
25
+ - Playbook code must import `getagent.trade`, not `trade_sdk`.
26
+ - Runner-managed identity parameters are hidden from author-facing
27
+ examples and should not be hardcoded.
28
+ - For budget-based orders, use `trade.helpers.compute_qty(...)` instead
29
+ of mental math.
30
+ - For contract opens, keep one `leverage` variable across qty sizing,
31
+ TP/SL planning, and the final open call.
32
+ - For live position checks, `select_contract_position(...)` raises when the
33
+ account is flat and does not expose `.found`. Use
34
+ `find_contract_position(...)` or `contract_position_records(...)` for normal
35
+ empty-account branches.
@@ -0,0 +1,331 @@
1
+ # Trade Contract Reference
2
+
3
+ USDT futures query, leverage, order, TP/SL, and close flows.
4
+
5
+ These signatures are written against the `getagent.trade` public contract.
6
+ Runner-managed identity kwargs (`user_id`, `channel`, `trace_id`) are
7
+ intentionally omitted from the author-facing signatures below.
8
+
9
+ ## Contents
10
+ - [`trade.contract.pending_orders`](#tradecontractpending-orders)
11
+ - [`trade.contract.plan_pending_orders`](#tradecontractplan-pending-orders)
12
+ - [`trade.contract.current_position`](#tradecontractcurrent-position)
13
+ - [`trade.contract.fills`](#tradecontractfills)
14
+ - [`trade.contract.change_leverage`](#tradecontractchange-leverage)
15
+ - [`trade.contract.place_order`](#tradecontractplace-order)
16
+ - [`trade.contract.cancel_order`](#tradecontractcancel-order)
17
+ - [`trade.contract.modify_limit_order`](#tradecontractmodify-limit-order)
18
+ - [`trade.contract.close_position`](#tradecontractclose-position)
19
+ - [`trade.contract.modify_take_profit`](#tradecontractmodify-take-profit)
20
+ - [`trade.contract.modify_stop_loss`](#tradecontractmodify-stop-loss)
21
+ - [`trade.contract.open_long_market`](#tradecontractopen-long-market)
22
+ - [`trade.contract.open_short_market`](#tradecontractopen-short-market)
23
+ - [`trade.contract.open_long_limit`](#tradecontractopen-long-limit)
24
+ - [`trade.contract.open_short_limit`](#tradecontractopen-short-limit)
25
+
26
+ ## Method reference
27
+
28
+ ### `trade.contract.pending_orders`
29
+
30
+ ```python
31
+ trade.contract.pending_orders(symbol="", limit=None, product_type='USDT-FUTURES')
32
+ ```
33
+
34
+ Summary: List live (unfilled) contract orders, optionally filtered by ``symbol``.
35
+
36
+ | Param | Required | Type | Default |
37
+ |---|---|---|---|
38
+ | `symbol` | `no` | `str` | `""` |
39
+ | `limit` | `no` | `int | None` | `None` |
40
+ | `product_type` | `no` | `str` | `USDT-FUTURES` |
41
+
42
+ Returns: `ContractPendingOrdersResult`
43
+
44
+ ---
45
+
46
+ ### `trade.contract.plan_pending_orders`
47
+
48
+ ```python
49
+ trade.contract.plan_pending_orders(symbol="", limit=None, product_type='USDT-FUTURES')
50
+ ```
51
+
52
+ Summary: List live TP/SL (plan) orders, optionally filtered by ``symbol``.
53
+
54
+ | Param | Required | Type | Default |
55
+ |---|---|---|---|
56
+ | `symbol` | `no` | `str` | `""` |
57
+ | `limit` | `no` | `int | None` | `None` |
58
+ | `product_type` | `no` | `str` | `USDT-FUTURES` |
59
+
60
+ Returns: `PlanPendingOrdersResult`
61
+
62
+ ---
63
+
64
+ ### `trade.contract.current_position`
65
+
66
+ ```python
67
+ trade.contract.current_position(symbol="", product_type='USDT-FUTURES')
68
+ ```
69
+
70
+ Summary: Query live contract positions, optionally filtered by ``symbol``.
71
+
72
+ | Param | Required | Type | Default |
73
+ |---|---|---|---|
74
+ | `symbol` | `no` | `str` | `""` |
75
+ | `product_type` | `no` | `str` | `USDT-FUTURES` |
76
+
77
+ Returns: `ContractCurrentPositionResult`
78
+
79
+ ---
80
+
81
+ ### `trade.contract.fills`
82
+
83
+ ```python
84
+ trade.contract.fills(symbol="", order_id="", limit=None, product_type='USDT-FUTURES')
85
+ ```
86
+
87
+ Summary: List recent contract trade fills, optionally scoped to one order.
88
+
89
+ | Param | Required | Type | Default |
90
+ |---|---|---|---|
91
+ | `symbol` | `no` | `str` | `""` |
92
+ | `order_id` | `no` | `str` | `""` |
93
+ | `limit` | `no` | `int | None` | `None` |
94
+ | `product_type` | `no` | `str` | `USDT-FUTURES` |
95
+
96
+ Returns: `ContractFillsResult`
97
+
98
+ ---
99
+
100
+ ### `trade.contract.change_leverage`
101
+
102
+ ```python
103
+ trade.contract.change_leverage(symbol, leverage, product_type='USDT-FUTURES', margin_coin='USDT')
104
+ ```
105
+
106
+ Summary: Change the contract leverage for ``symbol`` before opening a position.
107
+
108
+ | Param | Required | Type | Default |
109
+ |---|---|---|---|
110
+ | `symbol` | `yes` | `str` | - |
111
+ | `leverage` | `yes` | `Any` | - |
112
+ | `product_type` | `no` | `str` | `USDT-FUTURES` |
113
+ | `margin_coin` | `no` | `str` | `USDT` |
114
+
115
+ Returns: `ChangeLeverageResult`
116
+
117
+ ---
118
+
119
+ ### `trade.contract.place_order`
120
+
121
+ ```python
122
+ trade.contract.place_order(symbol, side, order_type, qty, price="", product_type='USDT-FUTURES', margin_mode='crossed', margin_coin='USDT', pos_side="", trade_side="", tp_trigger_price="", sl_trigger_price="")
123
+ ```
124
+
125
+ Summary: Place a contract order with full parameter control.
126
+
127
+ | Param | Required | Type | Default |
128
+ |---|---|---|---|
129
+ | `symbol` | `yes` | `str` | - |
130
+ | `side` | `yes` | `SideLiteral` | - |
131
+ | `order_type` | `yes` | `OrderTypeLiteral` | - |
132
+ | `qty` | `yes` | `Any` | - |
133
+ | `price` | `no` | `Any` | `""` |
134
+ | `product_type` | `no` | `str` | `USDT-FUTURES` |
135
+ | `margin_mode` | `no` | `MarginModeLiteral` | `crossed` |
136
+ | `margin_coin` | `no` | `str` | `USDT` |
137
+ | `pos_side` | `no` | `PosSideOrEmptyLiteral` | `""` |
138
+ | `trade_side` | `no` | `TradeSideOrEmptyLiteral` | `""` |
139
+ | `tp_trigger_price` | `no` | `Any` | `""` |
140
+ | `sl_trigger_price` | `no` | `Any` | `""` |
141
+
142
+ Returns: `OrderPlacedResult`
143
+
144
+ ---
145
+
146
+ ### `trade.contract.cancel_order`
147
+
148
+ ```python
149
+ trade.contract.cancel_order(symbol, order_id, product_type='USDT-FUTURES')
150
+ ```
151
+
152
+ Summary: Cancel a live contract order by ``order_id``.
153
+
154
+ | Param | Required | Type | Default |
155
+ |---|---|---|---|
156
+ | `symbol` | `yes` | `str` | - |
157
+ | `order_id` | `yes` | `str` | - |
158
+ | `product_type` | `no` | `str` | `USDT-FUTURES` |
159
+
160
+ Returns: `OrderPlacedResult`
161
+
162
+ ---
163
+
164
+ ### `trade.contract.modify_limit_order`
165
+
166
+ ```python
167
+ trade.contract.modify_limit_order(symbol, order_id, price, qty, tp_trigger_price, sl_trigger_price)
168
+ ```
169
+
170
+ Summary: Modify a live contract limit order's price/qty/TP/SL atomically.
171
+
172
+ | Param | Required | Type | Default |
173
+ |---|---|---|---|
174
+ | `symbol` | `yes` | `str` | - |
175
+ | `order_id` | `yes` | `str` | - |
176
+ | `price` | `yes` | `Any` | - |
177
+ | `qty` | `yes` | `Any` | - |
178
+ | `tp_trigger_price` | `yes` | `Any` | - |
179
+ | `sl_trigger_price` | `yes` | `Any` | - |
180
+
181
+ Returns: `OrderPlacedResult`
182
+
183
+ ---
184
+
185
+ ### `trade.contract.close_position`
186
+
187
+ ```python
188
+ trade.contract.close_position(symbol, hold_side, product_type='USDT-FUTURES')
189
+ ```
190
+
191
+ Summary: Fully close the ``hold_side`` contract position for ``symbol``.
192
+
193
+ | Param | Required | Type | Default |
194
+ |---|---|---|---|
195
+ | `symbol` | `yes` | `str` | - |
196
+ | `hold_side` | `yes` | `HoldSideLiteral` | - |
197
+ | `product_type` | `no` | `str` | `USDT-FUTURES` |
198
+
199
+ Returns: `ClosePositionResult`
200
+
201
+ ---
202
+
203
+ ### `trade.contract.modify_take_profit`
204
+
205
+ ```python
206
+ trade.contract.modify_take_profit(symbol, order_id, trigger_price, product_type='USDT-FUTURES')
207
+ ```
208
+
209
+ Summary: Modify an existing take-profit plan order's ``trigger_price``.
210
+
211
+ | Param | Required | Type | Default |
212
+ |---|---|---|---|
213
+ | `symbol` | `yes` | `str` | - |
214
+ | `order_id` | `yes` | `str` | - |
215
+ | `trigger_price` | `yes` | `Any` | - |
216
+ | `product_type` | `no` | `str` | `USDT-FUTURES` |
217
+
218
+ Returns: `ModifyPlanOrderResult`
219
+
220
+ ---
221
+
222
+ ### `trade.contract.modify_stop_loss`
223
+
224
+ ```python
225
+ trade.contract.modify_stop_loss(symbol, order_id, trigger_price, product_type='USDT-FUTURES')
226
+ ```
227
+
228
+ Summary: Modify an existing stop-loss plan order's ``trigger_price``.
229
+
230
+ | Param | Required | Type | Default |
231
+ |---|---|---|---|
232
+ | `symbol` | `yes` | `str` | - |
233
+ | `order_id` | `yes` | `str` | - |
234
+ | `trigger_price` | `yes` | `Any` | - |
235
+ | `product_type` | `no` | `str` | `USDT-FUTURES` |
236
+
237
+ Returns: `ModifyPlanOrderResult`
238
+
239
+ ---
240
+
241
+ ### `trade.contract.open_long_market`
242
+
243
+ ```python
244
+ trade.contract.open_long_market(symbol, qty, leverage, tp_trigger_price="", sl_trigger_price="")
245
+ ```
246
+
247
+ Summary: Composite open-long market order: change leverage + place order.
248
+
249
+ | Param | Required | Type | Default |
250
+ |---|---|---|---|
251
+ | `symbol` | `yes` | `str` | - |
252
+ | `qty` | `yes` | `Any` | - |
253
+ | `leverage` | `yes` | `Any` | - |
254
+ | `tp_trigger_price` | `no` | `Any` | `""` |
255
+ | `sl_trigger_price` | `no` | `Any` | `""` |
256
+
257
+ Returns: `OpenPositionResult`
258
+
259
+ TP/SL trigger prices must align with the contract instrument price step. Do not
260
+ use fixed decimal rounding such as `str(round(price, 2))`; use
261
+ `trade.helpers.resolve_contract_tpsl(...)` or quantize custom trigger prices with
262
+ `trade.helpers.contract_rules(symbol).price_step` before calling this method.
263
+
264
+ ---
265
+
266
+ ### `trade.contract.open_short_market`
267
+
268
+ ```python
269
+ trade.contract.open_short_market(symbol, qty, leverage, tp_trigger_price="", sl_trigger_price="")
270
+ ```
271
+
272
+ Summary: Composite open-short market order: change leverage + place order.
273
+
274
+ | Param | Required | Type | Default |
275
+ |---|---|---|---|
276
+ | `symbol` | `yes` | `str` | - |
277
+ | `qty` | `yes` | `Any` | - |
278
+ | `leverage` | `yes` | `Any` | - |
279
+ | `tp_trigger_price` | `no` | `Any` | `""` |
280
+ | `sl_trigger_price` | `no` | `Any` | `""` |
281
+
282
+ Returns: `OpenPositionResult`
283
+
284
+ TP/SL trigger prices must align with the contract instrument price step. Do not
285
+ use fixed decimal rounding such as `str(round(price, 2))`; use
286
+ `trade.helpers.resolve_contract_tpsl(...)` or quantize custom trigger prices with
287
+ `trade.helpers.contract_rules(symbol).price_step` before calling this method.
288
+
289
+ ---
290
+
291
+ ### `trade.contract.open_long_limit`
292
+
293
+ ```python
294
+ trade.contract.open_long_limit(symbol, qty, price, leverage, tp_trigger_price="", sl_trigger_price="")
295
+ ```
296
+
297
+ Summary: Composite open-long limit order: change leverage + place limit order.
298
+
299
+ | Param | Required | Type | Default |
300
+ |---|---|---|---|
301
+ | `symbol` | `yes` | `str` | - |
302
+ | `qty` | `yes` | `Any` | - |
303
+ | `price` | `yes` | `Any` | - |
304
+ | `leverage` | `yes` | `Any` | - |
305
+ | `tp_trigger_price` | `no` | `Any` | `""` |
306
+ | `sl_trigger_price` | `no` | `Any` | `""` |
307
+
308
+ Returns: `OpenPositionResult`
309
+
310
+ ---
311
+
312
+ ### `trade.contract.open_short_limit`
313
+
314
+ ```python
315
+ trade.contract.open_short_limit(symbol, qty, price, leverage, tp_trigger_price="", sl_trigger_price="")
316
+ ```
317
+
318
+ Summary: Composite open-short limit order: change leverage + place limit order.
319
+
320
+ | Param | Required | Type | Default |
321
+ |---|---|---|---|
322
+ | `symbol` | `yes` | `str` | - |
323
+ | `qty` | `yes` | `Any` | - |
324
+ | `price` | `yes` | `Any` | - |
325
+ | `leverage` | `yes` | `Any` | - |
326
+ | `tp_trigger_price` | `no` | `Any` | `""` |
327
+ | `sl_trigger_price` | `no` | `Any` | `""` |
328
+
329
+ Returns: `OpenPositionResult`
330
+
331
+ ---