Skip to main content
Glama

write.asset_manager.compounder

Read-onlyIdempotent

Automatically claims LP trading fees and reinvests them to compound interest in concentrated liquidity positions, increasing effective APY between rebalances.

Instructions

Encode args for the standalone compounder automation. Claims accumulated LP trading fees and reinvests them back into the position (compound interest). LP fees only — does NOT claim staking rewards like AERO; use write.asset_manager.compounder_staked for staked positions earning emission tokens. When paired with a rebalancer, the rebalancer compounds at rebalance time — adding a compounder also compounds between rebalances for higher effective APY. Returns { asset_managers, statuses, datas } — pass to write.account.set_asset_managers. Combinable with other intent tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dex_protocolYesDEX protocol of the LP position — used to resolve the correct asset manager address.
enabledNoTrue to enable, false to disable
chain_idNoChain ID: 8453 (Base) or 130 (Unichain)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
datasYes
statusesYes
descriptionNo
strategy_nameNo
asset_managersYes

Implementation Reference

  • The handler function that executes the logic for the "write.asset_manager.compounder" tool.
      async (params) => {
        try {
          const validChainId = validateChainId(params.chain_id);
          const amKey = dexProtocolToAmKey(params.dex_protocol);
          const amAddress = getAmProtocolAddress(validChainId, "compounders", amKey);
    
          if (!params.enabled)
            return formatResult(
              disabledIntent([amAddress], `Disable compounder (${params.dex_protocol})`),
            );
    
          const callbackData = encodeCompounderCallbackData(COMPOUNDER_INITIATOR);
          const result = {
            description: `Enable compounder (${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,
          };
        }
      },
    );
  • Tool registration for "write.asset_manager.compounder".
    server.registerTool(
      "write.asset_manager.compounder",
      {
        annotations: {
          title: "Encode Compounder Automation",
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false,
        },
        description:
          "Encode args for the standalone compounder automation. Claims accumulated LP trading fees and reinvests them back into the position (compound interest). LP fees only — does NOT claim staking rewards like AERO; use write.asset_manager.compounder_staked for staked positions earning emission tokens. When paired with a rebalancer, the rebalancer compounds at rebalance time — adding a compounder also compounds between rebalances for higher effective APY. 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,
          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)"),
        },
      },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arcadia-finance/arcadia-finance-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server