Skip to main content
Transfer tokens from the user’s EOA to their Smart Wallet. Waits for transaction confirmation. On the first deposit, this is also how a user is onboarded onto Zyfai: a pre-deployed Safe with an already-signed session key is assigned to them, live on Base, Arbitrum, and Ethereum Mainnet at once. No separate deploySafe or createSessionKey call is needed (or supported). Supported assets:
  • USDC: 6 decimals — e.g., "100000000" = 100 USDC
  • WETH: 18 decimals — e.g., "1000000000000000000" = 1 WETH
  • EURC: 6 decimals — e.g., "100000000" = 100 EURC (Mainnet and Base only)
The first time a user deposits into Zyfai, the backend associates their EOA with a pre-deployed Smart Account that already has a signed session key.That Smart Account becomes available immediately on Base (8453), Arbitrum (42161), and Ethereum Mainnet (1) — not only on the chainId you pass to depositFunds. The user is the owner of that Safe.This does not change how their EOA works: the EOA remains a normal wallet. Depositing only links a Zyfai Smart Wallet (with session) to that EOA as owner.
You must deposit WETH (Wrapped ETH), not native ETH. If the user has ETH, they must wrap it to WETH first before depositing.
Minimums apply to the total Safe balance after the deposit (current Safe balance + deposit amount). Top-ups smaller than the minimum are allowed if the Safe already holds enough of the asset to meet it. Pairs without a configured threshold are not checked.

Signature

Parameters

What happens under the hood

  1. Resolves the Safe address for the EOA (backend-assigned for pre-deployed wallets — not derived from the EOA).
  2. Ensures the Safe is available on-chain.
  3. First-deposit protocol patching (see below), then transfers the token from the EOA to the Safe and logs the deposit.

First-deposit protocol patching

Runs only when the USDC profile has no chains configured yet (later deposits and pauseAgent do not re-trigger it):
  • Patches USDC, WETH, and EURC with chains [1, 8453, 42161] (EURC limited to [1, 8453]).
  • Fetches protocols, filters by strategy / chain / asset + pool availability, and persists via updateUserProfileassetTypeSettings.[usdc|eth|eurc].
  • Failures are non-fatal (console.warn); the deposit still proceeds.
Protocols / chains are set on this first depositFunds call — not by any separate deploy or session-key step.

Returns

Deposit response with transaction hash and confirmation

Return Type

Example

Deposit USDC

Deposit WETH

Deposit EURC