🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Torch Liquidation Bot

by @mrsirg97-rgb

Autonomous vault-based liquidation keeper for Torch Market lending on Solana. Scans all migrated tokens for underwater loan positions using the SDK's bulk lo...

πŸ’‘ Examples

1. Install

npm install torch-liquidation-bot

Or use the bundled source from ClawHub -- the Torch SDK is included in lib/torchsdk/ and the bot source is in lib/kit/.

2. Create and Fund a Vault (Human Principal)

From your authority wallet:

import { Connection } from "@solana/web3.js";
import {
  buildCreateVaultTransaction,
  buildDepositVaultTransaction,
} from "torchsdk";

const connection = new Connection(process.env.SOLANA_RPC_URL);

// Create vault const { transaction: createTx } = await buildCreateVaultTransaction(connection, { creator: authorityPubkey, }); // sign and submit with authority wallet...

// Fund vault with SOL for liquidations const { transaction: depositTx } = await buildDepositVaultTransaction(connection, { depositor: authorityPubkey, vault_creator: authorityPubkey, amount_sol: 5_000_000_000, // 5 SOL }); // sign and submit with authority wallet...

3. Run the Bot

VAULT_CREATOR= SOLANA_RPC_URL= npx torch-liquidation-bot

On first run, the bot prints the agent keypair and instructions to link it. Link it from your authority wallet, then restart.

4. Configuration

| Variable | Required | Default | Description | |----------|----------|---------|-------------| | SOLANA_RPC_URL | Yes | -- | Solana RPC endpoint (HTTPS). Fallback: RPC_URL | | VAULT_CREATOR | Yes | -- | Vault creator pubkey | | SOLANA_PRIVATE_KEY | No | -- | Disposable controller keypair (base58 or JSON byte array). If omitted, generates fresh keypair on startup (recommended) | | SCAN_INTERVAL_MS | No | 30000 | Milliseconds between scan cycles (min 5000) | | SCAN_LIMIT | No | 50 | Max tokens scanned per cycle (0 = unlimited) | | MIN_AGENT_BALANCE_SOL | No | 0.01 | Pause liquidations when agent gas balance drops below this | | LOG_LEVEL | No | info | debug, info, warn, error | | LOG_FORMAT | No | text | text (human-readable) or json (structured, one record per line) |

View on ClawHub
TERMINAL
clawhub install torchliquidationbot

πŸ§ͺ Use this skill with your agent

Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

πŸ” Can't find the right skill?

Search 60,000+ AI agent skills β€” free, no login needed.

Search Skills β†’