Skip to Content

@cfxdevkit/executor


@cfxdevkit/executor / KeeperClient

Interface: KeeperClient

Defined in: packages/executor/src/executor.ts:8

@cfxdevkit/executor

On-chain strategy execution engine for Conflux DevKit.

Provides the runtime primitives needed to build keepers, bots, or AI agents that execute on-chain strategies (limit orders, DCA, TWAP, spot swaps).

Key exports:

  • Job types (LimitOrderJob, DCAJob, TWAPJob, SwapJob) + params
  • Strategy types (LimitOrderStrategy, DCAStrategy, TWAPStrategy, SwapStrategy)
  • SafetyGuard — circuit-breaker / swap-cap / retry-cap
  • RetryQueue — exponential backoff with jitter
  • PriceChecker — pluggable price source + condition evaluation
  • KeeperClient interface + KeeperClientImpl (viem / AutomationManager)
  • Executor — orchestrator that ties all of the above together
  • AutomationLogger — injectable logger interface (no runtime dep)

Methods

executeDCATick()

executeDCATick(jobId, owner, params): Promise<{ amountOut?: string | null; nextExecutionSec: number; txHash: string; }>

Defined in: packages/executor/src/executor.ts:15

Parameters

jobId

string

owner

string

params

DCAParams

Returns

Promise<{ amountOut?: string | null; nextExecutionSec: number; txHash: string; }>


executeLimitOrder()

executeLimitOrder(jobId, owner, params): Promise<{ amountOut?: string | null; txHash: string; }>

Defined in: packages/executor/src/executor.ts:9

Parameters

jobId

string

owner

string

params

LimitOrderParams

Returns

Promise<{ amountOut?: string | null; txHash: string; }>


getOnChainStatus()

getOnChainStatus(jobId): Promise<"active" | "executed" | "cancelled" | "expired">

Defined in: packages/executor/src/executor.ts:26

Read the terminal status of a job from the contract.

Parameters

jobId

`0x${string}`

Returns

Promise<"active" | "executed" | "cancelled" | "expired">