Skip to main content

pauseAgent

Pause the agent by clearing all protocols. This sets the user's protocols to an empty array, effectively pausing automated operations. Requires SIWE authentication.

Signature

pauseAgent(): Promise<UpdateUserProfileResponse>

Returns

Response indicating success and updated user details

Return Type

interface UpdateUserProfileResponse {
success: boolean;
userId: string;
smartWallet?: Address;
chains?: number[];
strategy?: string;
protocols?: string[];
autoSelectProtocols?: boolean;
omniAccount?: boolean;
autocompounding?: boolean;
agentName?: string;
crosschainStrategy?: boolean;
executorProxy?: boolean;
splitting?: boolean;
minSplits?: number;
customization?: Record<string, any>;
}

Example

await sdk.connectAccount(privateKey, chainId);

// Pause the agent
const result = await sdk.pauseAgent();
console.log("Agent paused:", result.success);

// Verify the agent is paused
const userDetails = await sdk.getUserDetails();
console.log("Active protocols:", userDetails.protocols?.length); // Should be 0

Notes

  • User must be authenticated (automatically done via connectAccount())
  • This sets the user's protocols to an empty array
  • To resume operations, call resumeAgent()
  • The agent will not perform automated yield optimization while paused