kashdao-protocol-sdk is the direct-to-chain Python SDK for
Kash. Same trust model, same on-chain protocol, same encoding bytes
as the TypeScript @kashdao/protocol-sdk
— a position opened via either SDK can be closed via the other.
If you want a Python integration with Kash, this is the package.
Hummingbot strategies, Python market makers, AI agents written in
Python, Jupyter / data-science workflows — all sit on this SDK.
Trust model — zero custody, zero Kash dependency
The package never holds keys, never signs UserOps or transactions, never sponsors gas, and never reaches Kash-hosted infrastructure. You bring:- your own RPC URL,
- your own private key OR signer abstraction (
eth_account.Account, web3signer over RPC, hardware wallet, Fireblocks, AWS-KMS — anything exposing theEoaSignerAdapterProtocol), - (SA mode only) ERC-4337 v0.7 bundler URL.
Two trading modes — pick one
Same modes, same factory shapes as the TS SDK:
EOA mode is the recommended Hummingbot integration path — it’s
what
examples/hummingbot/amm_arb_kash_uniswap.py demonstrates.
Supported chains
Install
Differences vs the TypeScript SDK
The packages are byte-equal at the encoding level (see Cross-language parity), but the Python ergonomics naturally differ:
Same protocol, same trust model, same trade lifecycle, same error
hierarchy. Just Pythonic ergonomics on the surface.
Public surface (~210 exports)
- Factories:
create_eoa_client,create_smart_account_client - Trade lifecycle:
client.trades.{build_*, prepare_*, simulate, hash_of, submit, send.*} - Market reads:
client.markets.{get, state, quote, watch} - Account reads:
client.account.{usdc_balance, position, gas_balance, usdc_allowance}(pluscompute_address,is_deployedin smart-account mode only) - Signers:
LocalEoaSigner,JsonRpcEoaSigner(EOA);LocalSigner,JsonRpcSigner(SA) - Bundlers (SA):
create_generic_bundler_clientplus presets for Pimlico / Alchemy / Flashbots - Unit conversion:
usdc,tokens,format_usdc,format_tokens,MAX_UINT256 - Fee estimation:
estimate_chain_feeswithEstimateFeesOptions - Custom-chain support:
CustomChain,resolve_custom_chain - Error hierarchy:
KashProtocolErrorand 6 subclasses
Where to next
Quickstart — EOA mode
Vanilla EIP-1559 from a plain wallet. Canonical Hummingbot path.
Quickstart — Smart-account mode
ERC-4337 v0.7 with a bundler.
Hummingbot integration
Full strategy walkthrough.
TypeScript SDK
Same protocol, TypeScript instead of Python.