write.asset_manager.yield_claimer
Read-onlyIdempotent
Automate periodic claiming of pending fees and emissions from liquidity positions, then transfer them to a specified recipient address.
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
TableJSON 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) or 130 (Unichain) |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| datas | Yes | ||
| statuses | Yes | ||
| description | No | ||
| strategy_name | No | ||
| asset_managers | Yes |
Implementation Reference
- The tool "write.asset_manager.yield_claimer" is registered and handled within this function in src/tools/write/asset-managers/yield-claimer.ts.
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: 8453 (Base) or 130 (Unichain)"), }, }, 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, }; } }, );