{"id":25475120,"url":"https://github.com/ibwei/backpack","last_synced_at":"2025-11-05T18:30:27.701Z","repository":{"id":227454142,"uuid":"769183624","full_name":"ibwei/backpack","owner":"ibwei","description":"在backpack刷交易量的油猴脚本","archived":false,"fork":false,"pushed_at":"2024-03-13T17:46:10.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-03-14T12:38:52.362Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ibwei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-08T14:11:44.000Z","updated_at":"2024-03-13T17:56:47.000Z","dependencies_parsed_at":"2024-03-13T12:45:42.920Z","dependency_job_id":null,"html_url":"https://github.com/ibwei/backpack","commit_stats":null,"previous_names":["ibwei/backpack"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibwei%2Fbackpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibwei%2Fbackpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibwei%2Fbackpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibwei%2Fbackpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibwei","download_url":"https://codeload.github.com/ibwei/backpack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239467461,"owners_count":19643605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-18T11:54:04.609Z","updated_at":"2025-11-05T18:30:27.665Z","avatar_url":"https://github.com/ibwei.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## README\n\n#####  在backpack人工刷交易量的油猴脚本\n- 安装 tampermonkey 浏览器插件https://chromewebstore.google.com/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo\n- 第二步，打开插件，创建新的脚本\n- 在创建页面，把脚本完全粘贴进去，默认的模版不要，然后保存。\n\n``` typescript\n// ==UserScript==\n// @name         刷backpack 交易量\n// @namespace    http://tampermonkey.net/\n// @version      2024-03-08\n// @description  try to take over the world!\n// @author       BerryBai\n// @match        https://backpack.exchange/trade/SOL_USDC\n// @icon         https://www.google.com/s2/favicons?sz=64\u0026domain=tampermonkey.net\n// @grant        none\n// ==/UserScript==\n\nlet count = 0;\n\nfunction getWaitSeconds() {\n  // 随机生成500到3000的数字\n  return Math.floor(Math.random() * 1000 + 100);\n}\n\nfunction getSwitchSeconds() {\n  // 随机生成500到3000的数字\n  return Math.floor(Math.random() * 2500 + 500);\n}\n\nfunction sleep(ms) {\n  return new Promise((resolve) =\u003e setTimeout(resolve, ms));\n}\n\nfunction findDomByText(text, tag, no) {\n  const matches = [];\n  for (const div of document.querySelectorAll(tag)) {\n    if (div.textContent === text) {\n      matches.push(div);\n    }\n  }\n  return matches[no] ?? matches[0];\n}\n\nasync function buySol() {\n  // 先点击买\n  const buyDom = findDomByText(\"Buy\", \"p\", 0);\n  // console.log(\"BuyDom\", buyDom);\n  buyDom \u0026\u0026 buyDom.click();\n  await sleep(getWaitSeconds());\n\n  // 然后点击市价单\n  const marketDom = findDomByText(\"Market\", \"p\", 0);\n  // console.log(\"marketDom\", marketDom);\n  marketDom \u0026\u0026 marketDom.click();\n  await sleep(getWaitSeconds());\n\n  // 然后点击最大\n  const maxDom = findDomByText(\"Max\", \"div\", 0);\n  // console.log(\"maxDom\", maxDom);\n  maxDom \u0026\u0026 maxDom.click();\n  await sleep(getWaitSeconds());\n\n  // 买入\n  const buyButtonDom = findDomByText(\"Buy\", \"button\", 0);\n  // console.log(\"buyButtonDom\", buyButtonDom);\n  buyButtonDom \u0026\u0026 buyButtonDom.click();\n}\n\nasync function sellSol() {\n  const sellDom = findDomByText(\"Sell\", \"p\", 0);\n  // console.log(\"sellDom\", sellDom);\n  sellDom \u0026\u0026 sellDom.click();\n  await sleep(getWaitSeconds());\n\n  // 然后点击市价单\n  const marketDom = findDomByText(\"Market\", \"p\", 0);\n  // console.log(\"marketDom\", marketDom);\n  marketDom \u0026\u0026 marketDom.click();\n  await sleep(getWaitSeconds());\n\n  // 然后点击最大\n  const maxDom = findDomByText(\"Max\", \"div\", 0);\n  // console.log(\"maxDom\", maxDom);\n  maxDom \u0026\u0026 maxDom.click();\n  await sleep(getWaitSeconds());\n\n  // 卖出;\n  const sellButtonDom = findDomByText(\"Sell\", \"button\", 0);\n  // console.log(\"sellButtonDom\", sellButtonDom);\n  sellButtonDom \u0026\u0026 sellButtonDom.click();\n}\n\nasync function runWork() {\n  count++;\n  console.log(`开始第${count}次买SOL`);\n  await sleep(getSwitchSeconds());\n  await buySol();\n  await sleep(getSwitchSeconds());\n  console.log(`开始第${count}次卖SOL`);\n  await sellSol();\n}\n\nfunction runTimer() {\n  (function inner() {\n    let t = setTimeout(async () =\u003e {\n      await runWork();\n      clearTimeout(t);\n      inner();\n    }, 2000);\n  })();\n}\n\n(function () {\n  \"use strict\";\n  runTimer();\n})();\n```\n\n- 脚本匹配的有网址，进入backpack的 SOL/USDC交易对会自动运行，也可以自己打开开关，打开要重置。\n- 不想刷了，就点关闭，或者禁用\n- 理论上这个脚本适用所有的交易对，只要把脚本中的match这一行改成 交易对对应的URL，\n  - PYTH的URL：https://backpack.exchange/trade/PYTH_USDC\n  - RNDR：https://backpack.exchange/trade/RENDER_USDC\n  - 建议就用SOL/USDC，深度最好，滑点最小\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibwei%2Fbackpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibwei%2Fbackpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibwei%2Fbackpack/lists"}