Skip to content
Meme Traded Fund

Protocol

How MEME500 works

The ape and redeem flows step by step, why a Uniswap v4 hook is used, and the in-kind fallback on redeem.

All docs as text

MEME500 lives in a Uniswap v4 pool where currency0 is native ETH and currency1 is the MEME500 token. The pool has a hook, the IndexHook, that replaces normal AMM pricing: it does not hold a curve of liquidity. Instead it buys or sells the underlying memes for every swap. Users interact through the MTFRouter with two functions: ape and redeem.

Ape: ETH into MEME500#

YouMTFRouterPoolManagerIndexHook5 meme poolsVaultape(key, minOut) + ETHswap ETH → MEME500beforeSwapbuy PEPE SHIB SPX MOG NEIRO (3% guard)memes → vaultmint MEME500 ∝ holdings growthMEME500 (≥ minOut)

Sequence of one ape transaction.

Text version
  • 1. The user calls MTFRouter.ape(key, minOut, recipient) and sends ETH.
  • 2. The router opens a swap on the Uniswap v4 PoolManager (exact input, ETH to MEME500).
  • 3. The PoolManager calls the IndexHook before the swap. The hook takes the 0.30% fee and splits the remaining ETH across the five memes in proportion to what the vault holds.
  • 4. The hook buys PEPE, SHIB, SPX6900, MOG and NEIRO on their own V2 style ETH pools (Uniswap V2 and ShibaSwap). Every leg is checked against a 3% price impact guard.
  • 5. The bought tokens go into the index vault, which tracks holdings in storage.
  • 6. The hook mints MEME500 in proportion to the increase in holdings and the swap settles. The router checks minOut and sends MEME500 to the recipient.
  1. 1You call MTFRouter.ape(key, minOut, recipient) with ETH. key is the MEME500 pool key; the app reads it from IndexHook.poolKeyOf(MEME500).
  2. 2The router starts an exact input swap of ETH for MEME500 on the v4 PoolManager. Exact output swaps revert.
  3. 3The IndexHook takes the 0.30% ape fee in ETH and splits the rest across the five memes in proportion to current holdings, so a deposit never changes the basket's mix.
  4. 4Each meme is bought on its own V2 style ETH pool. If any leg would move that pool's price by more than 3%, the whole transaction reverts.
  5. 5The bought tokens are added to the vault and MEME500 is minted to you. The amount is defined on Pricing and NAV.
  6. 6The router reverts if you would receive less than minOut. The app sets minOut from IndexHook.estimateApe minus your slippage setting.

Redeem: MEME500 back to ETH#

MEME500redeem(indexIn)IndexHookfee in shares, burnsell PEPEsell SHIBsell SPXsell MOGin kind if it failssell NEIROETH to you≥ minEthOut

Redeem runs the same path in reverse, with an in-kind fallback per leg.

Text version
  • 1. The user approves the router and calls MTFRouter.redeem(key, indexIn, minEthOut, recipient).
  • 2. The hook takes the 0.30% sell fee in MEME500 before redeeming, burns the rest and computes the user's share of every meme: holding × shares / supply.
  • 3. Each share is sold on its pool for ETH. If a sale fails, that meme is delivered to the user in kind instead.
  • 4. The ETH is sent to the recipient, subject to minEthOut.
  1. 1Approve the MTFRouter to spend your MEME500, then call MTFRouter.redeem(key, indexIn, minEthOut, recipient).
  2. 2The 0.30% fee is taken in MEME500 before redeeming, before anything is sold, so it cannot be avoided by forcing legs to fail. A redeem pays no ETH fee.
  3. 3The remaining shares are burned and your pro rata share of every meme is computed: holding_i × shares / supply.
  4. 4Each share is sold for ETH on its pool. The total ETH is sent to you if it is at least minEthOut.

In-kind fallback#

Redeems are designed to always work. If the sale of one meme fails (for example because its pool is temporarily unusable), the redeem does not revert: that meme is sent to you in kind as the token itself, and the other legs are still sold for ETH. If an in-kind transfer cannot be delivered, it is recorded and can be claimed later with IndexHook.claimInKind(token). Redeems cannot be paused by any admin role.

Why a Uniswap v4 hook#

  • Atomic. Buying five memes and minting the index happen in one transaction. Either everything succeeds or nothing happens.
  • One transaction, one approval. Ape needs no approval at all (you send ETH). Redeem needs one approval of MEME500.
  • No separate liquidity pool. The hook is the market maker. There are no LPs to pay and addLiquidity on the MEME500 pool reverts.
  • Price equals the basket. Because every ape buys the basket and every redeem sells it, the price you get is the value of the underlying memes after fees and pool slippage, not a separate order book.
  • Composable. Any wallet or aggregator that can route a v4 swap can reach MEME500 through the router.

What one round trip costs#

On a mainnet fork using the real pools, 1 ETH aped into MEME500 minted about 99.6 MEME500, and redeeming it returned 0.988 ETH. Across sizes from 0.1 to 10 ETH the measured round trip cost was 1.19% to 1.22%: the 0.30% fee each way plus the 0.3% V2 pool fee on each leg in each direction. 20 consecutive apes totalling 46 ETH, then full redeems: aggregate cost 1.19%, no reverts, nothing delivered in kind.

With the live limits (0.01 ETH to 5 ETH per ape, no deposit cap), a 5 ETH ape redeemed in full returned 4.94 ETH (98.8%), and ten 5 ETH apes in a row (50 ETH) all went through, and full redeems returned 49.4 ETH.

IndexApe gasRedeem gas
MEME500 (5 tokens)about 608kabout 659k
Gas measured for the final contracts.