Kedia
Closed

Kedia is closed. The agent no longer trades and the dashboard is offline.

An AI trader that can't break your rules.

Kedia was an autonomous trading agent for HSKSwap on HSK Chain. Letting an AI trade usually means handing it your wallet key and hoping a prompt keeps it in line. Kedia kept your money in your own vault and let the agent trade it only inside limits the smart contract enforced on every trade.

The Kedia dashboard: equity, stop-loss headroom, value over time, positions and the agent's reasoning per token
The dashboard while Kedia ran on HSK Chain testnet with test funds.
The problem

Trading agents need your key, and a prompt is not a rule.

Problem

Trading bots and AI agents need your wallet key. A key can do anything, and “stop at 5% loss” in a prompt is a suggestion, not a rule.

Kedia's answer

A vault per user that held the funds and enforced trade size, daily stop-loss, token allowlist, price sanity and oracle freshness in Solidity. The agent's key could only call executeSwap.

  1. 01

    Your vault

    Your money sat in a contract only your wallet owned. Only you could deposit, withdraw or pause.

  2. 02

    Your rules, on-chain

    Max trade size, a daily stop-loss, allowed tokens and a price check. A trade that broke one was reverted, not filled.

  3. 03

    Its own agent

    A dedicated agent wallet traded for you on HSKSwap. It could never withdraw, and you steered it in plain English.

How it worked

Trade the gap between HSKSwap and the exchange.

The default strategy was mean-reversion on the gap between HSKSwap and the HashKey Exchange order book, with a 0.6% edge after fees and price impact. A momentum strategy, a fast and slow moving average of the exchange price, was the alternative.

  1. 01

    Read the market

    Every 30 seconds the agent read the HashKey Exchange order book, an HSKSwap quote for the exact trade size, and the on-chain oracle price.

  2. 02

    Find a gap

    It bought when HSKSwap priced a token below the exchange and sold when above, only when the gap beat fees and price impact.

  3. 03

    Ask the vault

    The agent wallet could call one function: executeSwap on its own vault. Trades the vault would refuse were simulated first and cost no gas.

  4. 04

    Check after the fill

    The price band and stop-loss ran on the real fill, inside the same transaction. A bad fill was undone, not just discouraged.

The seven checks the vault ran on every executeSwap, and the revert each one raised
The seven checks the vault ran on every trade, in order, and the revert each one raised.
The guardrails

Six limits the vault enforced on-chain.

RuleDefault
Max trade sizeA runaway or mistaken order$10
Daily loss capLosing more than you accepted in one day5% of the day's start
Allowed tokensTrading anything you did not approveUSDT, WHSK, WETH
CooldownRapid-fire trading, if you turned it onOff
Oracle freshnessTrading on a dead price feed26 hours
Price bandBad fills from thin or manipulated pools5%
Control

Steer it in plain English.

You typed “halve my risk and stop trading WETH”. The chat model read your vault, proposed new rules, and showed a before and after table.

One signature applied every change in a single transaction. The model never held a key, and nothing changed without your click or signature.

A chat proposal in Kedia: a before and after table of vault rules with a Sign and apply button
A rule change proposed in chat, waiting for the owner's signature.
Proof

A real trade the vault refused.

A failed executeSwap on the HSK testnet explorer, reverted by the vault with TradeTooLarge
A chat request to buy $29.96 of WETH, reverted on-chain with TradeTooLarge because the vault's max trade was $10. Open the transaction.
Why it was different

Autonomy without handing over the keys.

  • Rules were contract code, not prompt text. A prompt injection, a model mistake or a strategy bug could not exceed your max trade, trade a token you blocked, or pass your daily loss cap. The transaction reverted.

  • The agent never held your funds. Each vault had its own agent wallet holding only HSK for gas. It could not withdraw, change rules, or touch anyone else's vault.

  • Autonomy and control at the same time. You set the rules once and the agent traded around the clock. You changed them by chat and one signature, and the agent could not undo them.

  • The last two checks ran after the swap. A manipulated pool or a bad fill was undone inside the same transaction.

  • Every guardrail had a fork test against real pools. One test dumps a million WHSK into the live WHSK/USDT pool and shows the vault undoing the trade.

Built with

The stack.

Chain
HSK Chain, HSKSwap (Uniswap V3) router and quoter
Prices
Supra on-chain oracle, HashKey Exchange order book
Contracts
Solidity, Foundry, OpenZeppelin
Agent
Node 24 and viem, one agent wallet per vault
Chat
Claude Sonnet 5.5 with tool calls; the model never held a key
Dashboard
Next.js 16, React 19, wagmi, Tailwind CSS

Contract addresses, tests and setup steps are in the README on GitHub.