DucatOracleHook on Robinhood Chain

Uniswap v4 Hook Contract 0xfbf47e5de83e0cc2896d7e80165a59c61d90dddc on Robinhood Chain · Oracle · Verified contract

Volume (24h)
$165.83K
Value locked (TVL)
$75.12K
All-time volume
$5.54M
Pools using this hook
4
Swaps (24h)
5,667 (158 traders)
Total swaps
159,347

What it does

A Uniswap v4 hook that records a time-weighted price history for pools that name it and charges a governed swap tax on DUCAT trades in the quote currency.

How it works step by step

  • Records a cumulative-tick observation buffer for each pool, enabling TWAP reads for consumers via consult.
  • Takes a governed sell tax and buy tax on DUCAT legs of the DUCAT/QUOTE pool and listed venue pools, sent to a tax collector.
  • Applies a launch decay to the DUCAT/QUOTE pool tax that starts near a cap and halves over time until the standing rate applies.
  • Admits liquidity adds to DUCAT pools only from listed direct adders or listed LP owners' PositionManager positions.
  • Reports DUCAT transfer budget to the token contract for gated pool actions so the token can track authorized inflows and outflows.
  • Enforces the DUCAT token's launch transaction cap on swaps during the launch window.
Swap behaviour
beforeSwap writes the pre-swap tick into the observation buffer and, for exact-input buys and exact-output sells on gated pools, takes tax through the specified delta. afterSwap enforces the DUCAT launch transaction cap and, for exact-input sells and exact-output buys, takes tax through the unspecified delta. Tax applies only to gated DUCAT pools and is skipped for tax-exempt senders.
Liquidity behaviour
beforeAddLiquidity reverts unless the sender is a governor-listed direct adder or a PositionManager position whose current owner is a listed LP owner, for pools containing DUCAT. Removals are never refused. afterAddLiquidity, afterRemoveLiquidity and afterDonate call the DUCAT token's authorizePoolManagerTransfer to budget the DUCAT leg for gated pools; ungated DUCAT movements mark the pool as unlistable.
Fee behaviour
No pool fee change. The hook takes a swap tax on DUCAT legs of gated pools (the DUCAT/QUOTE pool and listed venue pools): buys pay buyTaxBps and sells pay sellTaxBps, both capped at 7%, with a launch decay on the DUCAT/QUOTE pool starting near launchCapBps and halving over launchHalfLife until launchDuration. Tax is always taken in the non-DUCAT currency and sent to the collector, with failed disposals parked for flush. Tax-exempt swapper contracts pay nothing.
Owner & admin controls
Governor (timelock) can set sell and buy tax rates up to 7% (setTaxBps), set the collector address (setCollector), add or remove tax-exempt swapper contracts (setTaxExempt), admit or refuse LP owners (setLpOwner), admit or refuse direct adders (setDirectAdder), list stock venue pools (listVenuePool, one-way), switch off the launch decay (clearLaunchDecay, cannot be raised), increase observation cardinality (permissionless), and transfer governorship via two-step propose/accept. Launch decay parameters are fixed at construction. No upgrade path and no pause function.

Enabled Uniswap v4 callbacks

afterInitialize, beforeAddLiquidity, afterAddLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, afterDonate, beforeSwapReturnDelta, afterSwapReturnDelta

afterInitialize: restricts initialization to the launcher or governor and starts the observation history and launch clock. beforeAddLiquidity: LP admission gating for DUCAT pools. beforeSwap: records the pre-swap tick into the observation buffer and takes the exact-input buy and exact-output sell tax via the specified delta. afterSwap: enforces the token's launch transaction cap on the DUCAT leg, takes the sell exact-input and buy exact-output tax via the unspecified delta, and authorizes DUCAT transfers. afterAddLiquidity, afterRemoveLiquidity, afterDonate: authorize DUCAT transfers with the token gate. RETURNS_DELTA flags are used to take tax in the swap accounting.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: The governor (timelock) can raise standing sell and buy taxes to 7% at any time, redirect all tax to a new collector, exempt arbitrary swapper contracts from tax, list new venue pools, and admit or refuse liquidity adds. Exempting a public router would tax-free every trade through it. The governor cannot change the launch decay upward or move funds held by the hook directly.

Risk to user funds: The hook holds no user pool liquidity; it takes tax in the quote currency from swaps on gated pools, which it sends to the collector or parks in its own balance for later flush. A governor can raise the tax up to 7% on affected swaps. Swaps and adds on DUCAT pools can be reverted by the launch cap or admission rules, but removals are never blocked.

Security findings

  • [medium] Governor-controlled swap tax and collector: Governor can set sell and buy tax up to 700 bps at any time, and retarget the collector, which receives all taxes taken from gated swaps.
  • [medium] Tax exemption can be abused if a public router is listed: Tax-exempt swapper list is keyed by the PoolManager sender; listing a public router would make every trade through it tax-free for everyone.
  • [low] Hook can revert swaps and adds during launch window: Swaps on gated DUCAT pools revert with LaunchTxCapExceeded if the DUCAT leg exceeds the token's maxTxAmount during its launch window, and adds to DUCAT pools revert unless admitted; a stuck token or misconfigured admission can block those actions, though exits are never refused.
  • [info] Oracle buffer growth is permissionless: Pools initialized without DUCAT are inert, and cardinality purchases are permissionless, so a seller of storage can extend the oracle buffer. No hook funds are custodied beyond transient and parked tax balances.

Contract details

Verified source
Yes (DucatOracleHook)
Compiler
solc 0.8.30+commit.73712a01
Bytecode size
21,503 bytes
Upgradeable proxy
No
Detected patterns
launchpad, moves-currency, oracle, return-delta, tax

Pools using DucatOracleHook