Skip to content

hood-stock-lp: range-LP Robinhood Chain tokenized equities (Uniswap v3+v4) - #670

Open
igoryuzo wants to merge 1 commit into
mainfrom
add/hood-stock-lp
Open

hood-stock-lp: range-LP Robinhood Chain tokenized equities (Uniswap v3+v4)#670
igoryuzo wants to merge 1 commit into
mainfrom
add/hood-stock-lp

Conversation

@igoryuzo

Copy link
Copy Markdown
Collaborator

New skill: the Robinhood Chain sibling of aero-stock-lp. Range-LP Robinhood's tokenized equities (TSLA, SPCX, SPY, GOOGL, AAPL, NVDA, MSFT, GME, CRCL, USO, NFLX, INTC) against USDG on Uniswap v3 and v4 pools for trading-fee yield.

Shape

Same architecture as aero-stock-lp: SKILL.md doctrine + zero-dep node scripts (entry plan/size/settle, manage, exit begin/finish, selftest) that do all chain reads, gates, and calldata, and emit unsigned {to, data, value, chainId: 4663} objects for the Bankr arbitrary-transaction flow, one tx at a time.

Uniswap has no gauges — fees are the whole game, so the entire staked/unstaked route logic from the Aerodrome skill does not exist here.

Validation

  • Byte-for-byte encoding: the v4 calldata builders (UniversalRouter swap including the fork's extra minHopPriceX36 struct field, POSM modifyLiquidities with the fork's TAKE_PAIR=0x11) reproduce the Midpoint engine's viem output exactly; ground-truth vectors are embedded in selftest.mjs.
  • selftest.mjs --live: 104/104 across all 12 markets — v3 token0/token1/fee reads prove every usdgIs0 orientation flag, $1 quoter round-trips prove each v4 poolKey↔poolId mapping, all token decimals verified.
  • Execution-grade sims: the emitted exit calldata (v3 NPM multicall decrease+collect+burn; v4 burn+TAKE_PAIR) was simulated via eth_call from real position owners on both venues — accepted by the deployed forks.
  • Manage pass exercised against real third-party positions (TSLA v4, GME v3): discovery, valuation, and fee-growth math all coherent.

Doctrine carried over, plus Robinhood-specific rules

  • Per-market circuit breakers (a 5% brake fits GME; SPCX swings 9–16% day-over-day — one size does not fit all)
  • Orientation-aware math: USDG sorts as token0 in half the pools, which inverts the price↔tick map and swaps band ends
  • Delta swaps in both directions — recenters absorb loose stock (exit finish --keep-stock) instead of round-tripping it
  • v4 mints sized across a padded price interval (the MaximumAmountExceeded lesson)
  • v4 discovery via POSM Transfer logs (POSM is not enumerable); a failed scan is flagged, never read as an empty book
  • Fail-closed gates: fresh real quote required, NAV 3%, unseeded guard, TVL/volume/pool-age, ≤25% of TVL, funds check, honest vol input

🤖 Generated with Claude Code

… v3+v4

Sibling of aero-stock-lp for Robinhood Chain (4663): 12 USDG equity
markets (6 v3, 6 v4), zero-dep node scripts emitting unsigned txs for
the Bankr arbitrary-transaction flow.

- v4 encoders (UR swap incl. the fork's minHopPriceX36 field, POSM
  modifyLiquidities with TAKE_PAIR=0x11) validated byte-for-byte
  against the Midpoint engine's viem output; vectors embedded in
  selftest.mjs
- selftest --live: 104/104 across all 12 markets (token0/token1/fee
  prove usdgIs0 orientation; $1 quoter round-trips prove each v4
  poolKey<->poolId mapping)
- exits are one atomic tx per venue (v3 NPM multicall
  decrease+collect+burn; v4 burn+TAKE_PAIR) — both simulated OK via
  eth_call from real position owners
- per-market circuit breakers, funds gate, delta swaps both directions
  (recenters absorb loose stock via exit finish --keep-stock), v4
  discovery via POSM Transfer logs with failure flagged never silent

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant