> ## Documentation Index
> Fetch the complete documentation index at: https://zyfai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# updateUserProfile

Update the authenticated user's profile settings including strategy, protocols, chains, and advanced customization options. Requires SIWE authentication.

## Signature

```typescript theme={null}
updateUserProfile(params: UpdateUserProfileRequest): Promise<UpdateUserProfileResponse>
```

## Parameters

```typescript theme={null}
interface UpdateUserProfileRequest {
  /** Investment strategy: "conservative" for safer yields, "aggressive" for higher risk/reward */
  strategy?: "conservative" | "aggressive";

  /** Array of protocol IDs to use for yield optimization */
  protocols?: string[];

  /** Enable auto-selection of protocols */
  autoSelectProtocols?: boolean;

  /** Enable omni-account feature for cross-chain operations */
  omniAccount?: boolean;

  /** Array of chain IDs to operate on */
  chains?: number[];

  /** Enable automatic compounding of earned yields (default: true) */
  autocompounding?: boolean;

  /** Custom name for your agent */
  agentName?: string;

  /** Enable cross-chain strategy execution */
  crosschainStrategy?: boolean;

  /** Enable position splitting across multiple protocols */
  splitting?: boolean;

  /** Minimum number of splits when position splitting is enabled (1-4) */
  minSplits?: number;

  /** Asset to update settings for: "USDC" (default), "WETH", or "EURC" */
  asset?: "USDC" | "WETH" | "EURC";
}
```

**Note on `asset` parameter:**

* Each asset (USDC, WETH, EURC) has its own customization settings
* When `asset` is not provided, defaults to `"USDC"`
* Use `asset: "WETH"` or `asset: "EURC"` to update settings for that asset
* This allows different strategies, protocols, and splitting configurations per asset

**Note:**

* Smart wallet address and chains can only be configured through backend initialization and cannot be updated via this method.
* `executorProxy` is always `true` and cannot be updated.
* For granular protocol/pool configuration, use the [customizeBatch](/docs/sdk/api/customize-batch) method instead of the `customization` field.

## Returns

```typescript theme={null}
interface UpdateUserProfileResponse {
  success: boolean;
  smartWallet?: string;
  chains?: number[];
  strategy?: string;
  protocols?: string[];
  autoSelectProtocols?: boolean;
  omniAccount?: boolean;
  autocompounding?: boolean;
  agentName?: string;
  crosschainStrategy?: boolean;
  executorProxy?: boolean;
  hasActiveSessionKey?: boolean;
  splitting?: boolean;
  minSplits?: number;
  customization?: Record<string, any>;
  asset?: "USDC" | "WETH" | "EURC";
}
```

## Examples

### Basic Strategy Update

```typescript theme={null}
await sdk.connectAccount(privateKey, chainId);

// Update strategy from conservative to aggressive
await sdk.updateUserProfile({
  strategy: "aggressive",
});

console.log("Strategy updated to aggressive");
```

### Configure Protocols

```typescript theme={null}
// Get available protocols for a chain
const protocolsResponse = await sdk.getAvailableProtocols(8453);
const selectedProtocols = protocolsResponse.protocols
  .filter(p => ["Aave", "Compound", "Moonwell"].includes(p.name))
  .map(p => p.id);

// Update user profile with specific protocols
await sdk.updateUserProfile({
  protocols: selectedProtocols,
});

console.log("Protocols configured");
```

### Enable Advanced Features

```typescript theme={null}
// Enable position splitting and cross-chain strategies
await sdk.updateUserProfile({
  splitting: true,
  minSplits: 3,  // Split positions across 3+ protocols
  crosschainStrategy: true,  // Allow cross-chain rebalancing
  omniAccount: true,  // Enable omni-account features
  autocompounding: true,  // Auto-compound yields
});

console.log("Advanced features enabled");
```

### Complete Profile Configuration

```typescript theme={null}
await sdk.connectAccount(privateKey, 8453);

// Get available protocols
const protocolsResponse = await sdk.getAvailableProtocols(8453);
const protocolIds = protocolsResponse.protocols.map(p => p.id);

// Configure complete user profile
await sdk.updateUserProfile({
  strategy: "aggressive",
  protocols: protocolIds,
  splitting: true,
  minSplits: 2,
  crosschainStrategy: true,
  omniAccount: true,
  autocompounding: true,
  agentName: "My DeFi Agent",
});

// Verify the changes
const userDetails = await sdk.getUserDetails();
console.log("Profile updated:", {
  strategy: userDetails.strategy,
  chains: userDetails.chains,  // Chains set during initialization
  protocolCount: userDetails.protocols?.length,
  splitting: userDetails.splitting,
  minSplits: userDetails.minSplits,
  crosschainStrategy: userDetails.crosschainStrategy,
});
```

### Custom Protocol/Pool Configuration

For granular control over which pools to use for each protocol on each chain, use the dedicated [customizeBatch](/docs/sdk/api/customize-batch) method:

```typescript theme={null}
// Use customizeBatch for pool-level configuration
await sdk.customizeBatch([
  {
    protocolId: "protocol-uuid-1",
    pools: ["USDC Pool", "WETH Pool"],
    chainId: 8453,  // Base
    autoselect: false
  },
  {
    protocolId: "protocol-uuid-1",
    pools: ["USDC Vault"],
    chainId: 42161,  // Arbitrum
    autoselect: false
  }
]);

console.log("Custom protocol/pool configuration saved");
```

See the [customizeBatch documentation](/docs/sdk/api/customize-batch) for more details.

## Use Cases

### Risk Management

```typescript theme={null}
// Start conservative, monitor performance
await sdk.updateUserProfile({ strategy: "conservative" });

// After gaining confidence, switch to aggressive
await sdk.updateUserProfile({ strategy: "aggressive" });
```

### Multi-Chain Operations

```typescript theme={null}
// Enable cross-chain yield optimization features
// Note: Chains are configured during initial setup via backend
// This updates the cross-chain strategy settings
await sdk.updateUserProfile({
  crosschainStrategy: true,
  omniAccount: true,
});

// Now your funds can be rebalanced across your configured chains
const userDetails = await sdk.getUserDetails();
console.log("Operating on chains:", userDetails.chains);
```

### Protocol Selection

```typescript theme={null}
// Manual protocol selection
const protocols = ["aave-v3-uuid", "compound-uuid", "moonwell-uuid"];
await sdk.updateUserProfile({
  protocols,
});
```

### Position Splitting

```typescript theme={null}
// Distribute funds across multiple protocols to reduce risk
await sdk.updateUserProfile({
  splitting: true,
  minSplits: 3,  // Require at least 3 different positions
});

// The rebalance engine will now split your deposits across
// at least 3 different protocols/pools when possible
```

### Asset-Specific Configuration

```typescript theme={null}
// Update USDC settings (default)
await sdk.updateUserProfile({
  strategy: "conservative",
  splitting: true,
  minSplits: 2,
});

// Update ETH/WETH settings separately
await sdk.updateUserProfile({
  asset: "WETH",
  strategy: "aggressive",
  splitting: true,
  minSplits: 3,
});

// Update EURC settings separately
await sdk.updateUserProfile({
  asset: "EURC",
  strategy: "conservative",
});

// Each asset maintains its own configuration
```

## Notes

### Strategy Changes

* On first [depositFunds](/docs/sdk/api/deposit-funds), the optional `strategy` parameter sets the initial risk profile (default: `"conservative"`)
* You can change the strategy at any time after onboarding
* After the strategy is updated, subsequent rebalancing uses the **new active strategy**
* Data methods such as [getUserDetails](/docs/sdk/api/get-user-details), [getPositions](/docs/sdk/api/get-positions), and [getHistory](/docs/sdk/api/get-history) return data for the **current active strategy**

### Chain Configuration

* Chains are configured during initial user setup via the backend and cannot be updated through this method
* To view configured chains, use `getUserDetails()` which returns the `chains` array
* Supported chains: Base (8453), Arbitrum (42161), Ethereum Mainnet (1)
* When `crosschainStrategy` is enabled, the rebalance engine can move funds between your configured chains
* Each chain must have sufficient gas tokens (ETH) for operations
* Contact support or use backend APIs to modify chain configuration

### Position Splitting

* `splitting` enables distributing funds across multiple protocols/pools, only when profitable if minSplits is set to 1.
* `minSplits` sets the minimum number of positions (1-4), if above 1, it will force split the funds across the minimum number of positions.
* Higher `minSplits` values increase diversification but may increase gas costs
* The rebalance engine respects minimum position sizes when splitting

### Customization Field

* The `customization` field allows granular control over protocol/pool selection per chain
* Structure: `{ "protocolId": { "chainId": ["pool1", "pool2"] } }`
* This overrides automatic pool selection for specified protocols
* Useful for advanced users who want to target specific pools

### Auto-compounding

* When `autocompounding` is `true` (default), yields are automatically reinvested
* When `false`, yields accumulate but are not reinvested
* Most users should keep this enabled for maximum compound growth

## Related Methods

* [depositFunds](/docs/sdk/api/deposit-funds) - First deposit assigns Safe + session and sets initial strategy/protocols
* [getUserDetails](/docs/sdk/api/get-user-details) - Get current user profile and configuration
* [getAvailableProtocols](/docs/sdk/api/get-available-protocols) - Get available protocols for a chain
* [getPositions](/docs/sdk/api/get-positions) - View current positions across protocols
