npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@apricot-lend/liquidator-ts

v0.0.1

Published

Apricot Liquidator Bot

Downloads

4

Readme

liquidator-bot-ts

Apricot's USDC-only liquidator. This is a simple liquidator that maintains inventory in USDC only. This means that:

  • When it needs to repay in a token other than USDC, it will swap USDC to that token on the spot
  • After it acquires collateral through liquidation, it will immediately swap that collateral back to USDC

How to launch:

yarn install
yarn build
# this launches it in indirect subscription mode
node dist/index.js public YOUR_LIQUIDATOR_PRIVATE_KEY.json 0 0

The liquidator bot has 2 modes of operation:

  • Direct subscription mode (the hard, but possibly faster one)
  • Indirect subscription mode (the easy one)

Direct subscription mode

Under direct subscription mode, the liquidator bot subscribes to changes on the Solana chain directly via solana RPC servers. In our experience, however, RPC connections can become unstable after some time (missing update notifications etc.) so running the liquidator bot in this mode isn't always reliable. The Apricot team uses the attached launcher.sh to launch a group of liquidators, and then periodically restart the liquidators (automated) to prevent any connection issues from persisting.

Long story short, this mode is probably faster. However, it consumes a lot more resources and you'd need to launch things using the launcher.sh script.

Launch command:

KEY_LOC=your_private_key.json launcher.sh

Indirect subscription mode

Under the indirect subscription mode, the liquidator bot subscribes to a Google Firebase database maintained by the Apricot team for candidate accounts that need to be liquidated. This mode is a lot ligher on resources and way easier to run. But it could be slightly slower than the direct subscription mode (since it goes through another database layer).

Launch command:

node dist/index.js public liquidator_private_key.json 0 0

Private key/wallet Set up

You need to set up a private key, give it enough SOL to fire transactions, and deposit X USDC into its associated USDC account.

After that, you need to change maxLiquidationSize in liquidator_config.json to the maximum amount of liquidation you are able to execute at once. I would just set it to slightly smaller than X.