Longbow Protocol Overview
Non-custodial limit orders, DCA schedules, and portfolio analytics for tokenized stocks on Robinhood Chain L2, executed directly through Uniswap V2 pools.
What it does
- Limit orders — Buy/sell a stock token when its Chainlink oracle price crosses your trigger threshold.
- DCA Schedules — Accumulate assets gradually by defining recurring swaps: purchase amount, interval, and run count.
- Portfolio Tracker — Monitor shares, US dollar value, ERC-8056 share-equivalent adjustments, and cost-basis P&L.
- Premium / Discount Radar — Spot pricing gaps by comparing on-chain pool prices side-by-side with off-chain stock market feeds.
Why it's non-custodial
Unlike centralized exchanges or traditional brokerage accounts, your funds never sit in Longbow's contracts. To open an order, you merely approve the LongbowExecutor smart contract to spend the input token. The executor only pulls the funds at the exact block of execution to process the swap, instantly delivering the output token back to your wallet. You retain full control and can revoke your approval or cancel your order at any time.
executeOrder on the smart contract. The contract enforces all price constraints and slippage guards on-chain using Chainlink oracle feeds, guaranteeing that malicious keepers cannot redirect your funds.Order Lifecycle
Each order goes through the following sequence:
- 1 · Placement — The user submits an order via the dApp, which calls
placeOrderon the contract. The contract emits an event and assigns a unique ID. - 2 · Indexing — The web app mirrors the order off-chain in a database to provide rapid user queries and feed active orders to keepers.
- 3 · Polling — Keepers poll active orders and check their triggers by comparing live Chainlink oracles with the order's trigger settings.
- 4 · Execution — Once the trigger condition holds, the keeper submits a transaction calling
executeOrder. The contract pulls the tokens, swaps them on Uniswap V2, and sends output tokens back to the owner.
L2 Block Times & Performance
Longbow is optimized to run on Robinhood Chain L2. With block times of approximately **100ms** and gas costs of **fractions of a cent** (~0.0001 ETH per execution), users can place, modify, or execute complex limit/DCA strategies instantly and cheaply without worrying about network congestion.
Architecture Layout
┌─────────────┐ place/cancel ┌──────────────────┐
│ Web App │ ────────────────▶ │ LongbowExecutor │
│ (Next.js) │ │ (Solidity) │
└──────│───────┘ └────────┬─────────┘
│ mirror orders │ swapExactTokensForTokens
▼ ▼
┌─────────────┐ canExecute / ┌──────────────────┐
│ Order API │ ◀──────────────── │ Uniswap V2 │
│ (JSON/SQL) │ executeOrder │ Router02 + Pairs │
└──────▲───────┘ └──────────────────┘
│ poll ~15s ▲
┌──────┴───────┐ Chainlink feeds │
│ Keeper │ ───────────────────────────┘
│ (Node.js) │ + oraclePaused + sequencer uptime
└──────────────┘Open Source License
MIT Licensed. The Solidity contracts, Next.js web application, keeper node, and all guides/docs are fully open-source. Attribution is welcomed but not required.