TROYDocs
Overview Build Open the app
Hermes live on Elysium mainnet · HyperCore products with the upgrade · not audited
Troy Protocol · Docs

Hooks that pay the pool.

Troy is a set of Uniswap v4 hooks on Elysium. Hermes is live and pays LPs the arbitrage bots used to take. With the HyperCore upgrade, the rest read Hyperliquid's order book and send orders to it, inside limits written on-chain.

Elysium is Kinetiq's chain for the Hyperliquid ecosystem. Its HyperCore upgrade lets a contract read HyperCore's books and place orders on them. Troy builds on that: one gate every order passes through, and three hooks that use it.

Background

How Elysium reaches HyperCore

Everything Troy does rests on two pieces Kinetiq ships with the HyperCore upgrade. This is how they work, from Kinetiq's documentation.

PieceWhat it doesWhat it means for Troy
Read precompileContracts read HyperCore state: books to full depth, mark and oracle prices, balances, positions, depth and slippage aggregates.Poseidon and TWAP price every swap against the live book.
Core writerA contract binds a HyperCore account and emits order intents. A registrar signs each intent as the account's trade-only agent.Troy runs its own registrar. It signs only intents that passed Troy Gate.
Trade-only agentThe agent can place and cancel orders. It can never withdraw. Hyperliquid enforces that, not Troy.The worst a bad order can do is trade. It cannot move funds out.
Asynchronous fillsAn order fills on HyperCore about one block later. The result comes back as a callback.Nothing is atomic. Every product holds the in-flight size and settles when the result arrives.
Live · Elysium mainnet

Hermes arbitrage capture

Every token on Elysium trades in a pad's pool. Open a second pool next to it, a sister pool, and Hermes keeps the price gap between the two instead of leaving it to bots.

Prices drift between two pools of the same token. Normally an outside bot closes the gap and keeps the profit. Hermes closes it itself, inside the swap that touches the sister pool, and splits the profit. It needs no capital: Uniswap v4 settles everything at the end of the transaction, so the trade either profits or does not happen.

How it works

  1. Anyone registers a sister pool for a token: same pair, Hermes as the hook, next to the token's existing pool.
  2. Before every swap in the sister pool, Hermes closes any gap that trading in the main pool opened.
  3. After the swap, it closes the gap that swap opened.
  4. Each capture buys the token where it is cheap and sells it where it is dear. If it would not profit, it is skipped and the trader's swap goes through untouched.
  5. Gaps smaller than both pools' fees are left alone: closing them would lose money.

Open a Hermes position → Paste a token, choose an amount of HYPE, sign twice. Your position sits in your own owner-only wallet; only you can withdraw.

The split

ShareGoes to
50%LPs of the sister pool, paid in as fees over 10 minutes so a one-block position cannot take it
40%Troy
10%The trader whose swap triggered the capture

Pads it works with

PadStatus
MontraApproved. Tested on a live pool: gaps of 8–13% closed to about 1%.
AscendApproved. Tested on a live pool: gaps of 8–15% closed to about 1–1.6%.
VoltaApproved. Tested on a live pool: gaps of 8–15% closed to about 1–1.8%.
Pools without a hookAlways allowed.

Contract

0x36c08b0DFc91Ce8a0d47957bC428981F9939a0C0 on Elysium (chain 99901), Uniswap v4 PoolManager 0xE2e1…23F1. View on the explorer →

Know the risk before adding liquidity. A sister pool holds half its value in the token. If the token falls, the position falls with it, and arbitrage income will not cover a large drop. Provide liquidity only in tokens you would hold anyway. Not audited.
01 · Infrastructure

Troy Gate

One call lets any hook on Elysium place orders on HyperCore. Every order is checked against a mandate first. A breach never leaves Elysium.

The mandate

The owner of a HyperCore account writes a mandate for each operator: a hook, a vault or an agent. Every field is enforced on every order.

FieldRule
AssetsOnly the markets on the list.
Order sizeA maximum per order.
PositionA maximum per market, counting orders still in flight as if they all fill.
Daily volumeA maximum notional per UTC day.
DrawdownTrading halts when the account falls a set percentage below its high. Anyone can trigger the check. Only the owner can resume.
ExpiryThe date the mandate ends.
RevokeOne call on Elysium, or one action on HyperCore that removes the agent entirely.

What happens to an order

  1. The operator calls submitOrder(asset, isBuy, limitPx, sz, reduceOnly, tif).
  2. The gate checks the mandate: active, not expired, not halted, asset allowed, size, worst-case position, daily volume, drawdown.
  3. If any check fails the call reverts, and nothing is sent.
  4. If all pass, the gate publishes the order as an intent with Troy's builder code attached.
  5. Troy's registrar re-checks the mandate off-chain and signs. The order reaches HyperCore.
  6. The fill comes back through onCoreResult. The gate updates the position and tells the operator.
Builder fee. Fixed in the contract at a hard ceiling of 1 basis point. It can be lowered, never raised.
02 · Hook

Troy Pools

A HYPE pool that hedges itself. After every swap the hook shorts the pool's HYPE on HyperCore, so LPs keep the swap fees without carrying HYPE's price.

  1. A swap or a liquidity change moves the amount of HYPE the pool holds.
  2. The hook works out the short that matches it, counting confirmed fills and orders in flight.
  3. If the hedge is off by more than 2%, it sends a corrective order through Troy Gate.
  4. A gate refusal or error is caught and logged. A swap is never blocked by the hedge.
RuleDefault
LiquidityFull range only, so the pool's HYPE is exact.
Rehedge threshold2%
Minimum order1 HYPE
Cooldown2 s
Price band0.5% around mark, immediate-or-cancel

Backtest

On 180 days of Hyperliquid prices, a hedged position stayed close to flat before fees (−$200 on the test size) while the unhedged one swung from −$676 to +$2,767. Funding paid to shorts covered most of the rebalancing cost. This is a simulation, not a promise.

03 · Hook

Poseidon arbitrage capture

Arbitrage against Hyperliquid, captured for LPs. When Hyperliquid's price moves, the bot that re-prices the pool pays most of its profit to the pool.

Every AMM leaks the same way. Hyperliquid moves first, the pool still shows the old price, and a bot trades the gap. That profit comes out of LPs, and on most pools it is bigger than the fees they earn. Poseidon reads Hyperliquid before every swap and charges the trade that closes the gap half of whatever the gap exceeds the base fee by. The bot keeps the other half, so it always has a reason to re-price the pool. Poseidon built the walls of Troy; this hook guards the pool the same way.

Two layers

LayerWhat it readsWho pays more
Arbitrage captureHyperliquid's mark vs this pool's price (the gap).The trade that closes the gap pays half the gap beyond the base fee. The bot keeps the other half.
Storm pricingBook imbalance near mid, and how fast the mark is moving.The side trading into the storm: selling into a drop, buying into a squeeze.

How the fee is set

  1. Before each swap Poseidon reads the gap to Hyperliquid and the storm pressure.
  2. The trade that closes the gap pays base + 50% × (gap − base). Bots loop a few swaps in one transaction to close it fully.
  3. The side trading with the storm pays slope × storm pressure. When both apply, the larger one is charged, never the sum. A move the pool has not followed yet counts once, as the gap.
  4. Everything is capped at the pool's maximum fee. Everyone else pays the base fee.
  5. Gaps and storms inside the calm band count as noise. If Hyperliquid cannot be read, the base fee applies. A swap is never blocked.

Examples from the tests

MarketSeller paysBuyer pays
Calm, pool matches Hyperliquid0.30%0.30%
Hyperliquid 2% below the pool1.15%0.30%
Hyperliquid 1.5% above the pool0.30%0.90%
Sellers stacked 90 / 10, no gap0.90%0.30%
Gap below the base fee (0.25%)0.30%0.30%
Gap of 25%10.00% (cap)0.30%

Use Poseidon on your pool

  1. Any Hyperliquid-listed asset paired with USD can get a Poseidon pool. Troy lists the tokens; pool creation is open to anyone.
  2. Create the pool with Uniswap v4's dynamic fee flag and Poseidon as the hook. The default settings apply automatically.
  3. Add liquidity. Every swap in that pool, from any app or bot, runs through Poseidon.

Live before the HyperCore upgrade

  1. Until Elysium's native reads ship, a Troy bot reads Hyperliquid's public API every two seconds and posts mark, oracle and near-mid book depth to the Poseidon feed.
  2. Readings older than 30 seconds count as missing. With no data, Poseidon charges the base fee. A stopped bot can never raise fees.
  3. When the upgrade lands, the hook points at the native reads instead. Nothing else changes.

Who gets the fee

PartGoes to
Base feeLPs, all of it.
Arbitrage and storm surchargeLPs 80%, Troy 20%, paid to Troy as a Uniswap claim token so it can never block a swap. Troy's share is capped at half the surcharge in the contract.

Open the live Poseidon panel →

No orders. Poseidon only reads. Pools must be created with Uniswap v4's dynamic fee flag.
04 · Execution

Cross-venue TWAP

Big orders in small slices. Each slice fills in the Elysium pool while the pool is cheaper, and on Hyperliquid's book for the rest.

A $200k buy in a small pool can cost several percent in price impact. Hyperliquid's book is far deeper. TWAP splits the order over time and, on every slice, uses whichever market is cheaper at that moment.

One slice, step by step

  1. The user deposits the full order and sets slices, interval and a limit price.
  2. When a slice is due, anyone can run it. Troy runs a keeper.
  3. TWAP reads HyperCore's average fill price for the slice and adds taker and builder costs.
  4. It swaps in the Elysium pool, but only until the pool price reaches HyperCore's all-in price or the user's limit, whichever is better.
  5. What is left goes to HyperCore as an immediate-or-cancel order through Troy Gate, if HyperCore is within the limit.
  6. Pool fills reach the user in the same transaction. HyperCore fills arrive a block later. Anything unfilled goes back into the order.
  7. After the last slice, anything unspent is returned. The user can cancel at any time.

Example from the tests

Pool at $1.000. HyperCore at $1.001, or $1.0015 with costs. A 100-unit buy fills in the pool until the pool reaches $1.0015, then the rest goes to HyperCore at $1.001. The buyer never pays more than the cheaper market at any point.

Order settings

SettingMeaning
SideBuy the asset with USD, or sell it for USD.
AmountThe full order, deposited up front.
Slices and intervalHow many pieces, and the time between them.
Limit priceThe worst price accepted on either venue.
Where Troy earns. Every slice routed to HyperCore carries Troy's builder fee. The pool part pays only the pool's own fee.
Build

Plug a hook into Troy Gate

  1. Deploy your hook or vault on Elysium.
  2. The HyperCore account owner calls setMandate on Troy Gate with your contract as the operator.
  3. The owner approves Troy's builder fee once on HyperCore. This must be signed by the account's main wallet.
  4. Your contract calls submitOrder. Wrap it in try/catch if it runs inside a swap.
  5. Implement onCoreResult to settle fills.
try gate.submitOrder(asset, isBuy, limitPx, sz, reduceOnly, TIF_IOC) returns (uint64 nonce) {
    // 0 = the operator was just halted by the drawdown check
    if (nonce != 0) inflight[nonce] = sz;
} catch (bytes memory reason) {
    // mandate breach: nothing was sent, the swap continues
}

function onCoreResult(uint64 nonce, bool ok, bytes calldata result) external {
    require(msg.sender == address(gate));
    uint64 filled = ok ? abi.decode(result[:32], (uint64)) : 0;
    // settle: filled may be less than the order, or zero
}
Economics

Fees and $TROY

SourceFeeGoes to
Orders through Troy Gate≤ 1 bpTroy's builder account on HyperCore.
Poseidon pools20% of the surchargeTroy. The base fee and 80% of the surcharge go to LPs.
TWAP≤ 1 bpOnly on the HyperCore part, through the gate.

$TROY trades with a 3% fee on Montra. Montra keeps 0.4% and liquidity providers 0.5%; the remaining 2.1% is split at launch and fixed for good: 33% to holders in HYPE through Montra's holder rewards; 17% bought back and burned every 15 minutes; 17% into the Walls, liquidity for $TROY's own pools; 33% to the team. Every hour the Walls turn their share into full-range liquidity: 70% is locked in the main $TROY/HYPE pool on Montra by the WallsLocker contract, which has no withdraw function, so every trade moves the price less; 30% goes to the $TROY Hermes pool, where it earns from the arbitrage on $TROY's own trades. With the HyperCore upgrade, the Hermes share moves to Troy Pools; the main-pool lock stays for good. Live numbers are on the Ledger.

Read this

Risks and assumptions

Not audited. The contracts are tested, not audited. Do not use them with real funds until an audit is published.
  • The HyperCore interface is a model. Kinetiq publishes the real ABI with the upgrade. Troy keeps every call in one interface file so the switch is a single change.
  • Moving tokens to HyperCore is not documented yet. TWAP's HyperCore leg assumes a deposit and withdraw path. Until Kinetiq publishes it, the HyperCore leg is unproven.
  • Builder codes through the keeper are unconfirmed. HyperCore supports builder fees on orders. Whether an agent-signed intent can carry one is being confirmed with Kinetiq.
  • Nothing is atomic. HyperCore fills arrive a block later and can be partial or missed. Every product counts in-flight size and refunds what does not fill.
  • Hedges cost money. Troy Pools pays trading costs and funding can turn against shorts.
  • Poseidon's feed is run by Troy until the upgrade. Whoever holds the pusher key controls the signals, bounded by each pool's maximum fee. A stopped feed falls back to the base fee.
  • Arbitrage capture is a fee, not a guarantee. A gap larger than the maximum fee still leaks the excess to arbitrageurs, and a bot that trades before the feed updates sees no gap at all. Native reads after the upgrade remove most of that lag.
  • Poseidon can be early or late. It prices risk from public signals. A storm that arrives without warning still hurts LPs.
Code

Contracts and tests

ContractRoleTests
HermesHookHermes: sister-pool arbitrage capture. Live at 0x36c0…a0C0.18 passing + 3 live-pool tests
WallsLockerPermanent full-range liquidity for the main $TROY pool. No withdraw function. Live at 0x4cb7…25fb.3 fork tests passing
TroyLiquidityYour owner-only wallet for Hermes positions: open, join, withdraw. Deployed per user by the Hermes page.3 live-chain tests
TroyGateMandates, order checks, builder fee, drawdown halt, settlement.17 passing
TroyHedgeHookTroy Pools: the self-hedging HYPE pool.11 passing
PoseidonHookPoseidon: arbitrage capture against Hyperliquid plus storm pricing, open pool creation, protocol cut.34 passing
PoseidonFeedHyperliquid data on-chain until native reads ship. Stale data reads as missing.6 passing
TroyTwapCross-venue TWAP over the pool and HyperCore.11 passing

Addresses are published here when the contracts deploy with Elysium's HyperCore upgrade.