write.asset_manager.yield_claimer
Encode arguments to automate claiming pending fees and emissions from liquidity positions and send them to a designated recipient.
Instructions
Encode args for the standalone yield claimer automation. Periodically claims pending fees/emissions and sends them to a designated recipient (wallet, another account, or any address). Returns { asset_managers, statuses, datas } — pass to write.account.set_asset_managers. 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. | |
| fee_recipient | Yes | Address to receive claimed fees (wallet address or any destination) | |
| enabled | No | True to enable, false to disable | |
| chain_id | No | Chain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | ||
| asset_managers | Yes | ||
| statuses | Yes | ||
| datas | Yes | ||
| strategy_name | No |
Implementation Reference
- Registration function that registers the 'write.asset_manager.yield_claimer' tool. The handler (lines 43-75) validates chain_id and dex_protocol, resolves the yield claimer AM address, validates the fee_recipient, encodes callback data via encodeYieldClaimerCallbackData, and returns {asset_managers, statuses, datas}.
export function registerYieldClaimerTools( server: McpServer, _chains: Record<ChainId, ChainConfig>, ) { server.registerTool( "write.asset_manager.yield_claimer", { annotations: { title: "Encode Yield Claimer Automation", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, description: "Encode args for the standalone yield claimer automation. Periodically claims pending fees/emissions and sends them to a designated recipient (wallet, another account, or any address). Returns { asset_managers, statuses, datas } — pass to write.account.set_asset_managers. Combinable with other intent tools.", outputSchema: IntentOutput, inputSchema: { dex_protocol: DEX_PROTOCOL_SCHEMA, fee_recipient: z .string() .describe("Address to receive claimed fees (wallet address or any destination)"), enabled: z.boolean().default(true).describe("True to enable, false to disable"), chain_id: z.number().default(8453).describe(CHAIN_ID_DESCRIPTION), }, }, async (params) => { try { const validChainId = validateChainId(params.chain_id); const amKey = dexProtocolToAmKey(params.dex_protocol); const amAddress = getAmProtocolAddress(validChainId, "yieldClaimers", amKey); if (!params.enabled) return formatResult( disabledIntent([amAddress], `Disable yield_claimer (${params.dex_protocol})`), ); const validFeeRecipient = validateAddress(params.fee_recipient, "fee_recipient"); const callbackData = encodeYieldClaimerCallbackData(CLAIMER_INITIATOR, validFeeRecipient); const result = { description: `Enable yield_claimer (${params.dex_protocol})`, asset_managers: [amAddress], statuses: [true], datas: [callbackData], }; return formatResult(result); } catch (err) { return { content: [ { type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}`, }, ], isError: true, }; } }, ); - Input schema and annotations for the yield_claimer tool. Inputs: dex_protocol (enum), fee_recipient (address), enabled (boolean, default true), chain_id (number, default 8453). Output schema is IntentOutput.
{ annotations: { title: "Encode Yield Claimer Automation", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, description: "Encode args for the standalone yield claimer automation. Periodically claims pending fees/emissions and sends them to a designated recipient (wallet, another account, or any address). Returns { asset_managers, statuses, datas } — pass to write.account.set_asset_managers. Combinable with other intent tools.", outputSchema: IntentOutput, inputSchema: { dex_protocol: DEX_PROTOCOL_SCHEMA, fee_recipient: z .string() .describe("Address to receive claimed fees (wallet address or any destination)"), enabled: z.boolean().default(true).describe("True to enable, false to disable"), chain_id: z.number().default(8453).describe(CHAIN_ID_DESCRIPTION), }, - encodeYieldClaimerCallbackData — encodes ABI-encoded callback data for the yield claimer with initiator address, fee recipient, max claim fee, and empty metadata.
export function encodeYieldClaimerCallbackData( initiator: `0x${string}`, feeRecipient: `0x${string}`, ): `0x${string}` { return encodeAbiParameters( [ { name: "initiator", type: "address" }, { name: "feeRecipient", type: "address" }, { name: "maxClaimFee", type: "uint256" }, { name: "metaData_", type: "bytes" }, ], [initiator, feeRecipient, DEFAULT_MAX_CLAIM_FEE, "0x"], ); } - src/tools/index.ts:72-79 (registration)Top-level registration call: registerYieldClaimerTools(server, chains) in the registerAllTools function.
registerYieldClaimerTools(server, chains); registerCowSwapperTool(server, chains); registerMerklOperatorTool(server, chains); registerSetAssetManagersTool(server, chains); // Dev tools registerSendTool(server, chains); } - src/tools/read/asset-managers.ts:89-100 (registration)Read-only listing of the yield_claimer tool definition with description, required params, and chain availability.
{ id: "yield_claimer", tool: "write.asset_manager.yield_claimer", description: "Claims pending fees/emissions and sends to a designated recipient address.", sets_managers: ["yield_claimer"], required_params: [ DEX_PROTOCOL_PARAM, { name: "fee_recipient", type: "address", hint: "address to receive claimed fees" }, ], optional_params: [], chains: ALL_CHAINS, },