GamesPs.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. const axios = require('axios');
  2. const Logs = require('../libs/logs');
  3. const Setting = require('./Setting');
  4. const { eventSolutions } = require('../triangle/eventSolutions');
  5. const { calcTotalProfit, calcTotalProfitWithFixedFirst } = require('../triangle/totalProfitCalc');
  6. const childOptions = process.env.NODE_ENV == 'development' ? {
  7. execArgv: ['--inspect=9228'],
  8. stdio: ['pipe', 'pipe', 'pipe', 'ipc']
  9. } : {};
  10. const { fork } = require('child_process');
  11. const events_child = fork('./triangle/eventsMatch.js', [], childOptions);
  12. const PS_IOR_KEYS = [
  13. ['0', 'ior_mh', 'ior_mn', 'ior_mc'],
  14. // ['0', 'ior_rh_05', 'ior_mn', 'ior_rc_05'],
  15. ['-1', 'ior_rh_15', 'ior_wmh_1', 'ior_rac_05'],
  16. ['-2', 'ior_rh_25', 'ior_wmh_2', 'ior_rac_15'],
  17. ['+1', 'ior_rah_05', 'ior_wmc_1', 'ior_rc_15'],
  18. ['+2', 'ior_rah_15', 'ior_wmc_2', 'ior_rc_25'],
  19. ];
  20. const BASE_URL = 'https://api.isthe.me/api/p';
  21. const IS_DEV = process.env.NODE_ENV == 'development';
  22. const GAMES = {
  23. Leagues: {},
  24. List: {},
  25. Baselist: {},
  26. Relations: {},
  27. Solutions: {},
  28. };
  29. const Request = {
  30. callbacks: {},
  31. count: 0,
  32. }
  33. /**
  34. * 精确浮点数字
  35. * @param {number} number
  36. * @param {number} x
  37. * @returns {number}
  38. */
  39. const fixFloat = (number, x=2) => {
  40. return parseFloat(number.toFixed(x));
  41. }
  42. /**
  43. * 获取市场类型
  44. */
  45. const getMarketType = (mk) => {
  46. return mk == 0 ? 'early' : 'today';
  47. }
  48. /**
  49. * 同步联赛列表
  50. */
  51. const syncLeaguesList = ({ mk, leagues }) => {
  52. if (IS_DEV) {
  53. return Logs.out('syncLeaguesList', { mk, leagues });
  54. }
  55. axios.post(`${BASE_URL}/syncLeague`, { mk, leagues })
  56. .then(res => {
  57. Logs.out('syncLeaguesList', res.data);
  58. })
  59. .catch(err => {
  60. Logs.out('syncLeaguesList', err.message);
  61. });
  62. }
  63. /**
  64. * 更新联赛列表
  65. */
  66. const updateLeaguesList = ({ mk, leagues }) => {
  67. const leaguesList = GAMES.Leagues;
  68. if (JSON.stringify(leaguesList[mk]) != JSON.stringify(leagues)) {
  69. leaguesList[mk] = leagues;
  70. syncLeaguesList({ mk, leagues });
  71. return leagues.length;
  72. }
  73. return 0;
  74. }
  75. /**
  76. * 获取筛选过的联赛
  77. */
  78. const getFilteredLeagues = async (mk) => {
  79. return axios.get(`${BASE_URL}/getLeagueTast?mk=${mk}`)
  80. .then(res => {
  81. if (res.data.code == 0) {
  82. return res.data.data;
  83. }
  84. return Promise.reject(new Error(res.data.message));
  85. });
  86. }
  87. /**
  88. * 同步比赛列表到服务器
  89. */
  90. const syncGamesList = ({ platform, mk, games }) => {
  91. if (IS_DEV) {
  92. return Logs.out('syncGamesList', { platform, mk, games });
  93. }
  94. axios.post(`${BASE_URL}/syncGames`, { platform, mk, games })
  95. .then(res => {
  96. Logs.out('syncGamesList', { platform, mk, count: games.length }, res.data);
  97. })
  98. .catch(err => {
  99. Logs.out('syncGamesList', { platform, mk }, err.message);
  100. });
  101. }
  102. /**
  103. * 同步基准比赛列表
  104. */
  105. const syncBaseList = ({ marketType, games }) => {
  106. const baseList = GAMES.Baselist;
  107. if (!baseList[marketType]) {
  108. baseList[marketType] = games;
  109. }
  110. const newMap = new Map(games.map(item => [item.eventId, item]));
  111. // 删除不存在的项
  112. for (let i = baseList[marketType].length - 1; i >= 0; i--) {
  113. if (!newMap.has(baseList[marketType][i].eventId)) {
  114. baseList[marketType].splice(i, 1);
  115. }
  116. }
  117. // 添加或更新
  118. const oldIds = new Set(baseList[marketType].map(item => item.eventId));
  119. games.forEach(game => {
  120. if (!oldIds.has(game.eventId)) {
  121. // 添加新项
  122. baseList[marketType].push(game);
  123. }
  124. });
  125. }
  126. /**
  127. * 更新比赛列表
  128. */
  129. const updateGamesList = (({ platform, mk, games } = {}) => {
  130. return new Promise((resolve, reject) => {
  131. if (!platform || !games) {
  132. return reject(new Error('PLATFORM_GAMES_INVALID'));
  133. }
  134. const marketType = getMarketType(mk);
  135. syncGamesList({ platform, mk, games });
  136. if (platform == 'ps') {
  137. syncBaseList({ marketType, games });
  138. }
  139. resolve();
  140. });
  141. });
  142. /**
  143. * 提交盘口数据
  144. */
  145. const submitOdds = ({ platform, mk, games }) => {
  146. if (IS_DEV) {
  147. return Logs.out('syncOdds', { platform, mk, games });
  148. }
  149. axios.post(`${BASE_URL}/syncOdds`, { platform, mk, games})
  150. .then(res => {
  151. Logs.out('syncOdds', { platform, mk, count: games.length }, res.data);
  152. })
  153. .catch(err => {
  154. Logs.out('syncOdds', { platform, mk }, err.message);
  155. });
  156. }
  157. /**
  158. * 同步基准盘口
  159. */
  160. const syncBaseEvents = ({ mk, games, outrights }) => {
  161. const marketType = getMarketType(mk);
  162. const baseList = GAMES.Baselist;
  163. if (!baseList[marketType]) {
  164. return;
  165. }
  166. const baseMap = new Map(baseList[marketType].map(item => [item.eventId, item]));
  167. games?.forEach(game => {
  168. const { eventId, evtime, events } = game;
  169. const baseGame = baseMap.get(eventId);
  170. if (baseGame) {
  171. baseGame.evtime = evtime;
  172. baseGame.events = events;
  173. }
  174. });
  175. outrights?.forEach(outright => {
  176. const { parentId, sptime, special } = outright;
  177. const baseGame = baseMap.get(parentId);
  178. if (baseGame) {
  179. baseGame.sptime = sptime;
  180. baseGame.special = special;
  181. }
  182. });
  183. if (games?.length) {
  184. const gamesList = baseList[marketType]?.map(game => {
  185. const { evtime, events, sptime, special, ...gameInfo } = game;
  186. const expireTime = Date.now() - 15000;
  187. let odds = {};
  188. if (evtime > expireTime) {
  189. odds = { ...odds, ...events };
  190. }
  191. if (sptime > expireTime) {
  192. odds = { ...odds, ...special };
  193. }
  194. const matches = PS_IOR_KEYS.map(([label, ...keys]) => {
  195. const match = keys.map(key => ({
  196. key,
  197. value: odds[key] ?? 0
  198. }));
  199. return {
  200. label,
  201. match
  202. };
  203. }).filter(item => item.match.every(entry => entry.value !== 0));
  204. return { ...gameInfo, matches, uptime: Math.min(evtime ?? 0, sptime ?? 0) };
  205. });
  206. if (gamesList.filter(item => item.uptime > 0).length) {
  207. submitOdds({ platform: 'ps', mk, games: gamesList });
  208. }
  209. const relatedGames = Object.values(GAMES.Relations).map(item => item.rel?.['ps'] ?? {});
  210. if (!relatedGames.length) {
  211. return 0;
  212. }
  213. let update = 0;
  214. const relatedMap = new Map(relatedGames.map(item => [item.eventId, item]));
  215. gamesList?.forEach(game => {
  216. const { eventId, matches, uptime } = game;
  217. const relatedGame = relatedMap.get(eventId);
  218. if (relatedGame) {
  219. const events = {};
  220. matches.forEach(({ label, match }) => {
  221. match.forEach(({ key, value }) => {
  222. events[key] = value;
  223. });
  224. });
  225. relatedGame.evtime = uptime;
  226. relatedGame.events = events;
  227. update ++;
  228. }
  229. });
  230. return update;
  231. }
  232. }
  233. const updateGamesEvents = ({ platform, mk, games, outrights }) => {
  234. return new Promise((resolve, reject) => {
  235. if (!platform || (!games && !outrights)) {
  236. return reject(new Error('PLATFORM_GAMES_INVALID'));
  237. }
  238. if (platform == 'ps') {
  239. const update = syncBaseEvents({ mk, games, outrights });
  240. return resolve({ update });
  241. }
  242. const relatedGames = Object.values(GAMES.Relations).map(item => item.rel?.[platform] ?? {});
  243. if (!relatedGames.length) {
  244. return resolve({ update: 0 });
  245. }
  246. const updateCount = {
  247. update: 0
  248. };
  249. const relatedMap = new Map(relatedGames.map(item => [item.eventId, item]));
  250. games?.forEach(game => {
  251. const { eventId, evtime, events } = game;
  252. const relatedGame = relatedMap.get(eventId);
  253. if (relatedGame) {
  254. relatedGame.evtime = evtime;
  255. relatedGame.events = events;
  256. updateCount.update ++;
  257. }
  258. });
  259. outrights?.forEach(outright => {
  260. const { parentId, sptime, special } = outright;
  261. const relatedGame = relatedMap.get(parentId);
  262. if (relatedGame) {
  263. relatedGame.sptime = sptime;
  264. relatedGame.special = special;
  265. updateCount.update ++;
  266. }
  267. });
  268. resolve(updateCount);
  269. });
  270. }
  271. /**
  272. * 获取比赛盘口
  273. */
  274. const getGamesEvents = ({ platform, relIds = [] } = {}) => {
  275. if (!relIds.length) {
  276. return null;
  277. }
  278. const idSet = new Set(relIds);
  279. const relations = { ...GAMES.Relations };
  280. Object.keys(relations).forEach(id => {
  281. if (idSet.size && !idSet.has(+id)) {
  282. delete relations[id];
  283. }
  284. });
  285. if (platform) {
  286. return Object.values(relations).map(rel => rel[platform] ?? {});
  287. }
  288. const gamesEvents = {};
  289. Object.values(relations).forEach(({ rel }) => {
  290. Object.keys(rel).forEach(platform => {
  291. const game = rel[platform] ?? {};
  292. const { eventId, events, special } = game;
  293. if (!gamesEvents[platform]) {
  294. gamesEvents[platform] = {};
  295. }
  296. gamesEvents[platform][eventId] = { ...events, ...special };
  297. });
  298. });
  299. return gamesEvents;
  300. }
  301. /**
  302. * 获取关联比赛
  303. */
  304. const fetchGamesRelation = async (mk='') => {
  305. return axios.get(`${BASE_URL}/getGameTast?mk=${mk}`)
  306. .then(res => {
  307. if (res.data.code == 0) {
  308. const now = Date.now();
  309. const gamesRelation = res.data.data?.filter(item => {
  310. const timestamp = new Date(item.timestamp).getTime();
  311. item.timestamp = timestamp;
  312. return timestamp > now;
  313. }).map(item => {
  314. const {
  315. id, mk, league_name,
  316. event_id: ps_event_id,
  317. league_id: ps_league_id,
  318. team_home_name: ps_team_home_name,
  319. team_away_name: ps_team_away_name,
  320. ob_event_id, ob_league_id,
  321. ob_team_home_name,
  322. ob_team_away_name,
  323. hg_event_id, hg_league_id,
  324. hg_team_home_name,
  325. hg_team_away_name,
  326. timestamp,
  327. } = item;
  328. const rel = {
  329. ps: {
  330. eventId: +ps_event_id,
  331. leagueId: +ps_league_id,
  332. leagueName: league_name,
  333. teamHomeName: ps_team_home_name,
  334. teamAwayName: ps_team_away_name,
  335. timestamp
  336. },
  337. ob: ob_event_id ? {
  338. eventId: +ob_event_id,
  339. leagueId: +ob_league_id,
  340. leagueName: league_name,
  341. teamHomeName: ob_team_home_name,
  342. teamAwayName: ob_team_away_name,
  343. timestamp
  344. } : null,
  345. hg: hg_event_id ? {
  346. eventId: +hg_event_id,
  347. leagueId: +hg_league_id,
  348. leagueName: league_name,
  349. teamHomeName: hg_team_home_name,
  350. teamAwayName: hg_team_away_name,
  351. timestamp
  352. } : null
  353. };
  354. return { id: ps_event_id, mk, rel };
  355. }) ?? [];
  356. return gamesRelation;
  357. }
  358. return Promise.reject(new Error(res.data.message));
  359. });
  360. }
  361. const getGamesRelation = ({ mk, listEvents } = {}) => {
  362. const relations = Object.values(GAMES.Relations).filter(item => {
  363. if (typeof(mk) == 'undefined') {
  364. return true;
  365. }
  366. return item.mk == mk;
  367. });
  368. if (listEvents) {
  369. return relations;
  370. }
  371. const gamesRelation = relations.map(item => {
  372. const { rel, ...relationInfo } = item;
  373. const tempRel = { ...rel };
  374. Object.keys(tempRel).forEach(platform => {
  375. const { events, evtime, sptime, special, ...gameInfo } = tempRel[platform];
  376. tempRel[platform] = gameInfo;
  377. });
  378. return { ...relationInfo, rel: tempRel };
  379. });
  380. return gamesRelation;
  381. }
  382. /**
  383. * 定时更新关联比赛列表
  384. */
  385. const updateGamesRelation = () => {
  386. fetchGamesRelation()
  387. .then(res => {
  388. const gamesRelation = res.flat();
  389. const updateCount = {
  390. add: 0,
  391. delete: 0
  392. };
  393. gamesRelation.forEach(item => {
  394. const { id } = item;
  395. if (!GAMES.Relations[id]) {
  396. GAMES.Relations[id] = item;
  397. updateCount.add ++;
  398. }
  399. });
  400. const relations = new Set(gamesRelation.map(item => +item.id));
  401. Object.keys(GAMES.Relations).forEach(id => {
  402. if (!relations.has(+id)) {
  403. delete GAMES.Relations[id];
  404. updateCount.delete ++;
  405. }
  406. });
  407. Logs.out('updateGamesRelation', updateCount);
  408. })
  409. .catch(err => {
  410. Logs.out('updateGamesRelation', err.message);
  411. })
  412. .finally(() => {
  413. setTimeout(updateGamesRelation, 60000);
  414. });
  415. }
  416. updateGamesRelation();
  417. /**
  418. * 同步比赛结果
  419. */
  420. const syncGamesResult = async (result) => {
  421. if (IS_DEV) {
  422. return Logs.out('updateGamesResult', result);
  423. }
  424. axios.post(`${BASE_URL}/syncMatchResult`, result)
  425. .then(res => {
  426. Logs.out('syncMatchResult', res.data);
  427. })
  428. .catch(err => {
  429. Logs.out('syncMatchResult', err.message);
  430. });
  431. }
  432. /**
  433. * 更新比赛结果
  434. */
  435. const updateGamesResult = (result) => {
  436. syncGamesResult(result);
  437. return Promise.resolve();
  438. }
  439. /**
  440. * 同步中单方案
  441. */
  442. const syncSolutions = (solutions) => {
  443. if (IS_DEV) {
  444. return Logs.out('syncSolutions', solutions);
  445. }
  446. axios.post(`${BASE_URL}/syncDsOpportunity`, solutions)
  447. .then(res => {
  448. Logs.out('syncSolutions', res.data);
  449. })
  450. .catch(err => {
  451. Logs.out('syncSolutions', err.message);
  452. });
  453. }
  454. /**
  455. * 更新中单方案
  456. */
  457. const getCprKey = (cpr) => {
  458. const { k, p, v } = cpr;
  459. return `${k}_${p}_${v}`;
  460. }
  461. const compareCpr = (cpr1, cpr2) => {
  462. const key1 = getCprKey(cpr1);
  463. const key2 = getCprKey(cpr2);
  464. return key1 === key2;
  465. }
  466. const updateSolutions = (solutions) => {
  467. if (solutions?.length) {
  468. const solutionsHistory = GAMES.Solutions;
  469. const updateIds = { add: [], update: [] }
  470. solutions.forEach(item => {
  471. const { sid, cpr, sol: { win_average } } = item;
  472. if (!solutionsHistory[sid]) {
  473. solutionsHistory[sid] = item;
  474. updateIds.add.push(sid);
  475. return;
  476. }
  477. const historySolution = solutionsHistory[sid];
  478. if (historySolution.sol.win_average !== win_average || !compareCpr(historySolution.cpr, cpr)) {
  479. solutionsHistory[sid] = item;
  480. updateIds.update.push(sid);
  481. return;
  482. }
  483. const { timestamp } = item;
  484. solutionsHistory[sid].timestamp = timestamp;
  485. });
  486. if (updateIds.add.length || updateIds.update.length) {
  487. const solutionUpdate = {};
  488. Object.keys(updateIds).forEach(key => {
  489. solutionUpdate[key] = updateIds[key].map(sid => solutionsHistory[sid]);
  490. });
  491. syncSolutions(solutionUpdate);
  492. // Logs.outDev('solutions history update', solutionUpdate);
  493. }
  494. }
  495. }
  496. /**
  497. * 获取中单方案
  498. */
  499. const getSolutions = async () => {
  500. const solutionsList = Object.values(GAMES.Solutions);
  501. const relIds = solutionsList.map(item => item.info.id);
  502. const gamesEvents = getGamesEvents({ relIds });
  503. const gamesRelation = getGamesRelation();
  504. const relationsMap = new Map(gamesRelation.map(item => [item.id, item.rel]));
  505. const solutions = solutionsList.sort((a, b) => b.sol.win_average - a.sol.win_average).map(item => {
  506. const { info: { id } } = item;
  507. const relation = relationsMap.get(id);
  508. return {
  509. ...item,
  510. info: { id, ...relation }
  511. }
  512. });
  513. return { solutions, gamesEvents };
  514. }
  515. /**
  516. * 清理中单方案
  517. */
  518. const solutionsCleanup = () => {
  519. const solutionsHistory = GAMES.Solutions;
  520. const updateIds = { remove: [] }
  521. Object.keys(solutionsHistory).forEach(sid => {
  522. const { timestamp } = solutionsHistory[sid];
  523. const nowTime = Date.now();
  524. if (nowTime - timestamp > 1000*60) {
  525. delete solutionsHistory[sid];
  526. updateIds.remove.push(sid);
  527. return;
  528. }
  529. const solution = solutionsHistory[sid];
  530. const eventTime = solution.info.timestamp;
  531. if (nowTime > eventTime) {
  532. delete solutionsHistory[sid];
  533. updateIds.remove.push(sid);
  534. }
  535. });
  536. if (updateIds.remove.length) {
  537. syncSolutions(updateIds);
  538. }
  539. }
  540. /**
  541. * 定时清理中单方案
  542. */
  543. setInterval(() => {
  544. solutionsCleanup();
  545. }, 1000*30);
  546. /**
  547. * 获取综合利润
  548. */
  549. const getTotalProfit = async (sol1, sol2, inner_base, inner_rebate) => {
  550. const { innerDefaultAmount, innerRebateRatio } = await getSetting();
  551. inner_base = inner_base ? +inner_base : innerDefaultAmount;
  552. inner_rebate = inner_rebate ? +inner_rebate : fixFloat(innerRebateRatio / 100, 3);
  553. const profit = calcTotalProfit(sol1, sol2, inner_base, inner_rebate);
  554. return profit;
  555. }
  556. /**
  557. * 通过 sid 获取综合利润
  558. */
  559. const getTotalProfitWithSid = async (sid1, sid2, inner_base, inner_rebate) => {
  560. const preSolution = GAMES.Solutions[sid1];
  561. const subSolution = GAMES.Solutions[sid2];
  562. const sol1 = preSolution?.sol;
  563. const sol2 = subSolution?.sol;
  564. if (!sol1 || !sol2) {
  565. return Promise.reject(new Error('SOLUTION_ID_INVALID'));
  566. }
  567. const profit = await getTotalProfit(sol1, sol2, inner_base, inner_rebate);
  568. return { profit, solutions: [preSolution, subSolution] };
  569. }
  570. /**
  571. * 通过盘口信息获取综合利润
  572. */
  573. const getTotalProfitWithBetInfo = async (betInfo1, betInfo2, fixed=false, inner_base, inner_rebate) => {
  574. const { innerDefaultAmount, innerRebateRatio } = await getSetting();
  575. inner_base = inner_base ? +inner_base : innerDefaultAmount;
  576. inner_rebate = inner_rebate ? +inner_rebate : fixFloat(innerRebateRatio / 100, 3);
  577. if (fixed) {
  578. return calcTotalProfitWithFixedFirst(betInfo1, betInfo2, inner_base, inner_rebate);
  579. }
  580. const [sol1, sol2] = [betInfo1, betInfo2].map(betinfo => eventSolutions({...betinfo, inner_base, inner_rebate }));
  581. return getTotalProfit(sol1, sol2, inner_base, inner_rebate);
  582. }
  583. /**
  584. * 获取后台设置
  585. */
  586. const getSetting = async () => {
  587. return Setting.get();
  588. }
  589. /**
  590. * 从子进程获取数据
  591. */
  592. const getDataFromChild = (type, callback) => {
  593. const id = ++Request.count;
  594. Request.callbacks[id] = callback;
  595. events_child.send({ method: 'get', id, type });
  596. }
  597. /**
  598. * 向子进程发送数据
  599. */
  600. const postDataToChild = (type, data) => {
  601. events_child.send({ method: 'post', type, data });
  602. }
  603. /**
  604. * 处理子进程消息
  605. */
  606. events_child.on('message', async (message) => {
  607. const { callbacks } = Request;
  608. const { method, id, type, data } = message;
  609. if (method == 'get' && id) {
  610. let responseData = null;
  611. if (type == 'getGamesRelation') {
  612. responseData = getGamesRelation({ listEvents: true });
  613. }
  614. else if (type == 'getSetting') {
  615. responseData = await getSetting();
  616. }
  617. // else if (type == 'getSolutionHistory') {
  618. // responseData = getSolutionHistory();
  619. // }
  620. events_child.send({ type: 'response', id, data: responseData });
  621. }
  622. else if (method == 'post') {
  623. if (type == 'updateSolutions') {
  624. updateSolutions(data);
  625. }
  626. }
  627. else if (method == 'response' && id && callbacks[id]) {
  628. callbacks[id](data);
  629. delete callbacks[id];
  630. }
  631. });
  632. events_child.stderr.on('data', data => {
  633. Logs.out('events_child stderr', data.toString());
  634. });
  635. Setting.onUpdate(fields => {
  636. postDataToChild('updateSetting', fields);
  637. });
  638. module.exports = {
  639. updateLeaguesList, getFilteredLeagues,
  640. updateGamesList, updateGamesEvents,
  641. getGamesRelation,
  642. updateGamesResult,
  643. getSolutions,
  644. getTotalProfitWithSid,
  645. getTotalProfitWithBetInfo,
  646. }