StrategyV2Base subclass and drive trades through it on every
tick. Kash never sees a private key; the strategy holds the signer.
Architectural shape
Reference strategy
The package shipsexamples/hummingbot/amm_arb_kash_uniswap.py — a working
StrategyV2Base that demonstrates the canonical SDK
integration pattern. Skeleton runs against Base Sepolia in EOA
mode; the Uniswap leg + sizing model are stubbed for you to wire to
your real venue.
examples/hummingbot/amm_arb_kash_uniswap.py
on the public mirror.
Running the strategy in Hummingbot
Resource requirements
Per active strategy:
A typical 1-second tick interval generates ~2 RPS to the chain RPC
and ~0.05 RPS of trade submits (assuming 5% of ticks find a
profitable spread). Both well under any commercial RPC’s free tier.
Latency profile
Numbers are anecdotal — they depend on your RPC, your signer
(local vs remote), and the chain’s mempool state. Use them as
order-of-magnitude estimates, not SLA targets.
Observability
Every public method accepts an optionalsignal: asyncio.Event for
cancellation. Long-running strategies should propagate Hummingbot’s
shutdown signal into every SDK call so a ctrl-c cleanly aborts
in-flight ops.
Lifecycle hooks (KashProtocolHooks) are six fire-and-forget
callbacks for telemetry / structured logging — all optional, passed
on the client config:
on_bundler_request(BundlerRequestEvent)— before every bundler JSON-RPC call (method,url)on_bundler_response(BundlerResponseEvent)— on a successful bundler response (method,url,duration_ms,status)on_bundler_error(BundlerErrorEvent)— on a bundler JSON-RPC error (method,url,duration_ms,error)on_signer_request(SignerRequestEvent)— before a signer adapter call (owner_address,kind:userop-hash/typed-data/transaction)on_signer_error(SignerErrorEvent)— on a signer adapter failureon_wait_orphaned(WaitOrphanedEvent)— asend.*call gave up waiting for inclusion (consumer aborted, or the bundler poll timed out)
safe_fire — exceptions never propagate into
the request path, and async callbacks are scheduled but never
awaited. Wire these into your existing logging stack (Hummingbot’s
structured log, OpenTelemetry, or whatever) without polluting the
trade-path code with logging side effects. Never use hooks for
control flow.
Cancellation + clean shutdown
Always close the client. Hummingbot’son_stop is the hook:
async with form does this for you in standalone scripts.
Troubleshooting
KashSimulationRevertedError(codeSIMULATION_REVERTED) — the prepared trade will revert on-chain. The decoded revert reason lives incontext["revert_reason"](andcontext["decoded_error"]) — a common cause is amax_slippage_bpstighter than the market could meet. The pre-flighteth_callcaught the revert before you paid for any signing-infra round-trips.KashSignerError(codeSTALE_SIGNED_TX) — you signed a tx and then mutated its gas/fees/nonce before submit. The submit-side staleness guard recovered the signing address from the bytes, saw a mismatch, and refused to broadcast.KashChainError(e.g. codesQUOTE_FAILED,MARKET_READ_FAILED,TX_SEND_FAILED) — a chain RPC call failed; often your RPC is down or rate-limiting. Back off and retry; the stablecodestring tells you which read/write path failed.
See also
EOA quickstart
The EOA-mode Python integration the strategy above uses.
Smart-account mode
For AA-stack Python integrations.
Cross-language parity
Same encoding bytes as the TypeScript SDK.