Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@ Current stack flows assume user-owned cells are protected by locks whose signatu

Apps:

- `apps/bot`: Node order-fulfillment and rebalance bot for matching profitable orders, collecting owned orders, completing receipts and withdrawals, and rebalancing pool exposure.
- `apps/bot`: Private Node CLI adapter for the bot runtime package.
- `apps/interface`: Browser interface for CCC wallet connection, conversion previews, transaction completion, signing, sending, and confirmation.
- `apps/sampler`: Mainnet sampling utility that writes historical iCKB exchange-rate CSV output.
- `apps/supervisor`: Deterministic live testnet supervisor for bounded bot/tester stress cycles, ignored artifacts, and incident bundles.
- `apps/tester`: Node simulator that creates random conversion orders to exercise the order and conversion flows.

The Node app packages (`@ickb/bot`, `@ickb/sampler`, and `@ickb/tester`) publish their built entrypoints for distribution, but the supported reusable API surface lives in the packages below. `@ickb/interface` is a deployable browser app package and does not expose a library entrypoint.
The Node app packages (`@ickb/sampler` and `@ickb/tester`) publish their built entrypoints for distribution, while `apps/bot` runs source through its private `@ickb/bot-cli` package. `@ickb/interface` is a deployable browser app package and does not expose a library entrypoint.

Packages:

- `packages/core`: iCKB protocol primitives, cells, UDT conversion helpers, and low-level transaction builders.
- `packages/dao`: Nervos DAO cell classification, readiness, deposit, request, and withdrawal helpers.
- `packages/node-utils`: Private Node app utilities for env parsing, RPC client setup, signer locks, sleeps, and JSON logs.
- `packages/bot`: Private bot runtime, policy, observability, and transaction planning package.
- `packages/order`: UDT limit-order entities, grouping, matching, minting, melting, and deployed-script confusion mitigation.
- `packages/sdk`: Stack-level SDK that composes core, DAO, and order packages into account state, conversion planning, completion, sending, and confirmation helpers.
- `packages/testkit`: Private test helpers and fixtures for workspace tests.
Expand Down
250 changes: 84 additions & 166 deletions apps/bot/README.md

Large diffs are not rendered by default.

130 changes: 56 additions & 74 deletions apps/bot/docs/current_rebalancing_policy.md

Large diffs are not rendered by default.

35 changes: 9 additions & 26 deletions apps/bot/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@ickb/bot",
"name": "@ickb/bot-cli",
"version": "1001.0.0",
"description": "CCC-native iCKB order fulfillment and rebalance bot",
"keywords": [
Expand All @@ -18,43 +18,26 @@
"bugs": {
"url": "https://github.com/ickb/stack/issues"
},
"sideEffects": false,
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
"private": true,
"engines": {
"node": ">=22.19.0"
},
"scripts": {
"test": "vitest",
"test:ci": "vitest run",
"build": "pnpm clean && tsc -p tsconfig.build.json",
"lint": "eslint ./src",
"clean": "rm -fr dist",
"clean:deep": "rm -fr dist node_modules",
"start": "[ -n \"$BOT_CONFIG_FILE\" ] || { echo 'BOT_CONFIG_FILE not set' >&2; exit 1; }; bash -o pipefail -c 'node dist/index.js | tee \"log_$(date +%F_%H-%M-%S).json\"'",
"lint": "pnpm --workspace-root exec eslint --max-warnings=0 apps/bot/src apps/bot/test",
"start": "[ -n \"$BOT_CONFIG_FILE\" ] || { echo 'BOT_CONFIG_FILE not set' >&2; exit 1; }; bash -o pipefail -c 'node src/index.ts | tee \"log_$(date +%F_%H-%M-%S).json\"'",
"start:loop": "while true; do pnpm start; status=$?; [ \"$status\" -ne 0 ] || exit 0; [ \"$status\" -ne 2 ] || exit 2; sleep 10; done"
},
"files": [
"docs",
"dist"
],
"publishConfig": {
"access": "public",
"provenance": true
},
"devDependencies": {
"@ickb/testkit": "workspace:*",
"@types/node": "catalog:"
},
"dependencies": {
"@ckb-ccc/core": "catalog:",
"@ickb/core": "workspace:*",
"@ickb/bot": "workspace:*",
"@ickb/node-utils": "workspace:*",
"@ickb/order": "workspace:*",
"@ickb/sdk": "workspace:*",
"@ickb/utils": "workspace:*"
"@ickb/sdk": "workspace:*"
}
}
Loading
Loading