mr brightside

Torch Liquidation Bot

AI 智能体v10.7.1
作者:mr brightside更新于 2026-05-11共 32 个版本 · 最新版本发布于 2026-04-20torchliquidationbot@clawhub_mrsirg97-rgb/torchliquidationbot
任务自动化工具调用#Sdk

据 AlphaMoat 统计,截至 2026-09,Torch Liquidation Bot 累计下载 3,866 次、获 1 个星标,在全部 5,078 个 AI 技能中排名第 2,693 位,在「AI 智能体」分类(969 个)中排名第 532 位。

累计安装
152
累计下载
3,866
星标
1
全站排名
#2,693
全站前 54% · 「AI 智能体」前 55%
平台累计安装累计下载星标评论
ClawHub ↗1213,6151-
SkillHub ↗1523,8661—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

这是会签名并提交链上交易的自动化 keeper,不是只读扫描器;持续扫描符合条件的借贷仓位,并将清算所得导入 vault。技能明确要求由用户显式启动。配置和运行涉及真实资金与链上操作,应先审阅交易逻辑、RPC 与 vault 权限,并使用新建且可撤销的专用控制密钥;绝不可索取或记录私钥/助记词。 需要 Node/npm、经审核固定的来源、SOLANA_RPC_URL 和 VAULT_CREATOR。私钥输入可选,运行时能生成临时控制器;人工创建、注资并关联 vault,绝不使用其 authority key。限制 gas 敞口,监控 RPC/提交失败,停用时撤销控制器。代币查询还获取外部价格及创建者控制的元数据,vault 控制不保证无损收益。

资料发布于 2026-10-27

可以用来做什么

  • 检查 Torch Market 借贷仓位是否满足清算条件
  • 在用户主动启动并完成安全配置后执行 vault 清算流程
  • 审阅控制器与 vault 的权限边界和撤销方式

什么时候用

  • 经过人工审阅并明确决定运行该清算 keeper 时
  • 已确认 RPC、vault 和专用可撤销控制器配置时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

请只解释这份 bot 的清算流程、交易权限和密钥风险,不要启动它、构造交易或要求任何私钥。

月度数据趋势

累计下载3,866
2,4633,2173,9702026-03 · 累计下载 2,5672026-05 · 累计下载 3,1082026-06 · 累计下载 3,2152026-07 · 累计下载 3,4502026-08 · 累计下载 3,5312026-09 · 累计下载 3,86626-0326-09
星标1
0122026-03 · 星标 12026-05 · 星标 12026-06 · 星标 12026-07 · 星标 12026-08 · 星标 12026-09 · 星标 126-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-093,866—1
2026-083,531+2.3%1
2026-073,450+7.3%1
2026-063,215+3.4%1
2026-053,108—1
2026-032,567—1

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

13 KB · ClawHub v10.7.1
---
name: torch-liquidation-bot
version: "10.7.1"
description: Autonomous vault-based liquidation keeper for Torch Market lending on Solana. Scans all migrated tokens for underwater loan positions using the SDK's bulk loan scanner (getAllLoanPositions), builds and executes liquidation transactions through a Torch Vault, and collects a 10% collateral bonus.
license: MIT
disable-model-invocation: true
requires:
  env:
    - name: SOLANA_RPC_URL
      required: true
展开全部(共 330 行)
    - name: VAULT_CREATOR
      required: true
    - name: SOLANA_PRIVATE_KEY
      required: false
    - name: SCAN_INTERVAL_MS
      required: false
    - name: SCAN_LIMIT
      required: false
    - name: MIN_AGENT_BALANCE_SOL
      required: false
    - name: LOG_LEVEL
      required: false
    - name: LOG_FORMAT
      required: false
metadata:
  clawdbot:
    requires:
      env:
        - name: SOLANA_RPC_URL
          required: true
        - name: VAULT_CREATOR
          required: true
        - name: SOLANA_PRIVATE_KEY
          required: false
        - name: SCAN_INTERVAL_MS
          required: false
        - name: SCAN_LIMIT
          required: false
        - name: MIN_AGENT_BALANCE_SOL
          required: false
        - name: LOG_LEVEL
          required: false
        - name: LOG_FORMAT
          required: false
    primaryEnv: SOLANA_RPC_URL
  openclaw:
    requires:
      env:
        - name: SOLANA_RPC_URL
          required: true
        - name: VAULT_CREATOR
          required: true
        - name: SOLANA_PRIVATE_KEY
          required: false
        - name: SCAN_INTERVAL_MS
          required: false
        - name: SCAN_LIMIT
          required: false
        - name: MIN_AGENT_BALANCE_SOL
          required: false
        - name: LOG_LEVEL
          required: false
        - name: LOG_FORMAT
          required: false
    primaryEnv: SOLANA_RPC_URL
    install:
      - id: npm-torch-liquidation-bot
        kind: npm
        package: torch-liquidation-bot@^10.7.1
        flags: []
        label: "Install Torch Liquidation Bot (npm, optional -- SDK is bundled in lib/torchsdk/ and bot source is bundled under lib/kit on clawhub)"
  author: torch-market
  version: "10.7.1"
  clawhub: https://clawhub.ai/mrsirg97-rgb/torch-liquidation-bot
  kit-source: https://github.com/mrsirg97-rgb/torch-liquidation-kit
  sdk-source: https://github.com/mrsirg97-rgb/torchsdk
  website: https://torch.market
  program-id: 8hbUkonssSEEtkqzwM7ZcZrD9evacM92TcWSooVF4BeT
  keywords:
    - solana
    - defi
    - liquidation
    - liquidation-bot
    - liquidation-keeper
    - collateral-lending
    - vault-custody
    - ai-agents
    - agent-wallet
    - agent-safety
    - treasury-lending
    - bonding-curve
    - fair-launch
    - token-2022
    - raydium
    - community-treasury
    - protocol-rewards
    - solana-agent-kit
    - escrow
    - anchor
    - pda
    - on-chain
    - autonomous-agent
    - keeper-bot
    - torch-market
    - versioned-transactions
    - address-lookup-tables
  categories:
    - solana-protocols
    - defi-primitives
    - lending-markets
    - agent-infrastructure
    - custody-solutions
    - liquidation-keepers
compatibility: >-
  REQUIRED: SOLANA_RPC_URL (HTTPS Solana RPC endpoint).
  REQUIRED: VAULT_CREATOR (vault creator pubkey).
  OPTIONAL: SOLANA_PRIVATE_KEY (disposable controller keypair -- fresh key, ~0.01 SOL for gas, NEVER a vault authority key).
  Without SOLANA_PRIVATE_KEY, the bot generates a fresh disposable keypair in-process (recommended).
  All liquidation proceeds route to the vault. The vault can be created and funded entirely by the human principal.
  This skill sets disable-model-invocation: true -- it must not be invoked autonomously without explicit user initiation.
  SDK bundled in lib/torchsdk/. No API server dependency.
---

# Torch Liquidation Bot

Autonomous vault-based liquidation keeper for Torch Market lending on Solana.

Every migrated token on Torch has a built-in lending market. Holders lock tokens as collateral and borrow SOL from the community treasury (depth-adaptive LTV 25-50%, 2% weekly interest). When a loan's LTV crosses 65%, it becomes liquidatable. Anyone can liquidate it and collect a **10% bonus** on the collateral value.

This bot scans every migrated token's lending market using the SDK's bulk loan scanner (`getAllLoanPositions`) -- one RPC call per token returns all active positions pre-sorted by health. When it finds one that's underwater, it liquidates it through your vault.

**This is not a read-only scanner.** This is a fully operational keeper that generates its own keypair, verifies vault linkage, and executes liquidation transactions autonomously in a continuous loop.

## How It Works

```
┌──────────────────────────────────────────────────────────┐
│                  LIQUIDATION LOOP                        │
│                                                          │
│  1. Discover migrated tokens (getTokens)                 │
│  2. For each token, scan all loans (getAllLoanPositions)  │
│     -- single RPC call, positions sorted by health       │
│     -- liquidatable -> at_risk -> healthy                │
│  3. Skip tokens with no active loans                     │
│  4. For each liquidatable position:                      │
│     -> buildLiquidateTransaction(vault=creator)          │
│     -> sign with agent keypair                           │
│     -> submit and confirm                                │
│     -> break when health != 'liquidatable' (pre-sorted)  │
│  5. Sleep SCAN_INTERVAL_MS, repeat                       │
│                                                          │
│  All SOL comes from vault. All collateral goes to vault. │
│  Agent wallet holds nothing. Vault is the boundary.      │
└──────────────────────────────────────────────────────────┘
```

### The Agent Keypair

The bot generates a fresh `Keypair` in-process on every startup. No private key file. No environment variable (unless you want to provide one). The keypair is disposable -- it signs transactions but holds nothing of value.

On first run, the bot checks if this keypair is linked to your vault. If not, it prints the exact SDK call you need to link it. Link it from your authority wallet, then restart.

### The Vault

```
Human (authority)                   Agent (controller, ~0.01 SOL gas)
  ├── createVault()                  ├── liquidate(vault) -> SOL from vault
  ├── depositVault(SOL)              └── collateral tokens -> vault ATA
  ├── linkWallet(agent)
  ├── withdrawVault()  <- auth only
  ├── withdrawTokens() <- auth only
  └── unlinkWallet()   <- instant
```

| Guarantee | Mechanism |
|-----------|-----------|
| Full custody | Vault holds all SOL and tokens. Controller holds nothing. |
| Closed loop | SOL from vault pays debt, collateral tokens to vault. No leakage. |
| Authority separation | Creator (immutable) / Authority (transferable) / Controller (disposable) |
| Instant revocation | Authority unlinks controller in one tx |
| No extraction | Controllers cannot withdraw. Period. |

## Getting Started

### 1. Install

```bash
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:

```typescript
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

```bash
VAULT_CREATOR=<your-vault-creator-pubkey> SOLANA_RPC_URL=<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) |

## SDK Functions Used

| Function | Returns |
|----------|---------|
| `getTokens(connection, params?)` | Token list (filterable, sortable) |
| `getToken(connection, mint)` | Full detail: price, treasury, status |
| `getLendingInfo(connection, mint)` | Lending parameters and pool state |
| `getAllLoanPositions(connection, mint)` | All loans sorted by liquidation risk |
| `getLoanPosition(connection, mint, wallet)` | Loan: collateral, debt, LTV, health |
| `getVault(connection, creator)` | Vault state |
| `getVaultForWallet(connection, wallet)` | Reverse vault lookup |
| `buildLiquidateTransaction(connection, params)` | VersionedTransaction (sign with `[keypair]`) |
| `confirmTransaction(connection, sig, wallet)` | On-chain confirmation via RPC |

### Scan and Liquidate Pattern

```typescript
import { getTokens, getAllLoanPositions, buildLiquidateTransaction } from 'torchsdk'

const { tokens } = await getTokens(connection, { status: 'migrated', sort: 'volume', limit: 50 })

for (const token of tokens) {
  const { positions } = await getAllLoanPositions(connection, token.mint)

  for (const pos of positions) {
    if (pos.health !== 'liquidatable') break  // pre-sorted, done

    const { transaction, message } = await buildLiquidateTransaction(connection, {
      mint: token.mint,
      liquidator: agentPubkey,
      borrower: pos.borrower,
      vault: vaultCreator,
    })
    transaction.sign([agentKeypair])
    await connection.sendRawTransaction(transaction.serialize())
  }
}
```

## Constants

```
MAX_LTV         25-50% (depth-adaptive: 25% <50 SOL, 35% 50-200, 45% 200-500, 50% 500+)
LIQ_THRESHOLD   65%
INTEREST        2% per epoch (~7 days)
LIQ_BONUS       10%
UTIL_CAP        80%
MIN_BORROW      0.1 SOL
MIN_POOL_SOL    5 SOL (below this: margin ops blocked)
PROGRAM_ID      8hbUkonssSEEtkqzwM7ZcZrD9evacM92TcWSooVF4BeT
```

## Key Safety

If `SOLANA_PRIVATE_KEY` is provided: must be a fresh disposable keypair (~0.01 SOL gas). All capital lives in vault. If compromised: attacker gets dust, authority revokes in one tx. Key never leaves the runtime.

If not provided: the bot generates a fresh keypair on startup (recommended).

**Rules:**
1. Never ask for a private key or seed phrase.
2. Never log, print, store, or transmit key material.
3. Use a secure HTTPS RPC endpoint.

### External Runtime Dependencies

| Service | Purpose | When Called |
|---------|---------|------------|
| **CoinGecko** (`api.coingecko.com`) | SOL/USD price for display | Token queries via `getTokens()` |
| Creator-controlled metadata URI (typically `arweave.net`) | Token metadata JSON | `getTokens()` / `getToken()` — 10s fetch timeout, failure is non-fatal |

No credentials sent. All requests are read-only GET. No private key material is ever transmitted.

## Testing

Requires [Surfpool](https://github.com/nicholasgasior/surfpool) running a mainnet fork:

```bash
surfpool start --network mainnet --no-tui
pnpm test
```

## Links

- Liquidation Kit (source): [github.com/mrsirg97-rgb/torch-liquidation-kit](https://github.com/mrsirg97-rgb/torch-liquidation-kit)
- Liquidation Bot (npm): [npmjs.com/package/torch-liquidation-bot](https://www.npmjs.com/package/torch-liquidation-bot)
- Torch SDK: `lib/torchsdk/` | [npm](https://www.npmjs.com/package/torchsdk) | [source](https://github.com/mrsirg97-rgb/torchsdk)
- [torch.market](https://torch.market) | [Whitepaper](https://torch.market/whitepaper) | [Risk Model](https://torch.market/risk.md)
- Program: `8hbUkonssSEEtkqzwM7ZcZrD9evacM92TcWSooVF4BeT`

「AI 智能体」分类下的热门技能

mr brightside 的其他技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。