@yuants/vendor-okx 0.23.25 → 0.23.26

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 (80) hide show
  1. package/dist/account.js +13 -136
  2. package/dist/account.js.map +1 -1
  3. package/dist/accountInfos/earning.js +15 -0
  4. package/dist/accountInfos/earning.js.map +1 -0
  5. package/dist/accountInfos/funding.js +46 -0
  6. package/dist/accountInfos/funding.js.map +1 -0
  7. package/dist/accountInfos/index.js +7 -0
  8. package/dist/accountInfos/index.js.map +1 -0
  9. package/dist/accountInfos/loan.js +46 -0
  10. package/dist/accountInfos/loan.js.map +1 -0
  11. package/dist/accountInfos/strategy.js +56 -0
  12. package/dist/accountInfos/strategy.js.map +1 -0
  13. package/dist/accountInfos/trading.js +84 -0
  14. package/dist/accountInfos/trading.js.map +1 -0
  15. package/dist/accountInfos/types.js +2 -0
  16. package/dist/accountInfos/types.js.map +1 -0
  17. package/dist/loan-account.js +3 -45
  18. package/dist/loan-account.js.map +1 -1
  19. package/dist/order-actions.js +10 -182
  20. package/dist/order-actions.js.map +1 -1
  21. package/dist/orders/cancelOrder.js +13 -0
  22. package/dist/orders/cancelOrder.js.map +1 -0
  23. package/dist/orders/modifyOrder.js +58 -0
  24. package/dist/orders/modifyOrder.js.map +1 -0
  25. package/dist/orders/submitOrder.js +107 -0
  26. package/dist/orders/submitOrder.js.map +1 -0
  27. package/dist/strategy-account.js +5 -59
  28. package/dist/strategy-account.js.map +1 -1
  29. package/lib/account.d.ts +2 -0
  30. package/lib/account.d.ts.map +1 -1
  31. package/lib/account.js +12 -136
  32. package/lib/account.js.map +1 -1
  33. package/lib/accountInfos/earning.d.ts +4 -0
  34. package/lib/accountInfos/earning.d.ts.map +1 -0
  35. package/lib/accountInfos/earning.js +19 -0
  36. package/lib/accountInfos/earning.js.map +1 -0
  37. package/lib/accountInfos/funding.d.ts +4 -0
  38. package/lib/accountInfos/funding.d.ts.map +1 -0
  39. package/lib/accountInfos/funding.js +50 -0
  40. package/lib/accountInfos/funding.js.map +1 -0
  41. package/lib/accountInfos/index.d.ts +8 -0
  42. package/lib/accountInfos/index.d.ts.map +1 -0
  43. package/lib/accountInfos/index.js +16 -0
  44. package/lib/accountInfos/index.js.map +1 -0
  45. package/lib/accountInfos/loan.d.ts +4 -0
  46. package/lib/accountInfos/loan.d.ts.map +1 -0
  47. package/lib/accountInfos/loan.js +50 -0
  48. package/lib/accountInfos/loan.js.map +1 -0
  49. package/lib/accountInfos/strategy.d.ts +4 -0
  50. package/lib/accountInfos/strategy.d.ts.map +1 -0
  51. package/lib/accountInfos/strategy.js +60 -0
  52. package/lib/accountInfos/strategy.js.map +1 -0
  53. package/lib/accountInfos/trading.d.ts +5 -0
  54. package/lib/accountInfos/trading.d.ts.map +1 -0
  55. package/lib/accountInfos/trading.js +88 -0
  56. package/lib/accountInfos/trading.js.map +1 -0
  57. package/lib/accountInfos/types.d.ts +6 -0
  58. package/lib/accountInfos/types.d.ts.map +1 -0
  59. package/lib/accountInfos/types.js +3 -0
  60. package/lib/accountInfos/types.js.map +1 -0
  61. package/lib/loan-account.js +2 -44
  62. package/lib/loan-account.js.map +1 -1
  63. package/lib/order-actions.js +8 -180
  64. package/lib/order-actions.js.map +1 -1
  65. package/lib/orders/cancelOrder.d.ts +4 -0
  66. package/lib/orders/cancelOrder.d.ts.map +1 -0
  67. package/lib/orders/cancelOrder.js +17 -0
  68. package/lib/orders/cancelOrder.js.map +1 -0
  69. package/lib/orders/modifyOrder.d.ts +4 -0
  70. package/lib/orders/modifyOrder.d.ts.map +1 -0
  71. package/lib/orders/modifyOrder.js +62 -0
  72. package/lib/orders/modifyOrder.js.map +1 -0
  73. package/lib/orders/submitOrder.d.ts +4 -0
  74. package/lib/orders/submitOrder.d.ts.map +1 -0
  75. package/lib/orders/submitOrder.js +111 -0
  76. package/lib/orders/submitOrder.js.map +1 -0
  77. package/lib/strategy-account.js +4 -58
  78. package/lib/strategy-account.js.map +1 -1
  79. package/package.json +13 -13
  80. package/temp/package-deps.json +29 -19
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submitOrder.js","sourceRoot":"","sources":["../../src/orders/submitOrder.ts"],"names":[],"mappings":";;;AACA,yCAAoE;AACpE,+BAA2C;AAC3C,gCAAqD;AACrD,wCAA4C;AAC5C,oCAA8C;AAE9C,MAAM,uBAAuB,GAAG,CAAC,SAAkB,EAAE,EAAE;IACrD,QAAQ,SAAS,EAAE;QACjB,KAAK,WAAW,CAAC;QACjB,KAAK,aAAa;YAChB,OAAO,KAAK,CAAC;QACf,KAAK,YAAY,CAAC;QAClB,KAAK,YAAY;YACf,OAAO,MAAM,CAAC;KACjB;IACD,MAAM,IAAI,KAAK,CAAC,sBAAsB,SAAS,EAAE,CAAC,CAAC;AACrD,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG,CAAC,SAAkB,EAAE,EAAE;IACxD,QAAQ,SAAS,EAAE;QACjB,KAAK,WAAW,CAAC;QACjB,KAAK,YAAY;YACf,OAAO,MAAM,CAAC;QAChB,KAAK,aAAa,CAAC;QACnB,KAAK,YAAY;YACf,OAAO,OAAO,CAAC;KAClB;IACD,MAAM,IAAI,KAAK,CAAC,sBAAsB,SAAS,EAAE,CAAC,CAAC;AACrD,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,CAAC,UAAmB,EAAE,EAAE;IACpD,QAAQ,UAAU,EAAE;QAClB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,OAAO;YACV,OAAO,WAAW,CAAC;KACtB;IACD,MAAM,IAAI,KAAK,CAAC,uBAAuB,UAAU,EAAE,CAAC,CAAC;AACvD,CAAC,CAAC;AAEK,MAAM,WAAW,GAAG,KAAK,EAAE,UAAuB,EAAE,KAAa,EAAmB,EAAE;;IAC3F,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,IAAA,kBAAU,EAAC,KAAK,CAAC,UAAU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AC,QAAQ,CAAC,MAAA,KAAK,CAAC,eAAe,mCAAI,EAAE,CAAC;YAC1F,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,SAAS;QACf,EAAE,EAAE,KAAK,CAAC,UAAU,KAAK,OAAO,IAAI,KAAK,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,KAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS;QACtG,GAAG,EAAE,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;KAChD,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,IAAA,kBAAU,EAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IACtF,MAAM,GAAG,GAAG,MAAM,IAAA,oBAAc,EAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACrD,IAAI,GAAG,CAAC,IAAI,KAAK,GAAG,KAAI,MAAA,MAAA,GAAG,CAAC,IAAI,0CAAG,CAAC,CAAC,0CAAE,KAAK,CAAA,EAAE;QAC5C,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;KAC1B;IACD,MAAM,2BAA2B,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC;AACzD,CAAC,CAAC;AAjFW,QAAA,WAAW,eAiFtB","sourcesContent":["import { IOrder } from '@yuants/data-order';\nimport { decodePath, formatTime, roundToStep } from '@yuants/utils';\nimport { firstValueFrom, map } from 'rxjs';\nimport { ICredential, postTradeOrder } from '../api';\nimport { productService } from '../product';\nimport { spotMarketTickers$ } from '../quote';\n\nconst mapOrderDirectionToSide = (direction?: string) => {\n switch (direction) {\n case 'OPEN_LONG':\n case 'CLOSE_SHORT':\n return 'buy';\n case 'OPEN_SHORT':\n case 'CLOSE_LONG':\n return 'sell';\n }\n throw new Error(`Unknown direction: ${direction}`);\n};\n\nconst mapOrderDirectionToPosSide = (direction?: string) => {\n switch (direction) {\n case 'OPEN_LONG':\n case 'CLOSE_LONG':\n return 'long';\n case 'CLOSE_SHORT':\n case 'OPEN_SHORT':\n return 'short';\n }\n throw new Error(`Unknown direction: ${direction}`);\n};\n\nconst mapOrderTypeToOrdType = (order_type?: string) => {\n switch (order_type) {\n case 'LIMIT':\n return 'limit';\n case 'MARKET':\n return 'market';\n case 'MAKER':\n return 'post_only';\n }\n throw new Error(`Unknown order type: ${order_type}`);\n};\n\nexport const submitOrder = async (credential: ICredential, order: IOrder): Promise<string> => {\n const [instType, instId] = decodePath(order.product_id);\n\n // 交易数量,表示要购买或者出售的数量。\n // 当币币/币币杠杆以限价买入和卖出时,指交易货币数量。\n // 当币币杠杆以市价买入时,指计价货币的数量。\n // 当币币杠杆以市价卖出时,指交易货币的数量。\n // 对于币币市价单,单位由 tgtCcy 决定\n // 当交割、永续、期权买入和卖出时,指合约张数。\n const mapOrderVolumeToSz = async (order: IOrder) => {\n if (instType === 'SWAP') {\n return order.volume;\n }\n if (instType === 'MARGIN') {\n if (order.order_type === 'LIMIT') {\n return order.volume;\n }\n if (order.order_type === 'MAKER') {\n return order.volume;\n }\n if (order.order_type === 'MARKET') {\n if (order.order_direction === 'OPEN_SHORT' || order.order_direction === 'CLOSE_LONG') {\n return order.volume;\n }\n //\n const price = await firstValueFrom(\n spotMarketTickers$.pipe(\n map((x) =>\n mapOrderDirectionToPosSide(order.order_direction) === 'long'\n ? +x[instId].askPx\n : +x[instId].bidPx,\n ),\n ),\n );\n if (!price) {\n throw new Error(`invalid tick: ${price}`);\n }\n console.info(formatTime(Date.now()), 'SubmitOrder', 'price', price);\n const theProduct = await firstValueFrom(\n productService.mapProductIdToProduct$.pipe(map((x) => x.get(order.product_id))),\n );\n if (!theProduct) {\n throw new Error(`Unknown product: ${order.position_id}`);\n }\n return roundToStep(order.volume * price, theProduct.volume_step!);\n }\n\n return 0;\n }\n\n if (instType === 'SPOT') {\n return order.volume;\n }\n\n throw new Error(`Unknown instType: ${instType}`);\n };\n\n const params = {\n instId,\n tdMode: instType === 'SPOT' ? 'cash' : 'cross',\n side: mapOrderDirectionToSide(order.order_direction),\n posSide:\n instType === 'MARGIN' || instType === 'SPOT'\n ? 'net'\n : mapOrderDirectionToPosSide(order.order_direction),\n ordType: mapOrderTypeToOrdType(order.order_type),\n sz: (await mapOrderVolumeToSz(order)).toString(),\n tgtCcy: instType === 'SPOT' && order.order_type === 'MARKET' ? 'base_ccy' : undefined,\n reduceOnly:\n instType === 'MARGIN' && ['CLOSE_LONG', 'CLOSE_SHORT'].includes(order.order_direction ?? '')\n ? 'true'\n : undefined,\n px: order.order_type === 'LIMIT' || order.order_type === 'MAKER' ? order.price!.toString() : undefined,\n ccy: instType === 'MARGIN' ? 'USDT' : undefined,\n };\n console.info(formatTime(Date.now()), 'SubmitOrder', 'params', JSON.stringify(params));\n const res = await postTradeOrder(credential, params);\n if (res.code === '0' && res.data?.[0]?.ordId) {\n return res.data[0].ordId;\n }\n throw `Failed to submit order: ${res.code} ${res.msg}`;\n};\n"]}
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.strategyAccountId$ = exports.accountUid$ = exports.accountConfig$ = void 0;
4
4
  const data_account_1 = require("@yuants/data-account");
5
5
  const protocol_1 = require("@yuants/protocol");
6
- const utils_1 = require("@yuants/utils");
7
6
  const rxjs_1 = require("rxjs");
8
7
  const api_1 = require("./api");
8
+ const accountInfos_1 = require("./accountInfos");
9
9
  const terminal = protocol_1.Terminal.fromNodeEnv();
10
10
  const credential = (0, api_1.getDefaultCredential)();
11
11
  exports.accountConfig$ = (0, rxjs_1.defer)(() => (0, api_1.getAccountConfig)(credential)).pipe((0, rxjs_1.repeat)({ delay: 10000 }), (0, rxjs_1.retry)({ delay: 10000 }), (0, rxjs_1.shareReplay)(1));
@@ -32,63 +32,9 @@ exports.strategyAccountId$ = exports.accountUid$.pipe((0, rxjs_1.map)((uid) => `
32
32
  egress_token_capacity: 20,
33
33
  egress_token_refill_interval: 4000, // 每 4 秒恢复 20 个令牌 (双倍冗余限流)
34
34
  });
35
- (0, data_account_1.provideAccountInfoService)(terminal, strategyAccountId, async () => {
36
- // TODO: 需要分页获取所有的网格订单 (每页 100 条)
37
- const [gridAlgoOrders] = await Promise.all([
38
- (0, api_1.getGridOrdersAlgoPending)(credential, {
39
- algoOrdType: 'contract_grid',
40
- }),
41
- ]);
42
- let totalEquity = 0;
43
- const positions = [];
44
- const gridPositionsRes = await Promise.all(gridAlgoOrders.data.map((item) => terminal.client.requestForResponseData('OKX/QueryGridPositions', {
45
- account_id: strategyAccountId,
46
- algoId: item.algoId,
47
- })));
48
- gridPositionsRes.forEach((gridPositions, index) => {
49
- var _a, _b, _c, _d;
50
- let positionValuation = 0;
51
- const leverage = +((_a = gridAlgoOrders.data) === null || _a === void 0 ? void 0 : _a[index].actualLever);
52
- (_b = gridPositions === null || gridPositions === void 0 ? void 0 : gridPositions.data) === null || _b === void 0 ? void 0 : _b.forEach((position) => {
53
- var _a, _b, _c;
54
- if (+position.pos !== 0) {
55
- const directionRaw = (_c = (_b = (_a = gridAlgoOrders.data) === null || _a === void 0 ? void 0 : _a[index]) === null || _b === void 0 ? void 0 : _b.direction) !== null && _c !== void 0 ? _c : '';
56
- const direction = directionRaw ? directionRaw.toUpperCase() : 'LONG';
57
- positions.push({
58
- position_id: (0, utils_1.encodePath)(position.algoId, position.instId),
59
- datasource_id: 'OKX',
60
- product_id: (0, utils_1.encodePath)(position.instType, position.instId),
61
- direction,
62
- volume: Math.abs(+position.pos),
63
- free_volume: +position.pos,
64
- position_price: +position.avgPx,
65
- floating_profit: +position.upl,
66
- closable_price: +position.last,
67
- valuation: +position.notionalUsd,
68
- });
69
- positionValuation += +position.notionalUsd;
70
- }
71
- });
72
- if (leverage === 0) {
73
- // 实际杠杆为 0,说明没有持仓,直接把投资金额和累计盈亏算到净值里
74
- totalEquity += +((_c = gridAlgoOrders.data) === null || _c === void 0 ? void 0 : _c[index].investment) + +((_d = gridAlgoOrders.data) === null || _d === void 0 ? void 0 : _d[index].totalPnl);
75
- }
76
- else {
77
- // 历史提取金额不会从 investment, totalPnl 扣减
78
- // 计算净值需要通过仓位的名义价值和实际杠杆计算
79
- totalEquity += positionValuation / leverage;
80
- }
81
- });
82
- return {
83
- money: {
84
- currency: 'USDT',
85
- equity: totalEquity,
86
- // TODO: 累计策略的可提取资金作为 free
87
- free: 0,
88
- },
89
- positions,
90
- };
91
- }, { auto_refresh_interval: 5000 });
35
+ (0, data_account_1.provideAccountInfoService)(terminal, strategyAccountId, () => (0, accountInfos_1.getStrategyAccountInfo)(credential), {
36
+ auto_refresh_interval: 5000,
37
+ });
92
38
  }).subscribe();
93
39
  const sub = (0, rxjs_1.defer)(() => exports.accountUid$)
94
40
  .pipe((0, rxjs_1.first)())
@@ -1 +1 @@
1
- {"version":3,"file":"strategy-account.js","sourceRoot":"","sources":["../src/strategy-account.ts"],"names":[],"mappings":";;;AAAA,uDAA8F;AAC9F,+CAA4C;AAC5C,yCAA2C;AAC3C,+BAA6F;AAC7F,+BAA2G;AAE3G,MAAM,QAAQ,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC;AACxC,MAAM,UAAU,GAAG,IAAA,0BAAoB,GAAE,CAAC;AAE7B,QAAA,cAAc,GAAG,IAAA,YAAK,EAAC,GAAG,EAAE,CAAC,IAAA,sBAAgB,EAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAC1E,IAAA,aAAM,EAAC,EAAE,KAAK,EAAE,KAAM,EAAE,CAAC,EACzB,IAAA,YAAK,EAAC,EAAE,KAAK,EAAE,KAAM,EAAE,CAAC,EACxB,IAAA,kBAAW,EAAC,CAAC,CAAC,CACf,CAAC;AAEW,QAAA,WAAW,GAAG,sBAAc,CAAC,IAAI,CAC5C,IAAA,UAAG,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC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AE,EAAE,UAAU,EAAE,OAAO,GAAG,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;AACtF,CAAC,CAAC,CAAC;AACL,IAAA,YAAK,EAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC","sourcesContent":["import { addAccountMarket, IPosition, provideAccountInfoService } from '@yuants/data-account';\nimport { Terminal } from '@yuants/protocol';\nimport { encodePath } from '@yuants/utils';\nimport { defer, filter, first, firstValueFrom, map, repeat, retry, shareReplay } from 'rxjs';\nimport { getAccountConfig, getDefaultCredential, getGridOrdersAlgoPending, getGridPositions } from './api';\n\nconst terminal = Terminal.fromNodeEnv();\nconst credential = getDefaultCredential();\n\nexport const accountConfig$ = defer(() => getAccountConfig(credential)).pipe(\n repeat({ delay: 10_000 }),\n retry({ delay: 10_000 }),\n shareReplay(1),\n);\n\nexport const accountUid$ = accountConfig$.pipe(\n map((x) => x.data[0].uid),\n filter((x) => !!x),\n shareReplay(1),\n);\n\nexport const strategyAccountId$ = accountUid$.pipe(\n map((uid) => `okx/${uid}/strategy`),\n shareReplay(1),\n);\n\ndefer(async () => {\n const strategyAccountId = await firstValueFrom(strategyAccountId$);\n\n type InferPromise<T> = T extends Promise<infer U> ? U : T;\n\n terminal.server.provideService<\n { account_id: string; algoId: string },\n InferPromise<ReturnType<typeof getGridPositions>>\n >(\n `OKX/QueryGridPositions`,\n {\n required: ['account_id', 'algoId'],\n properties: {\n account_id: { type: 'string', const: strategyAccountId },\n algoId: { type: 'string' },\n },\n },\n async (msg) => {\n //\n return {\n res: {\n code: 0,\n message: 'OK',\n data: await getGridPositions(credential, { algoOrdType: 'contract_grid', algoId: msg.req.algoId }),\n },\n };\n },\n {\n egress_token_capacity: 20,\n egress_token_refill_interval: 4000, // 每 4 秒恢复 20 个令牌 (双倍冗余限流)\n },\n );\n\n provideAccountInfoService(\n terminal,\n strategyAccountId,\n async () => {\n // TODO: 需要分页获取所有的网格订单 (每页 100 条)\n const [gridAlgoOrders] = await Promise.all([\n getGridOrdersAlgoPending(credential, {\n algoOrdType: 'contract_grid',\n }),\n ]);\n\n let totalEquity = 0;\n const positions: IPosition[] = [];\n\n const gridPositionsRes = await Promise.all(\n gridAlgoOrders.data.map((item) =>\n terminal.client.requestForResponseData<\n { account_id: string; algoId: string },\n InferPromise<ReturnType<typeof getGridPositions>>\n >('OKX/QueryGridPositions', {\n account_id: strategyAccountId,\n algoId: item.algoId,\n }),\n ),\n );\n\n gridPositionsRes.forEach((gridPositions, index) => {\n let positionValuation = 0;\n const leverage = +gridAlgoOrders.data?.[index].actualLever;\n gridPositions?.data?.forEach((position) => {\n if (+position.pos !== 0) {\n const directionRaw = gridAlgoOrders.data?.[index]?.direction ?? '';\n const direction = directionRaw ? directionRaw.toUpperCase() : 'LONG';\n positions.push({\n position_id: encodePath(position.algoId, position.instId),\n datasource_id: 'OKX',\n product_id: encodePath(position.instType, position.instId),\n direction,\n volume: Math.abs(+position.pos),\n free_volume: +position.pos,\n position_price: +position.avgPx,\n floating_profit: +position.upl,\n closable_price: +position.last,\n valuation: +position.notionalUsd,\n });\n positionValuation += +position.notionalUsd;\n }\n });\n if (leverage === 0) {\n // 实际杠杆为 0,说明没有持仓,直接把投资金额和累计盈亏算到净值里\n totalEquity += +gridAlgoOrders.data?.[index].investment + +gridAlgoOrders.data?.[index].totalPnl;\n } else {\n // 历史提取金额不会从 investment, totalPnl 扣减\n // 计算净值需要通过仓位的名义价值和实际杠杆计算\n totalEquity += positionValuation / leverage;\n }\n });\n\n return {\n money: {\n currency: 'USDT',\n equity: totalEquity,\n // TODO: 累计策略的可提取资金作为 free\n free: 0,\n },\n positions,\n };\n },\n { auto_refresh_interval: 5000 },\n );\n}).subscribe();\n\nconst sub = defer(() => accountUid$)\n .pipe(first())\n .subscribe((uid) => {\n addAccountMarket(terminal, { account_id: `okx/${uid}/strategy`, market_id: 'OKX' });\n });\ndefer(() => terminal.dispose$).subscribe(() => sub.unsubscribe());\n"]}
1
+ {"version":3,"file":"strategy-account.js","sourceRoot":"","sources":["../src/strategy-account.ts"],"names":[],"mappings":";;;AAAA,uDAAmF;AACnF,+CAA4C;AAC5C,+BAA6F;AAC7F,+BAAiF;AACjF,iDAAwD;AAExD,MAAM,QAAQ,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC;AACxC,MAAM,UAAU,GAAG,IAAA,0BAAoB,GAAE,CAAC;AAE7B,QAAA,cAAc,GAAG,IAAA,YAAK,EAAC,GAAG,EAAE,CAAC,IAAA,sBAAgB,EAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAC1E,IAAA,aAAM,EAAC,EAAE,KAAK,EAAE,KAAM,EAAE,CAAC,EACzB,IAAA,YAAK,EAAC,EAAE,KAAK,EAAE,KAAM,EAAE,CAAC,EACxB,IAAA,kBAAW,EAAC,CAAC,CAAC,CACf,CAAC;AAEW,QAAA,WAAW,GAAG,sBAAc,CAAC,IAAI,CAC5C,IAAA,UAAG,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EACzB,IAAA,aAAM,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAClB,IAAA,kBAAW,EAAC,CAAC,CAAC,CACf,CAAC;AAEW,QAAA,kBAAkB,GAAG,mBAAW,CAAC,IAAI,CAChD,IAAA,UAAG,EAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,WAAW,CAAC,EACnC,IAAA,kBAAW,EAAC,CAAC,CAAC,CACf,CAAC;AAEF,IAAA,YAAK,EAAC,KAAK,IAAI,EAAE;IACf,MAAM,iBAAiB,GAAG,MAAM,IAAA,qBAAc,EAAC,0BAAkB,CAAC,CAAC;IAInE,QAAQ,CAAC,MAAM,CAAC,cAAc,CAI5B,wBAAwB,EACxB;QACE,QAAQ,E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AccountInfoService } from '@yuants/data-account';\nimport { Terminal } from '@yuants/protocol';\nimport { defer, filter, first, firstValueFrom, map, repeat, retry, shareReplay } from 'rxjs';\nimport { getAccountConfig, getDefaultCredential, getGridPositions } from './api';\nimport { getStrategyAccountInfo } from './accountInfos';\n\nconst terminal = Terminal.fromNodeEnv();\nconst credential = getDefaultCredential();\n\nexport const accountConfig$ = defer(() => getAccountConfig(credential)).pipe(\n repeat({ delay: 10_000 }),\n retry({ delay: 10_000 }),\n shareReplay(1),\n);\n\nexport const accountUid$ = accountConfig$.pipe(\n map((x) => x.data[0].uid),\n filter((x) => !!x),\n shareReplay(1),\n);\n\nexport const strategyAccountId$ = accountUid$.pipe(\n map((uid) => `okx/${uid}/strategy`),\n shareReplay(1),\n);\n\ndefer(async () => {\n const strategyAccountId = await firstValueFrom(strategyAccountId$);\n\n type InferPromise<T> = T extends Promise<infer U> ? U : T;\n\n terminal.server.provideService<\n { account_id: string; algoId: string },\n InferPromise<ReturnType<typeof getGridPositions>>\n >(\n `OKX/QueryGridPositions`,\n {\n required: ['account_id', 'algoId'],\n properties: {\n account_id: { type: 'string', const: strategyAccountId },\n algoId: { type: 'string' },\n },\n },\n async (msg) => {\n //\n return {\n res: {\n code: 0,\n message: 'OK',\n data: await getGridPositions(credential, { algoOrdType: 'contract_grid', algoId: msg.req.algoId }),\n },\n };\n },\n {\n egress_token_capacity: 20,\n egress_token_refill_interval: 4000, // 每 4 秒恢复 20 个令牌 (双倍冗余限流)\n },\n );\n\n provideAccountInfoService(terminal, strategyAccountId, () => getStrategyAccountInfo(credential), {\n auto_refresh_interval: 5000,\n });\n}).subscribe();\n\nconst sub = defer(() => accountUid$)\n .pipe(first())\n .subscribe((uid) => {\n addAccountMarket(terminal, { account_id: `okx/${uid}/strategy`, market_id: 'OKX' });\n });\ndefer(() => terminal.dispose$).subscribe(() => sub.unsubscribe());\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuants/vendor-okx",
3
- "version": "0.23.25",
3
+ "version": "0.23.26",
4
4
  "bin": "lib/cli.js",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -9,19 +9,19 @@
9
9
  "temp"
10
10
  ],
11
11
  "dependencies": {
12
- "@yuants/protocol": "0.50.3",
13
- "@yuants/transfer": "0.2.32",
14
- "@yuants/data-account": "0.6.13",
15
- "@yuants/data-order": "0.3.11",
12
+ "@yuants/protocol": "0.50.4",
13
+ "@yuants/transfer": "0.2.33",
14
+ "@yuants/data-account": "0.6.14",
15
+ "@yuants/data-order": "0.3.12",
16
16
  "@yuants/utils": "0.11.0",
17
- "@yuants/cache": "0.2.4",
18
- "@yuants/sql": "0.9.23",
19
- "@yuants/data-series": "0.3.44",
20
- "@yuants/data-product": "0.4.14",
21
- "@yuants/data-ohlc": "0.4.15",
22
- "@yuants/data-interest-rate": "0.1.41",
23
- "@yuants/data-quote": "0.2.36",
24
- "@yuants/data-trade": "0.1.14",
17
+ "@yuants/cache": "0.3.0",
18
+ "@yuants/sql": "0.9.24",
19
+ "@yuants/data-series": "0.3.45",
20
+ "@yuants/data-product": "0.4.15",
21
+ "@yuants/data-ohlc": "0.4.16",
22
+ "@yuants/data-interest-rate": "0.1.42",
23
+ "@yuants/data-quote": "0.2.37",
24
+ "@yuants/data-trade": "0.1.15",
25
25
  "rxjs": "~7.5.6",
26
26
  "crypto-js": "^4.2.0",
27
27
  "ws": "~8.8.1"
@@ -1,50 +1,60 @@
1
1
  {
2
- "apps/vendor-okx/CHANGELOG.json": "093f9ca746d9ae42a6ed9513f9dede0235113c9c",
3
- "apps/vendor-okx/CHANGELOG.md": "0741fa1d76287cb1974c1d4a2c01f6aa6b59ce33",
2
+ "apps/vendor-okx/CHANGELOG.json": "010ffdab5701ba146833116295b9f94b1ef01ae7",
3
+ "apps/vendor-okx/CHANGELOG.md": "aa14ccfb2cc6e9c9a056b10377c5ad0277831be1",
4
4
  "apps/vendor-okx/README.md": "ac3d1f6c4c8d73066664699b0bb1b01db02e67a2",
5
5
  "apps/vendor-okx/api-extractor.json": "62f4fd324425b9a235f0c117975967aab09ced0c",
6
6
  "apps/vendor-okx/config/jest.config.json": "4bb17bde3ee911163a3edb36a6eb71491d80b1bd",
7
7
  "apps/vendor-okx/config/rig.json": "f6c7b5537dc77a3170ba9f008bae3b6c3ee11956",
8
8
  "apps/vendor-okx/config/typescript.json": "854907e8a821f2050f6533368db160c649c25348",
9
9
  "apps/vendor-okx/etc/vendor-okx.api.md": "92c54ccd547d2ad81ca6088158ca193e85c208df",
10
- "apps/vendor-okx/package.json": "60e48be7359f3847ddf6f9e6f53a5bc94d25ceff",
11
- "apps/vendor-okx/src/account.ts": "453707bb506f45bd69f0d47beb7108982ba0c1a7",
10
+ "apps/vendor-okx/package.json": "61e42c630aac1f5ae95a7966a0f6281771997b83",
11
+ "apps/vendor-okx/src/account.ts": "70d23dc3cf097b5bb43c07322e1a1429e89074c0",
12
+ "apps/vendor-okx/src/accountInfos/earning.ts": "d1afa6c128c628ebb787860c84f6cee037782fe1",
13
+ "apps/vendor-okx/src/accountInfos/funding.ts": "8ddb44633e8d76975b69695ad1ebcd80b0242fd2",
14
+ "apps/vendor-okx/src/accountInfos/index.ts": "272c4a49a94749b17d83bfb1f39a9bd932707288",
15
+ "apps/vendor-okx/src/accountInfos/loan.ts": "688b1f3cd8937f9b9da4a986e478c3e8efbfeebb",
16
+ "apps/vendor-okx/src/accountInfos/strategy.ts": "dd8a931aa9a85a416c491642a5e6663e8965244c",
17
+ "apps/vendor-okx/src/accountInfos/trading.ts": "9108ed4cf31b86d554db6ccff089c9176688dd06",
18
+ "apps/vendor-okx/src/accountInfos/types.ts": "c3c1096c3ad6849f6f679f1dfe0badb3ae876e41",
12
19
  "apps/vendor-okx/src/api-service.ts": "9f236b61d28781eb75ef3d572e75e3b95e4e305a",
13
20
  "apps/vendor-okx/src/api.ts": "ed9ad3c6052f0968cf612b474d9301d2316f4a04",
14
21
  "apps/vendor-okx/src/cli.ts": "9bf6b5559a6c6f33da20e74cc6c5d702c60ec891",
15
22
  "apps/vendor-okx/src/index.ts": "cf3479fcc512941fa3e8550ff06cbe1467bfe705",
16
23
  "apps/vendor-okx/src/interest_rate.ts": "192ab4c5fb4cc1075bda57ba3ca6d21b4e5714a9",
17
- "apps/vendor-okx/src/loan-account.ts": "e211bd87561fec290292a9d4230055eac702fdde",
24
+ "apps/vendor-okx/src/loan-account.ts": "cba4bc9fa7c4f965f6a1196b4d03925abdf77aea",
18
25
  "apps/vendor-okx/src/market-order.ts": "80c8881dc460ca03c655f513adb0653b675f28b3",
19
26
  "apps/vendor-okx/src/ohlc.ts": "535f802ef8f3df1468d0e45ba5b7f1b8fa78940c",
20
- "apps/vendor-okx/src/order-actions.ts": "bc5159944f2078117b94a3807b73a5d7180fb73d",
27
+ "apps/vendor-okx/src/order-actions.ts": "0d2348a6082cba9a125204a668cfc8bce64358e8",
21
28
  "apps/vendor-okx/src/order.ts": "305edb35b895fa7afa187250cf08d50084c978f7",
29
+ "apps/vendor-okx/src/orders/cancelOrder.ts": "5c89d1860c93a0a6de113e5ae398300ec8da6cef",
30
+ "apps/vendor-okx/src/orders/modifyOrder.ts": "48d6df204967c831f4bee3d05429d56c02ab0f20",
31
+ "apps/vendor-okx/src/orders/submitOrder.ts": "dea1824cea155e41fc062c3cbe8a3f3ced7bab8f",
22
32
  "apps/vendor-okx/src/product.ts": "2dfbe23705894e3b2d3883aa69c7a989d32ca1d9",
23
33
  "apps/vendor-okx/src/provideOHLCFromTimeBackwardService.ts": "3a44206410b5b73683f2395d6c551549b553d7bd",
24
34
  "apps/vendor-okx/src/provideSeriesFromTimeBackwardService.ts": "daf3c793eb4fc20e59a740bb69e50fadab5f62f0",
25
35
  "apps/vendor-okx/src/public-api.ts": "05b9cddafd09b5c9f65ce4eaeab42832e7d60449",
26
36
  "apps/vendor-okx/src/quote.ts": "6ebc494a6d739edfa79cab2f88576df5b0798138",
27
37
  "apps/vendor-okx/src/services.ts": "cda765de4da97a532eb7652ea66764e9ba9afe6c",
28
- "apps/vendor-okx/src/strategy-account.ts": "3d477a597466754bfed079319eb5f9d92df85daf",
38
+ "apps/vendor-okx/src/strategy-account.ts": "6a224521d192a69c6d9051fde87d2a95a506afae",
29
39
  "apps/vendor-okx/src/trade.ts": "06a443dc3cd8caf016211f85599d063a1a12c63b",
30
40
  "apps/vendor-okx/src/transfer.ts": "e2284568d755b87904160d832e25affc90f4f35c",
31
41
  "apps/vendor-okx/src/websocket.ts": "3614db6be5dc7dba842ae4dfdd0a7c8de201b21a",
32
42
  "apps/vendor-okx/src/ws.ts": "7aa1561c8c524dee838817eaeda5031d389ec877",
33
43
  "apps/vendor-okx/tsconfig.json": "81da8f78196974b5d15da0edb6b2d9f48641063c",
34
44
  "apps/vendor-okx/.rush/temp/shrinkwrap-deps.json": "41772be396e5468b5ef42f47388dc75c7a566c7b",
35
- "libraries/protocol/temp/package-deps.json": "d5619e41337bc3cb7603dad78c3a2487fb6b4246",
36
- "libraries/transfer/temp/package-deps.json": "7b16b33d2d5114bfd6b9a2eb1ddf3938041ca1b0",
37
- "libraries/data-account/temp/package-deps.json": "a0e200bac55f413109ee3a2d49da850d8e3e8e04",
38
- "libraries/data-order/temp/package-deps.json": "5fd2327799b8e5d6b4813bd508799c8c0d5f820e",
45
+ "libraries/protocol/temp/package-deps.json": "35bc77333a1c85db1cd130579963e8cefa00f56c",
46
+ "libraries/transfer/temp/package-deps.json": "708a4caf79d042cad56a39f0b00d399bca04af40",
47
+ "libraries/data-account/temp/package-deps.json": "1063c689ee00118b3bf78dec1fe00efe0a258db3",
48
+ "libraries/data-order/temp/package-deps.json": "943238fe32aa351d20da29ba160399268b01bf29",
39
49
  "libraries/utils/temp/package-deps.json": "c58f1ca8f498315d9a0219ca8c498299a41d297b",
40
- "libraries/cache/temp/package-deps.json": "b00b0ced57796602fd9432b4a906bf7859714443",
41
- "libraries/sql/temp/package-deps.json": "676b90e32d2cf44d01f4e14ec0bdea08fa2a425a",
42
- "libraries/data-series/temp/package-deps.json": "fca1fdd3f626f5db5d8e2cc69ec8c81e543541a4",
43
- "libraries/data-product/temp/package-deps.json": "8a3d9080547bcd7a2515acf9f7e44bd49e585c96",
44
- "libraries/data-ohlc/temp/package-deps.json": "42af211cdf8342985283a0035f235a5d9ad61283",
45
- "libraries/data-interest-rate/temp/package-deps.json": "bdbfdd4ec4288222a78ca75bbd59d20d7f59a340",
46
- "libraries/data-quote/temp/package-deps.json": "147a06007483a4798d54c606846902d903829345",
47
- "libraries/data-trade/temp/package-deps.json": "b6c32f1fc23ff4cce8b0951ae3d0e0736e021bb1",
50
+ "libraries/cache/temp/package-deps.json": "49789a92426969daa31f0c956bb56bd783929765",
51
+ "libraries/sql/temp/package-deps.json": "e3b6f24485a429fb24cacbf0d6150f55ca394706",
52
+ "libraries/data-series/temp/package-deps.json": "d5269fad8f63460b1b5f29ba701ad3a9457e0061",
53
+ "libraries/data-product/temp/package-deps.json": "0a4e14971c7dc350b84712fb16c07fefad351619",
54
+ "libraries/data-ohlc/temp/package-deps.json": "6e10227e1c394ad0b5a71e0f810914760e9b7956",
55
+ "libraries/data-interest-rate/temp/package-deps.json": "11bb199efb64628f67b1165e11d6c85dd7114a9a",
56
+ "libraries/data-quote/temp/package-deps.json": "752ea44d75cbe7a652ace79629c02ca92a92cf1d",
57
+ "libraries/data-trade/temp/package-deps.json": "3383f312b7263d86dede5a11293727746a252e5b",
48
58
  "libraries/extension/temp/package-deps.json": "fd20507284f9fd74b4de6f9855c8cead9cc132e8",
49
59
  "tools/toolkit/temp/package-deps.json": "23e053490eb8feade23e4d45de4e54883e322711"
50
60
  }