2:I[91610,["738","static/chunks/app/docs/keeper-guide/page-3e772e16ad1b0588.js"],"CodeBlock"] 4:I[75001,[],""] 5:I[9596,[],""] 6:I[83453,["575","static/chunks/575-5a246ccadcf411fa.js","418","static/chunks/418-f3b6d2f154485d8f.js","998","static/chunks/app/docs/layout-c4230139aed5d08b.js"],"default",1] 7:I[5520,["575","static/chunks/575-5a246ccadcf411fa.js","913","static/chunks/913-95a4bf8751887fd7.js","319","static/chunks/319-a605e396582267ab.js","114","static/chunks/114-54f34015d309a9f8.js","654","static/chunks/654-8e46d05deaba89c2.js","395","static/chunks/395-2e55d845c3f0b2f3.js","185","static/chunks/app/layout-0fe9fc7be6bfdac9.js"],"Providers"] 3:T554,import { ethers } from "ethers"; // ABI snippet for checking and executing orders const EXECUTOR_ABI = [ "function canExecute(uint256 id) external view returns (bool ok, string memory reason)", "function executeOrder(uint256 id, address[] calldata path) external returns (uint256 amountOut)", ]; async function checkAndFillOrders(executorContract, activeOrderIds) { for (const id of activeOrderIds) { try { // 1 — Check if order criteria holds on-chain (static call) const [canFill, reason] = await executorContract.canExecute(id); if (canFill) { console.log(`Order #${id} is triggerable! Executing transaction...`); // 2 — Execute on-chain (will pull tokens and swap via Uniswap V2 router) // Path should be [tokenIn, USDG] or [USDG, tokenOut] const path = getExecutionPath(id); const tx = await executorContract.executeOrder(id, path, { gasLimit: 300_000, // Safe maximum on Robinhood Chain L2 }); const receipt = await tx.wait(); console.log(`Order #${id} successfully executed in block ${receipt.blockNumber}!`); } else { console.log(`Order #${id} cannot be executed: ${reason}`); } } catch (err) { console.error(`Failed evaluation/execution for order #${id}:`, err.message); } } }0:["oSNFCr-VaZMgs1L9AoMiI",[[["",{"children":["docs",{"children":["keeper-guide",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["docs",{"children":["keeper-guide",{"children":["__PAGE__",{},[["$L1",[["$","h1",null,{"className":"mb-3 font-display text-3xl font-bold tracking-tight text-cream","children":"Keeper Node Guide"}],["$","p",null,{"className":"mb-8 text-base leading-relaxed text-muted","children":"Keepers are independent off-chain bot nodes that poll active orders, check trigger criteria using Chainlink price feeds, and call executeOrder to close swaps."}],["$","h2",null,{"className":"mb-3 mt-10 font-display text-xl font-semibold text-cream","children":"Why it is permissionless"}],["$","p",null,{"className":"mb-4 text-sm leading-relaxed text-muted","children":["In Longbow, the keeper is a convenience layer, not a central authority. Anyone can run a keeper bot. The ",["$","code",null,{"className":"rounded bg-white/10 px-1.5 py-0.5 text-[13px] text-cream","children":"LongbowExecutor"}]," contract verifies all execution conditions on-chain: the current Chainlink oracle price, feed timestamps, reentrancy guards, and slippage."]}],["$","p",null,{"className":"mb-4 text-sm leading-relaxed text-muted","children":"If a malicious keeper tries to trigger an order before the price feed crosses the user's limit, the contract's internal assertion checks fail, and the transaction reverts immediately."}],["$","h2",null,{"className":"mb-3 mt-10 font-display text-xl font-semibold text-cream","children":"The Loop Logic"}],["$","p",null,{"className":"mb-4 text-sm leading-relaxed text-muted","children":"A keeper bot polls the database or graph mirror of active orders, then runs a checking loop:"}],["$","$L2",null,{"code":"$3","language":"javascript","title":"keeper-loop.ts"}],["$","h2",null,{"className":"mb-3 mt-10 font-display text-xl font-semibold text-cream","children":"Keeper Incentives"}],["$","p",null,{"className":"mb-4 text-sm leading-relaxed text-muted","children":"Keepers incur L2 gas costs when submitting execution transactions. To incentivize keepers, executions include a small tip (retained from the output swap tokens or charged as a minor premium). On Robinhood Chain, gas costs are extremely low (fractions of a cent), meaning even small tips provide healthy profit margins for keeper operators."}],["$","h2",null,{"className":"mb-3 mt-10 font-display text-xl font-semibold text-cream","children":"Deployment & Running"}],["$","p",null,{"className":"mb-4 text-sm leading-relaxed text-muted","children":["The repository includes a ready-to-run keeper package inside ",["$","code",null,{"className":"rounded bg-white/10 px-1.5 py-0.5 text-[13px] text-cream","children":"apps/keeper"}],". You can deploy it locally or on a VPS (Ubuntu/Debian) using PM2 for process monitoring:"]}],["$","$L2",null,{"code":"module.exports = {\n apps: [\n {\n name: 'longbow-keeper',\n script: 'packages/keeper/index.js',\n instances: 1,\n autorestart: true,\n watch: false,\n env: {\n NODE_ENV: 'production',\n USE_MOCKS: 'false',\n KEEPER_PRIVATE_KEY: '0x...',\n RPC_URL: 'https://rpc.mainnet.chain.robinhood.com',\n EXECUTOR_ADDRESS: '0x8bce...'\n }\n }\n ]\n};","language":"javascript","title":"ecosystem.config.js"}],["$","h2",null,{"className":"mb-3 mt-10 font-display text-xl font-semibold text-cream","children":"Troubleshooting Keepers"}],["$","ul",null,{"className":"mb-4 list-disc space-y-1.5 pl-5 text-sm leading-relaxed text-muted marker:text-neon","children":[["$","li",null,{"children":[["$","strong",null,{"className":"text-cream","children":"High Rejection Rates"}]," — If a transaction is submitted but reverts, another keeper might have beat you to it in the same block, or the price slipped back below the threshold."]}],["$","li",null,{"children":[["$","strong",null,{"className":"text-cream","children":"Insufficent Balance"}]," — Ensure the keeper's private key account is funded with Robinhood Chain native ETH to cover gas fees."]}]]}]],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","docs","children","keeper-guide","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","docs","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}],"params":{}}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/f55723d0ee21179d.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","className":"__variable_f367f3 __variable_dd5b2f","children":["$","body",null,{"className":"font-sans","children":["$","$L7",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L8",null]]]] 8:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Longbow Docs — Keeper Node Guide"}],["$","meta","3",{"name":"description","content":"Wall Street closes, the chain doesn't. Longbow tracks the gap between on-chain stock prices and real quotes on Robinhood Chain — non-custodial limit orders & DCA, keeper-executed through Uniswap V2. Nock. Draw. Loose."}],["$","meta","4",{"property":"og:title","content":"Longbow — Wall Street closes. The chain doesn't."}],["$","meta","5",{"property":"og:description","content":"The gap terminal for tokenized stocks: on-chain price vs real quote, live — with non-custodial limit & DCA orders keepers execute through Uniswap V2."}],["$","meta","6",{"property":"og:image","content":"https://longbowtrade.xyz/brand/og.png"}],["$","meta","7",{"property":"og:image:width","content":"1200"}],["$","meta","8",{"property":"og:image:height","content":"630"}],["$","meta","9",{"property":"og:image:alt","content":"Longbow"}],["$","meta","10",{"name":"twitter:card","content":"summary_large_image"}],["$","meta","11",{"name":"twitter:site","content":"@longbowtrade"}],["$","meta","12",{"name":"twitter:title","content":"Longbow — Wall Street closes. The chain doesn't."}],["$","meta","13",{"name":"twitter:description","content":"The gap terminal for tokenized stocks: on-chain price vs real quote, live — with non-custodial limit & DCA orders keepers execute through Uniswap V2."}],["$","meta","14",{"name":"twitter:image","content":"https://longbowtrade.xyz/brand/og.png"}],["$","link","15",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"48x48"}],["$","link","16",{"rel":"icon","href":"/brand/favicon.svg","type":"image/svg+xml"}],["$","link","17",{"rel":"icon","href":"/brand/favicon-32.png","sizes":"32x32","type":"image/png"}],["$","link","18",{"rel":"icon","href":"/brand/icon-192.png","sizes":"192x192","type":"image/png"}],["$","link","19",{"rel":"apple-touch-icon","href":"/brand/apple-touch-icon.png"}]] 1:null