hyperquant 0.79__py3-none-any.whl → 0.81__py3-none-any.whl
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.
Potentially problematic release.
This version of hyperquant might be problematic. Click here for more details.
hyperquant/broker/auth.py
CHANGED
|
@@ -192,6 +192,7 @@ class Auth:
|
|
|
192
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
193
|
}
|
|
194
194
|
)
|
|
195
|
+
print(headers)
|
|
195
196
|
|
|
196
197
|
# 更新 kwargs.body,保证发出去的与签名一致
|
|
197
198
|
# kwargs.update({"data": raw_body_for_sign})
|
hyperquant/broker/lbank.py
CHANGED
|
@@ -495,6 +495,96 @@ class Lbank:
|
|
|
495
495
|
if not isinstance(data, dict) or data.get("code") != 200:
|
|
496
496
|
raise RuntimeError(f"{operation} failed: {data}")
|
|
497
497
|
return data.get("data") or {}
|
|
498
|
+
|
|
499
|
+
# https://uuapi.rerrkvifj.com/cfd/agg/v1/sendQryAll
|
|
500
|
+
# {
|
|
501
|
+
# "productGroup": "SwapU",
|
|
502
|
+
# "instrumentID": "BTCUSDT",
|
|
503
|
+
# "asset": "USDT"
|
|
504
|
+
# }
|
|
505
|
+
|
|
506
|
+
async def query_all(self, symbol:str):
|
|
507
|
+
"""查询资产信息
|
|
508
|
+
|
|
509
|
+
.. code:: json
|
|
510
|
+
|
|
511
|
+
{
|
|
512
|
+
"fundingRateTimestamp": 28800,
|
|
513
|
+
"isMarketAcount": 0,
|
|
514
|
+
"longMaxVolume": 10000000000000000,
|
|
515
|
+
"role": 2,
|
|
516
|
+
"openingTime": 1609545600000,
|
|
517
|
+
"isCrossMargin": 1,
|
|
518
|
+
"longLeverage": 25,
|
|
519
|
+
"shortLastVolume": 10000000000000000,
|
|
520
|
+
"longLastVolume": 10000000000000000,
|
|
521
|
+
"onTime": 1609459200000,
|
|
522
|
+
"shortMaintenanceMarginRate": "0.0025",
|
|
523
|
+
"state": 3,
|
|
524
|
+
"markedPrice": "111031.3",
|
|
525
|
+
"assetBalance": {
|
|
526
|
+
"reserveAvailable": "0.0",
|
|
527
|
+
"balance": "22.79163408",
|
|
528
|
+
"frozenMargin": "0.0",
|
|
529
|
+
"reserveMode": "0",
|
|
530
|
+
"totalCloseProfit": "-15.982736",
|
|
531
|
+
"available": "22.79163408",
|
|
532
|
+
"crossMargin": "0.0",
|
|
533
|
+
"reserve": "0.0",
|
|
534
|
+
"frozenFee": "0.0",
|
|
535
|
+
"marginAble": "0.0",
|
|
536
|
+
"realAvailable": "22.79163408"
|
|
537
|
+
},
|
|
538
|
+
"longMaxLeverage": 200,
|
|
539
|
+
"shortMaintenanceMarginQuickAmount": "0",
|
|
540
|
+
"shortLastAmount": "10798590",
|
|
541
|
+
"unrealProfitCalType": "2",
|
|
542
|
+
"longLastAmount": "10798590",
|
|
543
|
+
"shortMaxVolume": 10000000000000000,
|
|
544
|
+
"shortLeverage": 25,
|
|
545
|
+
"calMarkedPrice": "111031.3",
|
|
546
|
+
"longMaintenanceMarginRate": "0.0025",
|
|
547
|
+
"wsToken": "fa1d5e0ad94ede6efab6ced66ea5367cfe68c81173863424dc6e8d846d7e723b",
|
|
548
|
+
"shortMaxLeverage": 200,
|
|
549
|
+
"nextFundingRateTimestamp": 1760976000000,
|
|
550
|
+
"longMaintenanceMarginQuickAmount": "0",
|
|
551
|
+
"forbidTrade": false,
|
|
552
|
+
"defaultPositionType": "2",
|
|
553
|
+
"lastPrice": "111027.9",
|
|
554
|
+
"fundingRate": "0.00003598"
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
"""
|
|
558
|
+
|
|
559
|
+
payload = {
|
|
560
|
+
"productGroup": "SwapU",
|
|
561
|
+
"instrumentID": symbol,
|
|
562
|
+
"asset": "USDT"
|
|
563
|
+
}
|
|
564
|
+
res = await self.client.post(
|
|
565
|
+
f"{self.front_api}/cfd/agg/v1/sendQryAll",
|
|
566
|
+
json=payload,
|
|
567
|
+
headers=self._rest_headers,
|
|
568
|
+
)
|
|
569
|
+
data = await res.json()
|
|
570
|
+
print(data)
|
|
571
|
+
return self._ensure_ok("query_all", data)
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
async def set_position_mode(self, mode: Literal["hedge", "oneway"] = "oneway") -> dict[str, Any]:
|
|
575
|
+
"""设置持仓模式到单向持仓或对冲持仓"""
|
|
576
|
+
|
|
577
|
+
mode_code = "2" if mode == "oneway" else "1"
|
|
578
|
+
payload = {
|
|
579
|
+
"PositionType": mode_code,
|
|
580
|
+
}
|
|
581
|
+
res = await self.client.post(
|
|
582
|
+
f"{self.front_api}/cfd/action/v1.0/SendMemberAction",
|
|
583
|
+
json=payload,
|
|
584
|
+
headers=self._rest_headers,
|
|
585
|
+
)
|
|
586
|
+
data = await res.json()
|
|
587
|
+
return self._ensure_ok("set_position_mode", data)
|
|
498
588
|
|
|
499
589
|
@staticmethod
|
|
500
590
|
def _normalize_direction(direction: str) -> str:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hyperquant
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.81
|
|
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
|
|
@@ -4,11 +4,11 @@ hyperquant/db.py,sha256=i2TjkCbmH4Uxo7UTDvOYBfy973gLcGexdzuT_YcSeIE,6678
|
|
|
4
4
|
hyperquant/draw.py,sha256=up_lQ3pHeVLoNOyh9vPjgNwjD0M-6_IetSGviQUgjhY,54624
|
|
5
5
|
hyperquant/logkit.py,sha256=nUo7nx5eONvK39GOhWwS41zNRL756P2J7-5xGzwXnTY,8462
|
|
6
6
|
hyperquant/notikit.py,sha256=x5yAZ_tAvLQRXcRbcg-VabCaN45LUhvlTZnUqkIqfAA,3596
|
|
7
|
-
hyperquant/broker/auth.py,sha256=
|
|
7
|
+
hyperquant/broker/auth.py,sha256=IIWbqgflJzCcd1Se5W6vT6jjPiiLmjYmWGdiNb6JXbM,7696
|
|
8
8
|
hyperquant/broker/bitget.py,sha256=X_S0LKZ7FZAEb6oEMr1vdGP1fondzK74BhmNTpRDSEA,9488
|
|
9
9
|
hyperquant/broker/edgex.py,sha256=TqUO2KRPLN_UaxvtLL6HnA9dAQXC1sGxOfqTHd6W5k8,18378
|
|
10
10
|
hyperquant/broker/hyperliquid.py,sha256=7MxbI9OyIBcImDelPJu-8Nd53WXjxPB5TwE6gsjHbto,23252
|
|
11
|
-
hyperquant/broker/lbank.py,sha256=
|
|
11
|
+
hyperquant/broker/lbank.py,sha256=npacHfV0VYJCBg8BX2lGa-ngMxY-lQE6cB_a0WL2iwA,22201
|
|
12
12
|
hyperquant/broker/ourbit.py,sha256=NUcDSIttf-HGWzoW1uBTrGLPHlkuemMjYCm91MigTno,18228
|
|
13
13
|
hyperquant/broker/ws.py,sha256=9Zu5JSLj-ylYEVmFmRwvZDDnVYKwb37cLHfZzA0AZGc,2200
|
|
14
14
|
hyperquant/broker/lib/edgex_sign.py,sha256=lLUCmY8HHRLfLKyGrlTJYaBlSHPsIMWg3EZnQJKcmyk,95785
|
|
@@ -24,6 +24,6 @@ hyperquant/datavison/_util.py,sha256=92qk4vO856RqycO0YqEIHJlEg-W9XKapDVqAMxe6rbw
|
|
|
24
24
|
hyperquant/datavison/binance.py,sha256=3yNKTqvt_vUQcxzeX4ocMsI5k6Q6gLZrvgXxAEad6Kc,5001
|
|
25
25
|
hyperquant/datavison/coinglass.py,sha256=PEjdjISP9QUKD_xzXNzhJ9WFDTlkBrRQlVL-5pxD5mo,10482
|
|
26
26
|
hyperquant/datavison/okx.py,sha256=yg8WrdQ7wgWHNAInIgsWPM47N3Wkfr253169IPAycAY,6898
|
|
27
|
-
hyperquant-0.
|
|
28
|
-
hyperquant-0.
|
|
29
|
-
hyperquant-0.
|
|
27
|
+
hyperquant-0.81.dist-info/METADATA,sha256=JAd-E7Z2dt0T4CciFdfHuERvoFXMfSWDbIi_9SOlhAk,4317
|
|
28
|
+
hyperquant-0.81.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
29
|
+
hyperquant-0.81.dist-info/RECORD,,
|
|
File without changes
|