hyperquant 0.66__tar.gz → 0.68__tar.gz
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.
- {hyperquant-0.66 → hyperquant-0.68}/PKG-INFO +1 -1
- {hyperquant-0.66 → hyperquant-0.68}/apis.json +3 -0
- hyperquant-0.68/doc/lbank.md +582 -0
- {hyperquant-0.66 → hyperquant-0.68}/pyproject.toml +1 -1
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/broker/auth.py +35 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/broker/edgex.py +35 -23
- hyperquant-0.68/src/hyperquant/broker/lbank.py +353 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/broker/models/edgex.py +18 -0
- hyperquant-0.68/src/hyperquant/broker/models/lbank.py +547 -0
- {hyperquant-0.66 → hyperquant-0.68}/tests/test_edgex.py +18 -7
- hyperquant-0.68/tests/test_lbank.py +254 -0
- hyperquant-0.68/tests/tmp.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/uv.lock +1 -1
- hyperquant-0.66/src/hyperquant/broker/lbank.py +0 -110
- hyperquant-0.66/src/hyperquant/broker/models/lbank.py +0 -205
- hyperquant-0.66/tests/test_lbank.py +0 -101
- hyperquant-0.66/tests/tmp.py +0 -181
- {hyperquant-0.66 → hyperquant-0.68}/.gitignore +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/.python-version +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/README.md +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/data/alpine_smoke.log +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/data/logs/notikit.log +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/data/logs/test_order_sync.log +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/data/records_swap.csv +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/data/records_swapc.csv +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/doc/edgex_act.md +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/doc/edgex_debug.md +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/doc/edgex_order.md +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/doc/edgex_ws.md +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/pub.sh +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/requirements-dev.lock +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/requirements.lock +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/__init__.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/broker/hyperliquid.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/broker/lib/edgex_sign.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/broker/lib/hpstore.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/broker/lib/hyper_types.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/broker/lib/util.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/broker/models/hyperliquid.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/broker/models/ourbit.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/broker/ourbit.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/broker/ws.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/core.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/datavison/_util.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/datavison/binance.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/datavison/coinglass.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/datavison/okx.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/db.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/draw.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/logkit.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/src/hyperquant/notikit.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/tests/test_draw.py +0 -0
- {hyperquant-0.66 → hyperquant-0.68}/tests/test_ourbit.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: hyperquant
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.68
|
4
4
|
Summary: A minimal yet hyper-efficient backtesting framework for quantitative trading
|
5
5
|
Project-URL: Homepage, https://github.com/yourusername/hyperquant
|
6
6
|
Project-URL: Issues, https://github.com/yourusername/hyperquant/issues
|
@@ -0,0 +1,582 @@
|
|
1
|
+
REST 均为 https://uuapi.rerrkvifj.com
|
2
|
+
|
3
|
+
# 下单示例
|
4
|
+
|
5
|
+
## 下单参数示例
|
6
|
+
```json
|
7
|
+
https://uuapi.rerrkvifj.com/cfd/cff/v1/SendOrderInsert
|
8
|
+
|
9
|
+
{
|
10
|
+
"InstrumentID": "SOLUSDT", // 交易品种代码
|
11
|
+
"ExchangeID": "Exchange", // 交易所标识
|
12
|
+
"Direction": "0", // 买卖方向,0表示开多(买入),1表示开空(卖出)
|
13
|
+
"OffsetFlag": "0", // 开平标志,0表示开仓
|
14
|
+
"OrderPriceType": "0", // 报价类型,0表示限价,4表示市价
|
15
|
+
"OrderType": "0", // 订单类型, 配合OrderPriceType
|
16
|
+
"Price": 202.27, // 价格,限价单必填,市价单可不填
|
17
|
+
"Volume": 0.03, // 数量
|
18
|
+
"orderProportion": "0.0000" // 下单比例,通常为"0.0000"
|
19
|
+
}
|
20
|
+
```
|
21
|
+
|
22
|
+
### 参数说明及调整
|
23
|
+
- **Direction**:
|
24
|
+
- `0` 表示开多(买入)
|
25
|
+
- `1` 表示开空(卖出)
|
26
|
+
|
27
|
+
- **OrderPriceType**:
|
28
|
+
- `0` 表示限价单
|
29
|
+
- `4` 表示市价单
|
30
|
+
|
31
|
+
- **OrderType**:
|
32
|
+
- `0` 表示普通限价单(包括FAK限价单,需根据交易所规则设置)
|
33
|
+
- `1` 表示市价单
|
34
|
+
|
35
|
+
- **Price**:
|
36
|
+
- 限价单需要填写具体价格
|
37
|
+
- 市价单可省略或不填写价格字段
|
38
|
+
|
39
|
+
- **OffsetFlag**:
|
40
|
+
- `0` 表示开仓
|
41
|
+
|
42
|
+
根据上述参数的不同组合,可以实现以下订单类型:
|
43
|
+
|
44
|
+
| 订单类型 | Direction | OrderPriceType | OrderType | Price | 说明 |
|
45
|
+
|------------|-----------|----------------|-----------|------------|----------------------|
|
46
|
+
| 限价开多 | 0 | 0 | 0 | 具体价格 | 买入限价单 |
|
47
|
+
| 限价开空 | 1 | 0 | 0 | 具体价格 | 卖出限价单 |
|
48
|
+
| 市价开多 | 0 | 4 | 1 | 不填或忽略 | 买入市价单 |
|
49
|
+
| 市价开空 | 1 | 4 | 1 | 不填或忽略 | 卖出市价单 |
|
50
|
+
| 限价FAK开多| 0 | 0 | 1 | 具体价格 | 限价立即成交否则撤销 |
|
51
|
+
| 限价FAK开空| 1 | 0 | 1 | 具体价格 | 限价立即成交否则撤销 |
|
52
|
+
|
53
|
+
请根据实际需求调整对应字段值完成下单。
|
54
|
+
|
55
|
+
# 撤单示例
|
56
|
+
|
57
|
+
https://uuapi.rerrkvifj.com/cfd/action/v1.0/SendOrderAction
|
58
|
+
{
|
59
|
+
"OrderSysID": "1000623558020554",
|
60
|
+
"ActionFlag": "1"
|
61
|
+
}
|
62
|
+
|
63
|
+
{
|
64
|
+
"code": 200,
|
65
|
+
"data": {
|
66
|
+
"offsetFlag": "0",
|
67
|
+
"orderType": "0",
|
68
|
+
"reserveMode": "0",
|
69
|
+
"fee": "0",
|
70
|
+
"frozenFee": "0",
|
71
|
+
"ddlnTime": "0",
|
72
|
+
"userID": "lbank_exchange_user",
|
73
|
+
"masterAccountID": "",
|
74
|
+
"exchangeID": "Exchange",
|
75
|
+
"accountID": "e1b03fb1-6849-464f-a986-94b9a6e625e6",
|
76
|
+
"orderSysID": "1000623558020554",
|
77
|
+
"volumeRemain": "0",
|
78
|
+
"price": "180",
|
79
|
+
"businessValue": "1758806193849",
|
80
|
+
"frozenMargin": "0",
|
81
|
+
"instrumentID": "SOLUSDT",
|
82
|
+
"posiDirection": "2",
|
83
|
+
"volumeMode": "1",
|
84
|
+
"volume": "0.05",
|
85
|
+
"insertTime": "1758806193",
|
86
|
+
"copyMemberID": "",
|
87
|
+
"position": "0",
|
88
|
+
"leverage": "100",
|
89
|
+
"businessResult": "",
|
90
|
+
"availableUse": "0",
|
91
|
+
"orderStatus": "6",
|
92
|
+
"frozenMoney": "0",
|
93
|
+
"remark": "def",
|
94
|
+
"reserveUse": "0",
|
95
|
+
"sessionNo": "122",
|
96
|
+
"isCrossMargin": "1",
|
97
|
+
"closeProfit": "0",
|
98
|
+
"businessNo": "1001748583265110",
|
99
|
+
"relatedOrderSysID": "",
|
100
|
+
"positionID": "1000623558020554",
|
101
|
+
"mockResp": false,
|
102
|
+
"deriveSource": "0",
|
103
|
+
"copyOrderID": "",
|
104
|
+
"currency": "USDT",
|
105
|
+
"turnover": "0",
|
106
|
+
"frontNo": "-62",
|
107
|
+
"direction": "0",
|
108
|
+
"orderPriceType": "0",
|
109
|
+
"volumeCancled": "0.05",
|
110
|
+
"updateTime": "1758806302",
|
111
|
+
"localID": "04f55ebabde94ab980b6",
|
112
|
+
"volumeTraded": "0",
|
113
|
+
"minVolume": "0",
|
114
|
+
"appid": "WEB",
|
115
|
+
"tradeUnitID": "e1b03fb1-6849-464f-a",
|
116
|
+
"businessType": "P",
|
117
|
+
"memberID": "e1b03fb1-6849-464f-a986-94b9a6e625e6",
|
118
|
+
"timeCondition": "0",
|
119
|
+
"copyProfit": "0"
|
120
|
+
},
|
121
|
+
"message": "成功"
|
122
|
+
}
|
123
|
+
|
124
|
+
# 查询存在订单
|
125
|
+
|
126
|
+
GET
|
127
|
+
|
128
|
+
https://uuapi.rerrkvifj.com/cfd/query/v1.0/Order?ProductGroup=SwapU&ExchangeID=Exchange&pageIndex=1&pageSize=1000
|
129
|
+
|
130
|
+
{
|
131
|
+
"code": 200,
|
132
|
+
"data": {
|
133
|
+
"data": [
|
134
|
+
{
|
135
|
+
"MinVolume": "0.0",
|
136
|
+
"BusinessNo": "1001748588060854",
|
137
|
+
"PositionID": "1000623560990310",
|
138
|
+
"DeriveSource": "0",
|
139
|
+
"BusinessType": "P",
|
140
|
+
"IsCrossMargin": "1",
|
141
|
+
"OrderType": "0",
|
142
|
+
"Currency": "USDT",
|
143
|
+
"Turnover": "0.0",
|
144
|
+
"Leverage": "25.0",
|
145
|
+
"FrozenMargin": "0.312",
|
146
|
+
"AvailableUse": "0.0",
|
147
|
+
"PosiDirection": "2",
|
148
|
+
"InsertTime": "1758806564",
|
149
|
+
"Price": "3900.0",
|
150
|
+
"Volume": "0.002",
|
151
|
+
"VolumeRemain": "0.002",
|
152
|
+
"VolumeMode": "1",
|
153
|
+
"ReserveMode": "0",
|
154
|
+
"TradeUnitID": "e1b03fb1-6849-464f-a",
|
155
|
+
"VolumeTraded": "0.0",
|
156
|
+
"CloseProfit": "0.0",
|
157
|
+
"InstrumentID": "ETHUSDT",
|
158
|
+
"Direction": "0",
|
159
|
+
"OrderPriceType": "0",
|
160
|
+
"OffsetFlag": "0",
|
161
|
+
"OrderStatus": "4",
|
162
|
+
"FrozenMoney": "0.0",
|
163
|
+
"UserID": "lbank_exchange_user",
|
164
|
+
"OrderSysID": "1000623560990310",
|
165
|
+
"seq": 96749124311,
|
166
|
+
"ExchangeID": "Exchange",
|
167
|
+
"AccountID": "e1b03fb1-6849-464f-a986-94b9a6e625e6",
|
168
|
+
"seriesNo": 746725156597,
|
169
|
+
"FrontNo": "-61",
|
170
|
+
"FrozenFee": "0.00468",
|
171
|
+
"Fee": "0.0",
|
172
|
+
"VolumeCancled": "0.0",
|
173
|
+
"MemberID": "e1b03fb1-6849-464f-a986-94b9a6e625e6",
|
174
|
+
"ReserveUse": "0.0",
|
175
|
+
"UpdateTime": "1758806564",
|
176
|
+
"SessionNo": "132",
|
177
|
+
"TimeCondition": "0"
|
178
|
+
}
|
179
|
+
]
|
180
|
+
},
|
181
|
+
"message": "成功"
|
182
|
+
}
|
183
|
+
|
184
|
+
# balance相关
|
185
|
+
|
186
|
+
https://uuapi.rerrkvifj.com/cfd/agg/v1/sendQryAll
|
187
|
+
|
188
|
+
POST
|
189
|
+
{
|
190
|
+
"productGroup": "SwapU",
|
191
|
+
"instrumentID": "ETHUSDT",
|
192
|
+
"asset": "USDT"
|
193
|
+
}
|
194
|
+
|
195
|
+
{
|
196
|
+
"code": 200,
|
197
|
+
"data": {
|
198
|
+
"fundingRateTimestamp": 28800,
|
199
|
+
"isMarketAcount": 0,
|
200
|
+
"longMaxVolume": 10000000000000000,
|
201
|
+
"role": 2,
|
202
|
+
"openingTime": 1609545600000,
|
203
|
+
"isCrossMargin": 1,
|
204
|
+
"longLeverage": 25,
|
205
|
+
"shortLastVolume": 10000000000000000,
|
206
|
+
"longLastVolume": 10000000000000000,
|
207
|
+
"onTime": 1609459200000,
|
208
|
+
"shortMaintenanceMarginRate": "0.0025",
|
209
|
+
"state": 3,
|
210
|
+
"markedPrice": "4001.45",
|
211
|
+
"assetBalance": {
|
212
|
+
"reserveAvailable": "0.0",
|
213
|
+
"balance": "9.902",
|
214
|
+
"frozenMargin": "0.312",
|
215
|
+
"reserveMode": "0",
|
216
|
+
"totalCloseProfit": "1.17458",
|
217
|
+
"available": "9.58532",
|
218
|
+
"crossMargin": "0.0",
|
219
|
+
"reserve": "0.0",
|
220
|
+
"frozenFee": "0.00468",
|
221
|
+
"marginAble": "0.0",
|
222
|
+
"realAvailable": "9.58532"
|
223
|
+
},
|
224
|
+
"longMaxLeverage": 200,
|
225
|
+
"shortMaintenanceMarginQuickAmount": "0",
|
226
|
+
"shortLastAmount": "3190712",
|
227
|
+
"unrealProfitCalType": "2",
|
228
|
+
"longLastAmount": "3190704.2",
|
229
|
+
"shortMaxVolume": 10000000000000000,
|
230
|
+
"shortLeverage": 25,
|
231
|
+
"calMarkedPrice": "4001.45",
|
232
|
+
"longMaintenanceMarginRate": "0.0025",
|
233
|
+
"wsToken": "fbccde456ddf0b5f6ca9e743d5ba7ed69a58c3feacf8dca8dfaf01f6f0ebc5cb",
|
234
|
+
"shortMaxLeverage": 200,
|
235
|
+
"marketPriceSlippage": "0",
|
236
|
+
"nextFundingRateTimestamp": 1758816000000,
|
237
|
+
"longMaintenanceMarginQuickAmount": "0",
|
238
|
+
"forbidTrade": false,
|
239
|
+
"limitPriceSlippage": "0",
|
240
|
+
"defaultPositionType": "2",
|
241
|
+
"lastPrice": "4001.31",
|
242
|
+
"fundingRate": "0.00008413"
|
243
|
+
},
|
244
|
+
"message": "成功"
|
245
|
+
}
|
246
|
+
|
247
|
+
# 查询仓位
|
248
|
+
|
249
|
+
https://uuapi.rerrkvifj.com/cfd/query/v1.0/Position?ProductGroup=SwapU&Valid=1&pageIndex=1&pageSize=1000
|
250
|
+
|
251
|
+
GET
|
252
|
+
|
253
|
+
{
|
254
|
+
"code": 200,
|
255
|
+
"data": {
|
256
|
+
"data": [
|
257
|
+
{
|
258
|
+
"ProductGroup": "SwapU",
|
259
|
+
"BusinessNo": "1001748597347805",
|
260
|
+
"PositionID": "1000623560990310",
|
261
|
+
"BeginTime": "1758807062",
|
262
|
+
"TotalCloseProfit": "0.0",
|
263
|
+
"PreLongFrozen": "0.0",
|
264
|
+
"IsCrossMargin": "1",
|
265
|
+
"Remark": "def",
|
266
|
+
"LongFrozen": "0.0",
|
267
|
+
"Currency": "USDT",
|
268
|
+
"Leverage": "25.0",
|
269
|
+
"FrozenMargin": "0.0",
|
270
|
+
"AvailableUse": "0.0",
|
271
|
+
"LongFrozenMargin": "0.0",
|
272
|
+
"Position": "0.003",
|
273
|
+
"PosiDirection": "2",
|
274
|
+
"InsertTime": "1758806564",
|
275
|
+
"ShortFrozen": "0.0",
|
276
|
+
"ClearCurrency": "USDT",
|
277
|
+
"estimateLiquidationPrice": "696.58",
|
278
|
+
"OpenPrice": "3993.11",
|
279
|
+
"ReserveMode": "0",
|
280
|
+
"maintainMarginQuickCalcAmt": "0",
|
281
|
+
"TradeFee": "0.0",
|
282
|
+
"PriceCurrency": "USDT",
|
283
|
+
"AdlLevel": 0,
|
284
|
+
"TradeUnitID": "e1b03fb1-6849-464f-a",
|
285
|
+
"CloseProfit": "0.0",
|
286
|
+
"PositionFee": "0.0",
|
287
|
+
"maintainMarginRatio": "0.0025",
|
288
|
+
"InstrumentID": "ETHUSDT",
|
289
|
+
"DdlnTime": "0",
|
290
|
+
"UseMargin": "0.4791732",
|
291
|
+
"PreShortFrozen": "0.0",
|
292
|
+
"PrePosition": "0.0",
|
293
|
+
"UserID": "lbank_exchange_user",
|
294
|
+
"SettlementGroup": "SwapU",
|
295
|
+
"TotalPositionCost": "11.97933",
|
296
|
+
"ShortFrozenMargin": "0.0",
|
297
|
+
"liquidationMaintainMarginRatio": "0.003029370513099002",
|
298
|
+
"seq": 96782589847,
|
299
|
+
"ExchangeID": "Exchange",
|
300
|
+
"FORCECLOSEPRICE": "696.58",
|
301
|
+
"AccountID": "e1b03fb1-6849-464f-a986-94b9a6e625e6",
|
302
|
+
"seriesNo": 746734939724,
|
303
|
+
"MemberID": "e1b03fb1-6849-464f-a986-94b9a6e625e6",
|
304
|
+
"ClosePosition": "0.0",
|
305
|
+
"ReserveUse": "0.0",
|
306
|
+
"HighestPosition": "0.003",
|
307
|
+
"UpdateTime": "1758807085",
|
308
|
+
"PositionCost": "11.97933"
|
309
|
+
}
|
310
|
+
]
|
311
|
+
},
|
312
|
+
"message": "成功"
|
313
|
+
}
|
314
|
+
|
315
|
+
# 查询order
|
316
|
+
https://uuapi.rerrkvifj.com/cfd/query/v1.0/Order?ProductGroup=SwapU&ExchangeID=Exchange&pageIndex=1&pageSize=1000
|
317
|
+
GET
|
318
|
+
|
319
|
+
{
|
320
|
+
"code": 200,
|
321
|
+
"data": {
|
322
|
+
"data": [
|
323
|
+
{
|
324
|
+
"MinVolume": "0.0",
|
325
|
+
"BusinessNo": "1001748607944829",
|
326
|
+
"PositionID": "1000623560990310",
|
327
|
+
"DeriveSource": "0",
|
328
|
+
"BusinessType": "P",
|
329
|
+
"IsCrossMargin": "1",
|
330
|
+
"OrderType": "0",
|
331
|
+
"Currency": "USDT",
|
332
|
+
"Turnover": "0.0",
|
333
|
+
"Leverage": "25.0",
|
334
|
+
"FrozenMargin": "0.312",
|
335
|
+
"AvailableUse": "0.0",
|
336
|
+
"PosiDirection": "2",
|
337
|
+
"InsertTime": "1758807645",
|
338
|
+
"Price": "3900.0",
|
339
|
+
"Volume": "0.002",
|
340
|
+
"VolumeRemain": "0.002",
|
341
|
+
"VolumeMode": "1",
|
342
|
+
"ReserveMode": "0",
|
343
|
+
"TradeUnitID": "e1b03fb1-6849-464f-a",
|
344
|
+
"VolumeTraded": "0.0",
|
345
|
+
"CloseProfit": "0.0",
|
346
|
+
"InstrumentID": "ETHUSDT",
|
347
|
+
"Direction": "0",
|
348
|
+
"OrderPriceType": "0",
|
349
|
+
"OffsetFlag": "0",
|
350
|
+
"OrderStatus": "4",
|
351
|
+
"FrozenMoney": "0.0",
|
352
|
+
"UserID": "lbank_exchange_user",
|
353
|
+
"OrderSysID": "1000623569367319",
|
354
|
+
"seq": 96820243534,
|
355
|
+
"ExchangeID": "Exchange",
|
356
|
+
"AccountID": "e1b03fb1-6849-464f-a986-94b9a6e625e6",
|
357
|
+
"seriesNo": 746746071299,
|
358
|
+
"FrontNo": "-61",
|
359
|
+
"FrozenFee": "0.00468",
|
360
|
+
"Fee": "0.0",
|
361
|
+
"VolumeCancled": "0.0",
|
362
|
+
"MemberID": "e1b03fb1-6849-464f-a986-94b9a6e625e6",
|
363
|
+
"ReserveUse": "0.0",
|
364
|
+
"UpdateTime": "1758807645",
|
365
|
+
"SessionNo": "131",
|
366
|
+
"TimeCondition": "0"
|
367
|
+
}
|
368
|
+
]
|
369
|
+
},
|
370
|
+
"message": "成功"
|
371
|
+
}
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
# 查询已经完成order
|
376
|
+
|
377
|
+
https://uuapi.rerrkvifj.com/cfd/cff/v1/FinishOrder?ProductGroup=SwapU&pageIndex=1&pageSize=20&startTime=1756310400000&endTime=1758902399999
|
378
|
+
|
379
|
+
{
|
380
|
+
"code": 200,
|
381
|
+
"data": {
|
382
|
+
"list": {
|
383
|
+
"totalPages": 1,
|
384
|
+
"hasNext": false,
|
385
|
+
"page": {
|
386
|
+
"pageNo": 1,
|
387
|
+
"start": 0,
|
388
|
+
"pageSize": 20
|
389
|
+
},
|
390
|
+
"totalCount": 7,
|
391
|
+
"resultList": [
|
392
|
+
{
|
393
|
+
"ProductGroup": "SwapU",
|
394
|
+
"MinVolume": 0,
|
395
|
+
"BusinessNo": 1001749297328566,
|
396
|
+
"PositionID": "1000623859178785",
|
397
|
+
"Tradable": 1,
|
398
|
+
"DeriveSource": "0",
|
399
|
+
"BusinessType": "P",
|
400
|
+
"IsCrossMargin": 1,
|
401
|
+
"Remark": "def",
|
402
|
+
"OrderType": "0",
|
403
|
+
"Currency": "USDT",
|
404
|
+
"Turnover": 0,
|
405
|
+
"TimeSortNo": 1001173607638696,
|
406
|
+
"Leverage": 25,
|
407
|
+
"FrozenMargin": 0,
|
408
|
+
"AvailableUse": "0",
|
409
|
+
"Priority": 100,
|
410
|
+
"TriggerOrderID": "",
|
411
|
+
"ImplySortNo": 0,
|
412
|
+
"PosiDirection": "2",
|
413
|
+
"InsertTime": 1758848015,
|
414
|
+
"Price": 3800,
|
415
|
+
"Volume": 0.002,
|
416
|
+
"VolumeRemain": 0,
|
417
|
+
"VolumeMode": "1",
|
418
|
+
"ReserveMode": "0",
|
419
|
+
"TradeUnitID": "e1b03fb1-6849-464f-a",
|
420
|
+
"VolumeTraded": 0,
|
421
|
+
"CloseProfit": 0,
|
422
|
+
"LocalID": "e2c6aa732bad45d7b055",
|
423
|
+
"BidPrice1ByInsert": 3914.51,
|
424
|
+
"AskPrice1ByInsert": 3914.52,
|
425
|
+
"InstrumentID": "ETHUSDT",
|
426
|
+
"Direction": "0",
|
427
|
+
"OrderPriceType": "0",
|
428
|
+
"OffsetFlag": "0",
|
429
|
+
"OrderStatus": "6",
|
430
|
+
"BusinessValue": "1758848015793",
|
431
|
+
"FrozenMoney": 0,
|
432
|
+
"UserID": "lbank_exchange_user",
|
433
|
+
"SettlementGroup": "SwapU",
|
434
|
+
"CloseOrderID": "",
|
435
|
+
"OrderSysID": "1000623859178785",
|
436
|
+
"ExchangeID": "Exchange",
|
437
|
+
"BusinessResult": "",
|
438
|
+
"AccountID": "e1b03fb1-6849-464f-a986-94b9a6e625e6",
|
439
|
+
"APPID": "WEB",
|
440
|
+
"FrontNo": -68,
|
441
|
+
"FrozenFee": 0,
|
442
|
+
"Fee": 0,
|
443
|
+
"ProductID": "",
|
444
|
+
"VolumeCancled": 0.002,
|
445
|
+
"MemberID": "e1b03fb1-6849-464f-a986-94b9a6e625e6",
|
446
|
+
"ReserveUse": "0",
|
447
|
+
"UpdateTime": 1758848689,
|
448
|
+
"LastPriceByInsert": 3914.51,
|
449
|
+
"SessionNo": 31,
|
450
|
+
"MasterAccountID": "",
|
451
|
+
"TimeCondition": "0",
|
452
|
+
"RelatedOrderSysID": ""
|
453
|
+
},
|
454
|
+
{
|
455
|
+
"ProductGroup": "SwapU",
|
456
|
+
"MinVolume": 0,
|
457
|
+
"BusinessNo": 1001748597347805,
|
458
|
+
"PositionID": "1000623560990310",
|
459
|
+
"Tradable": 1,
|
460
|
+
"DeriveSource": "0",
|
461
|
+
"BusinessType": "P",
|
462
|
+
"IsCrossMargin": 1,
|
463
|
+
"Remark": "def",
|
464
|
+
"OrderType": "0",
|
465
|
+
"Currency": "USDT",
|
466
|
+
"Turnover": 0,
|
467
|
+
"TimeSortNo": 1001173309756605,
|
468
|
+
"Leverage": 25,
|
469
|
+
"FrozenMargin": 0,
|
470
|
+
"AvailableUse": "0",
|
471
|
+
"Priority": 100,
|
472
|
+
"TriggerOrderID": "",
|
473
|
+
"ImplySortNo": 0,
|
474
|
+
"PosiDirection": "2",
|
475
|
+
"InsertTime": 1758806564,
|
476
|
+
"Price": 3900,
|
477
|
+
"Volume": 0.002,
|
478
|
+
"VolumeRemain": 0,
|
479
|
+
"VolumeMode": "1",
|
480
|
+
"ReserveMode": "0",
|
481
|
+
"TradeUnitID": "e1b03fb1-6849-464f-a",
|
482
|
+
"VolumeTraded": 0,
|
483
|
+
"CloseProfit": 0,
|
484
|
+
"LocalID": "173076ab813244049a79",
|
485
|
+
"BidPrice1ByInsert": 4001.27,
|
486
|
+
"AskPrice1ByInsert": 4001.28,
|
487
|
+
"InstrumentID": "ETHUSDT",
|
488
|
+
"Direction": "0",
|
489
|
+
"OrderPriceType": "0",
|
490
|
+
"OffsetFlag": "0",
|
491
|
+
"OrderStatus": "6",
|
492
|
+
"BusinessValue": "1758806564970",
|
493
|
+
"FrozenMoney": 0,
|
494
|
+
"UserID": "lbank_exchange_user",
|
495
|
+
"SettlementGroup": "SwapU",
|
496
|
+
"CloseOrderID": "",
|
497
|
+
"OrderSysID": "1000623560990310",
|
498
|
+
"ExchangeID": "Exchange",
|
499
|
+
"BusinessResult": "",
|
500
|
+
"AccountID": "e1b03fb1-6849-464f-a986-94b9a6e625e6",
|
501
|
+
"APPID": "WEB",
|
502
|
+
"FrontNo": -61,
|
503
|
+
"FrozenFee": 0,
|
504
|
+
"Fee": 0,
|
505
|
+
"ProductID": "",
|
506
|
+
"VolumeCancled": 0.002,
|
507
|
+
"MemberID": "e1b03fb1-6849-464f-a986-94b9a6e625e6",
|
508
|
+
"ReserveUse": "0",
|
509
|
+
"UpdateTime": 1758807085,
|
510
|
+
"LastPriceByInsert": 4001.28,
|
511
|
+
"SessionNo": 132,
|
512
|
+
"MasterAccountID": "",
|
513
|
+
"TimeCondition": "0",
|
514
|
+
"RelatedOrderSysID": ""
|
515
|
+
},
|
516
|
+
{
|
517
|
+
"ProductGroup": "SwapU",
|
518
|
+
"MinVolume": 0,
|
519
|
+
"BusinessNo": 1001748583265110,
|
520
|
+
"PositionID": "1000623558020554",
|
521
|
+
"Tradable": 1,
|
522
|
+
"DeriveSource": "0",
|
523
|
+
"BusinessType": "P",
|
524
|
+
"IsCrossMargin": 1,
|
525
|
+
"Remark": "def",
|
526
|
+
"OrderType": "0",
|
527
|
+
"Currency": "USDT",
|
528
|
+
"Turnover": 0,
|
529
|
+
"TimeSortNo": 1001173306789092,
|
530
|
+
"Leverage": 100,
|
531
|
+
"FrozenMargin": 0,
|
532
|
+
"AvailableUse": "0",
|
533
|
+
"Priority": 100,
|
534
|
+
"TriggerOrderID": "",
|
535
|
+
"ImplySortNo": 0,
|
536
|
+
"PosiDirection": "2",
|
537
|
+
"InsertTime": 1758806193,
|
538
|
+
"Price": 180,
|
539
|
+
"Volume": 0.05,
|
540
|
+
"VolumeRemain": 0,
|
541
|
+
"VolumeMode": "1",
|
542
|
+
"ReserveMode": "0",
|
543
|
+
"TradeUnitID": "e1b03fb1-6849-464f-a",
|
544
|
+
"VolumeTraded": 0,
|
545
|
+
"CloseProfit": 0,
|
546
|
+
"LocalID": "04f55ebabde94ab980b6",
|
547
|
+
"BidPrice1ByInsert": 199.34,
|
548
|
+
"AskPrice1ByInsert": 199.35,
|
549
|
+
"InstrumentID": "SOLUSDT",
|
550
|
+
"Direction": "0",
|
551
|
+
"OrderPriceType": "0",
|
552
|
+
"OffsetFlag": "0",
|
553
|
+
"OrderStatus": "6",
|
554
|
+
"BusinessValue": "1758806193849",
|
555
|
+
"FrozenMoney": 0,
|
556
|
+
"UserID": "lbank_exchange_user",
|
557
|
+
"SettlementGroup": "SwapU",
|
558
|
+
"CloseOrderID": "",
|
559
|
+
"OrderSysID": "1000623558020554",
|
560
|
+
"ExchangeID": "Exchange",
|
561
|
+
"BusinessResult": "",
|
562
|
+
"AccountID": "e1b03fb1-6849-464f-a986-94b9a6e625e6",
|
563
|
+
"APPID": "WEB",
|
564
|
+
"FrontNo": -62,
|
565
|
+
"FrozenFee": 0,
|
566
|
+
"Fee": 0,
|
567
|
+
"ProductID": "",
|
568
|
+
"VolumeCancled": 0.05,
|
569
|
+
"MemberID": "e1b03fb1-6849-464f-a986-94b9a6e625e6",
|
570
|
+
"ReserveUse": "0",
|
571
|
+
"UpdateTime": 1758806302,
|
572
|
+
"LastPriceByInsert": 199.46,
|
573
|
+
"SessionNo": 122,
|
574
|
+
"MasterAccountID": "",
|
575
|
+
"TimeCondition": "0",
|
576
|
+
"RelatedOrderSysID": ""
|
577
|
+
}
|
578
|
+
]
|
579
|
+
}
|
580
|
+
},
|
581
|
+
"message": "成功"
|
582
|
+
}
|
@@ -170,6 +170,33 @@ class Auth:
|
|
170
170
|
headers.update({"cookie": cookie})
|
171
171
|
return args
|
172
172
|
|
173
|
+
@staticmethod
|
174
|
+
def lbank(args: tuple[str, URL], kwargs: dict[str, Any]) -> tuple[str, URL]:
|
175
|
+
method: str = args[0]
|
176
|
+
url: URL = args[1]
|
177
|
+
data = kwargs.get("data") or {}
|
178
|
+
headers: CIMultiDict = kwargs["headers"]
|
179
|
+
|
180
|
+
# 从 session 里取 api_key & secret
|
181
|
+
session = kwargs["session"]
|
182
|
+
token = session.__dict__["_apis"][pybotters.auth.Hosts.items[url.host].name][0]
|
183
|
+
|
184
|
+
|
185
|
+
# 设置 headers
|
186
|
+
headers.update(
|
187
|
+
{
|
188
|
+
"ex-language": 'zh-TW',
|
189
|
+
"ex-token": token,
|
190
|
+
"source": "4",
|
191
|
+
"versionflage": "true",
|
192
|
+
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
|
193
|
+
}
|
194
|
+
)
|
195
|
+
|
196
|
+
# 更新 kwargs.body,保证发出去的与签名一致
|
197
|
+
# kwargs.update({"data": raw_body_for_sign})
|
198
|
+
|
199
|
+
return args
|
173
200
|
|
174
201
|
pybotters.auth.Hosts.items["futures.ourbit.com"] = pybotters.auth.Item(
|
175
202
|
"ourbit", Auth.ourbit
|
@@ -178,6 +205,10 @@ pybotters.auth.Hosts.items["www.ourbit.com"] = pybotters.auth.Item(
|
|
178
205
|
"ourbit", Auth.ourbit_spot
|
179
206
|
)
|
180
207
|
|
208
|
+
pybotters.auth.Hosts.items["www.ourbit.com"] = pybotters.auth.Item(
|
209
|
+
"ourbit", Auth.ourbit_spot
|
210
|
+
)
|
211
|
+
|
181
212
|
pybotters.auth.Hosts.items["pro.edgex.exchange"] = pybotters.auth.Item(
|
182
213
|
"edgex", Auth.edgex
|
183
214
|
)
|
@@ -185,4 +216,8 @@ pybotters.auth.Hosts.items["pro.edgex.exchange"] = pybotters.auth.Item(
|
|
185
216
|
|
186
217
|
pybotters.auth.Hosts.items["quote.edgex.exchange"] = pybotters.auth.Item(
|
187
218
|
"edgex", Auth.edgex
|
219
|
+
)
|
220
|
+
|
221
|
+
pybotters.auth.Hosts.items["uuapi.rerrkvifj.com"] = pybotters.auth.Item(
|
222
|
+
"lbank", Auth.lbank
|
188
223
|
)
|