write.asset_manager.compounder_staked
Claim staking rewards from LP positions, swap them to a target token via CowSwap, and compound back into the position in a single transaction.
Instructions
Encode args for compounder coupled with CowSwap for staked LP positions (e.g. staked Slipstream/Aerodrome). Staked positions earn staking emission rewards (e.g. AERO, OP, or any configured emission token) — not LP fees. Claims these staking rewards, swaps them to a target token via CowSwap batch auctions (MEV-protected), then compounds back into the LP position. Sets metadata on BOTH the CowSwapper and the Compounder in a single call. sell_tokens is the list of reward token addresses (e.g. [AERO_address]). buy_token should be a major token in the pair (USDC, WETH, cbBTC). Returns { asset_managers, statuses, datas } with 2 entries (cowswapper + compounder). Base only. Combinable with other intent tools.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dex_protocol | Yes | DEX protocol of the LP position — used to resolve the correct asset manager address. | |
| sell_tokens | Yes | Token addresses to sell via CowSwap (typically [AERO] for staked positions) | |
| buy_token | Yes | Token address to buy — should be a major token in the pair (USDC, WETH, cbBTC) | |
| enabled | No | True to enable, false to disable | |
| chain_id | No | Chain ID: 8453 (Base) or 130 (Unichain) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| datas | Yes | ||
| statuses | Yes | ||
| description | No | ||
| strategy_name | No | ||
| asset_managers | Yes |
Implementation Reference
- The registration and handler implementation for the tool "write.asset_manager.compounder_staked", which encodes arguments for a compounder coupled with CowSwap for staked LP positions.
server.registerTool( "write.asset_manager.compounder_staked", { annotations: { title: "Encode Compounder + CowSwap Automation", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, description: "Encode args for compounder coupled with CowSwap for staked LP positions (e.g. staked Slipstream/Aerodrome). Staked positions earn staking emission rewards (e.g. AERO, OP, or any configured emission token) — not LP fees. Claims these staking rewards, swaps them to a target token via CowSwap batch auctions (MEV-protected), then compounds back into the LP position. Sets metadata on BOTH the CowSwapper and the Compounder in a single call. sell_tokens is the list of reward token addresses (e.g. [AERO_address]). buy_token should be a major token in the pair (USDC, WETH, cbBTC). Returns { asset_managers, statuses, datas } with 2 entries (cowswapper + compounder). Base only. Combinable with other intent tools.", outputSchema: IntentOutput, inputSchema: { dex_protocol: DEX_PROTOCOL_SCHEMA, sell_tokens: z .array(z.string()) .describe("Token addresses to sell via CowSwap (typically [AERO] for staked positions)"), buy_token: z .string() .describe( "Token address to buy — should be a major token in the pair (USDC, WETH, cbBTC)", ), enabled: z.boolean().default(true).describe("True to enable, false to disable"), chain_id: z.number().default(8453).describe("Chain ID: 8453 (Base) or 130 (Unichain)"), }, }, async (params) => { try { const validChainId = validateChainId(params.chain_id); const amKey = dexProtocolToAmKey(params.dex_protocol); let cowSwapperAddress: string; try { cowSwapperAddress = getStandaloneAmAddress(validChainId, "cowSwapper"); } catch { throw new Error( `compounder_staked is not available on chain ${validChainId} because it requires cow_swapper, which is Base-only (8453).`, ); } const compounderAddress = getAmProtocolAddress(validChainId, "compounders", amKey); if (!params.enabled) { return formatResult( disabledIntent( [cowSwapperAddress, compounderAddress], `Disable compounder_staked (${params.dex_protocol})`, ), ); } const validSellTokens = params.sell_tokens.map((t, i) => validateAddress(t, `sell_tokens[${i}]`), ); const validBuyToken = validateAddress(params.buy_token, "buy_token"); const cowSwapperData = encodeCowSwapTokenMetadata( "cow_swap_compound", validSellTokens, validBuyToken, ); const compounderData = encodeCompounderCoupledCallbackData( COWSWAPPER_INITIATOR, "cow_swap_compound", ); const result = { description: `Enable compounder_staked (${params.dex_protocol}, cowswap)`, asset_managers: [cowSwapperAddress, compounderAddress], statuses: [true, true], datas: [cowSwapperData, compounderData], }; return formatResult(result); } catch (err) { return { content: [ { type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}`, }, ], isError: true, }; } }, );