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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cfxdevkit/executor

v1.0.16

Published

Conflux DevKit – on-chain strategy execution engine (limit orders, DCA, and more)

Readme

@cfxdevkit/executor

On-chain strategy execution engine for Conflux DevKit — the runtime primitives for building keepers, bots, or AI agents that execute limit orders, DCA, TWAP, and spot swaps on Conflux eSpace.

Features

  • Executor — Orchestrator that evaluates jobs on a tick interval, checks price conditions, enforces safety limits, and submits on-chain transactions.
  • KeeperClientImpl — viem-based client that wraps the AutomationManager contract for job creation, cancellation, and forceful execution.
  • SafetyGuard — Circuit-breaker with configurable per-tick swap caps, per-job retry caps, and a global circuit-breaker on consecutive failures.
  • RetryQueue — Exponential backoff with jitter for failed job retries.
  • PriceChecker — Pluggable price source interface + condition evaluator (gte/lte against a target price).
  • Full type systemJob union type with per-strategy params (LimitOrderJob, DCAJob, TWAPJob, SwapJob) and lifecycle statuses.
  • Zero framework coupling — Injectable AutomationLogger interface; no React, no HTTP framework required.

Supported strategies

| Strategy | Status | |---|---| | Limit order | ✅ Implemented | | DCA (Dollar-Cost Averaging) | ✅ Implemented | | TWAP | 🔜 Types only (contract support pending) | | Spot swap | 🔜 Types only (contract support pending) |

Installation

pnpm add @cfxdevkit/executor
# or
npm install @cfxdevkit/executor

Peer dependencies

{
  "viem": ">=2.0.0"
}

Usage

Basic keeper setup

import { Executor, KeeperClientImpl, SafetyGuard, PriceChecker, noopLogger } from '@cfxdevkit/executor';
import { createWalletClient, http } from 'viem';
import { confluxESpace } from 'viem/chains';
import { privateKeyToAccount } from 'viem/accounts';

const account = privateKeyToAccount('0x...');
const walletClient = createWalletClient({ account, chain: confluxESpace, transport: http() });

const keeperClient = new KeeperClientImpl({
  walletClient,
  automationManagerAddress: '0x...',
});

const safetyGuard = new SafetyGuard({
  maxSwapsPerTick: 3,
  maxConsecutiveFailures: 5,
  maxRetriesPerJob: 4,
});

const priceChecker = new PriceChecker({
  priceSource: myPriceSource,   // implement PriceSource interface
  decimalsResolver: myResolver, // implement DecimalsResolver interface
});

const executor = new Executor({
  keeperClient,
  safetyGuard,
  priceChecker,
  jobStore: myJobStore,         // implement JobStore interface
  logger: noopLogger,           // or inject your own AutomationLogger
  tickIntervalMs: 15_000,       // evaluate jobs every 15 s
});

executor.start();

Creating a limit order job

import type { LimitOrderStrategy } from '@cfxdevkit/executor';

const strategy: LimitOrderStrategy = {
  kind: 'limit_order',
  tokenIn: '0xCFX...',
  tokenOut: '0xUSDT...',
  amountIn: '100.0',       // human-readable
  targetPrice: '0.38',     // trigger when price >= target
  direction: 'gte',
  slippageBps: 50,         // 0.5%
  expiresInDays: 7,
};

await executor.createJob(strategy, ownerAddress);

Creating a DCA job

import type { DCAStrategy } from '@cfxdevkit/executor';

const strategy: DCAStrategy = {
  kind: 'dca',
  tokenIn: '0xUSDT...',
  tokenOut: '0xCFX...',
  amountPerSwap: '50.0',   // human-readable, per interval
  intervalHours: 24,
  totalSwaps: 30,
  slippageBps: 100,        // 1%
};

await executor.createJob(strategy, ownerAddress);

Job lifecycle

pending → active → executed
                 ↘ failed (exhausted retries)
       → cancelled (user-cancelled)
       → paused    (SafetyGuard circuit-breaker)

Conflux Compatibility

| Network | Chain ID | Support | |---|---|---| | Conflux eSpace Mainnet | 1030 | ✅ | | Conflux eSpace Testnet | 71 | ✅ |