{"_id":"@apricot-lend/liquidator-ts","_rev":"3-a5f6b068f9432627d1a7dafd6e41a57f","name":"@apricot-lend/liquidator-ts","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@apricot-lend/liquidator-ts","version":"0.0.1","description":"Apricot Liquidator Bot","main":"dist/index.js","scripts":{"build":"rm -rf dist; tsc -p tsconfig.json","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Apricot-Finance/liquidator-bot-ts.git"},"author":{"name":"Apricot"},"license":"ISC","bugs":{"url":"https://github.com/Apricot-Finance/liquidator-bot-ts/issues"},"homepage":"https://github.com/Apricot-Finance/liquidator-bot-ts#readme","dependencies":{"@apricot-lend/sdk-ts":"^0.15.75","@apricot-lend/solana-swaps-js":"^0.1.12","@solana/spl-token":"^0.1.8","@solana/web3.js":"^1.29.1","firebase":"^9.1.3","tiny-invariant":"^1.1.0"},"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3"},"gitHead":"6c3d1c60c35f79c9902d4b2c9a60b3da8902476a","_id":"@apricot-lend/liquidator-ts@0.0.1","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-lgT+a4mvh/1+8LpF8SzMmtjlVizkSL/xgXwNitQrwLH1KTL8/wuRQStlfbWyyrUAAfT7Dy6MTy4oTqpaHqS2xA==","shasum":"d81338e86e7c78d7c7c1af6501ec708a6b7b29f9","tarball":"https://registry.npmjs.org/@apricot-lend/liquidator-ts/-/liquidator-ts-0.0.1.tgz","fileCount":26,"unpackedSize":135839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnge4CRA9TVsSAnZWagAAu6IP/i6+GUEJB6lCQCML2UvX\nqSw9nINkTpyl78GCjzFjZs7NFsergIGdlat0095KrlqHVsjxe8FRHb11XO+I\nxO8ThHdxSd+1u2QeNspYQT1cnxOGczTVaUJ+8aV0ZSdnnAygAen6jLXn8YSE\n4VyiAaDcydCPhBX4SWxLwjRqB/PBusHhJOcm5mEhHEhK02c3HjXtdbrtEpsv\nSUgr6hhpt7QLSc56bcFOG/UPeUbo9m8n0iJn6cF0OLpPbChgYry+kVcWkkI8\nl/UR30Xvv1HhJd6TT8Smad1bZmhTReKT2kDZ+RaqJRZSedfQdazd2m8qNocg\n/dE7EpslYQudpAdX7/hPUUpMSykKEhtVKqAEayYveMz8F7Yr8Wzvl92pEt+G\n5RMKj+nUR2Xi3UdfD8URx3plldoQ2kggpL04aGH7RITjuilmI8sPDilf5aHU\ndtpkEw4GUA+uPNyYT+eiztCGzo6ZPhX0N43TvGK1ff0CFX00tBKgJKlW0Twa\nU1cvoI+TGJ0FOUvav+fV45PyTRA270pD6cYK+1vsrH626BZnl/OxJtB1Oe4Y\n2jVm8n5T4yvvV6eG82im6NSGytRuXLLikQ4L5c8qu3O9emjQgCc+7FMA3kjs\n3HmMhBhKeX7D8shGazgQ5B8gwkl6rRvMrMfeLXDbI6tTonKPVR7PreSAU9Ms\ntQWi\r\n=kGl0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZUE+Def4FHf/Sjqg/tBA5Q1e+M/tceoNV6nMrsNcZbwIhAKrke8cVzt4uPSYpZiM0c7abfzJesOIGDcHqoZXF31l6"}]},"_npmUser":{"name":"apricot-lend","email":"yhou@apricot.one"},"directories":{},"maintainers":[{"name":"apricot-lend","email":"yhou@apricot.one"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/liquidator-ts_0.0.1_1637746616547_0.20386719780718954"},"_hasShrinkwrap":false}},"time":{"created":"2021-11-24T09:36:56.510Z","0.0.1":"2021-11-24T09:36:56.697Z","modified":"2022-08-12T13:14:48.092Z"},"maintainers":[{"email":"joe.dai@apricot.one","name":"joedai"},{"email":"yhou@apricot.one","name":"apricot-yhou"}],"description":"Apricot Liquidator Bot","homepage":"https://github.com/Apricot-Finance/liquidator-bot-ts#readme","repository":{"type":"git","url":"git+https://github.com/Apricot-Finance/liquidator-bot-ts.git"},"author":{"name":"Apricot"},"bugs":{"url":"https://github.com/Apricot-Finance/liquidator-bot-ts/issues"},"license":"ISC","readme":"# liquidator-bot-ts\n\nApricot's USDC-only liquidator. This is a simple liquidator that maintains inventory in USDC only. This means that:\n- When it needs to repay in a token other than USDC, it will swap USDC to that token on the spot\n- After it acquires collateral through liquidation, it will immediately swap that collateral back to USDC\n\nHow to launch:\n```bash\nyarn install\nyarn build\n# this launches it in indirect subscription mode\nnode dist/index.js public YOUR_LIQUIDATOR_PRIVATE_KEY.json 0 0\n```\n\nThe liquidator bot has 2 modes of operation:\n- Direct subscription mode (the hard, but possibly faster one)\n- Indirect subscription mode (the easy one)\n\n# Direct subscription mode\nUnder direct subscription mode, the liquidator bot subscribes to changes on the Solana chain directly via solana RPC\nservers. In our experience, however, RPC connections can become unstable after some time (missing update notifications\netc.) so running the liquidator bot in this mode isn't always reliable. The Apricot team uses the attached `launcher.sh`\nto launch a group of liquidators, and then periodically restart the liquidators (automated) to prevent any connection\nissues from persisting.\n\nLong story short, this mode is probably faster. However, it consumes a lot more resources and you'd need to launch\nthings using the `launcher.sh` script.\n\nLaunch command:\n```\nKEY_LOC=your_private_key.json launcher.sh\n```\n\n# Indirect subscription mode\nUnder the indirect subscription mode, the liquidator bot subscribes to a Google Firebase database maintained by the\nApricot team for candidate accounts that need to be liquidated. This mode is a lot ligher on resources and way easier to\nrun. But it could be slightly slower than the direct subscription mode (since it goes through another database layer).\n\nLaunch command:\n```\nnode dist/index.js public liquidator_private_key.json 0 0\n```\n\n\n# Private key/wallet Set up\n\nYou need to set up a private key, give it enough SOL to fire transactions, and deposit X USDC into its\nassociated USDC account.\n\nAfter that, you need to change `maxLiquidationSize` in `liquidator_config.json` to the maximum amount of liquidation you\nare able to execute at once. I would just set it to slightly smaller than X.\n","readmeFilename":"README.md"}