Skip to main content
depositFunds remains for compatibility with existing integrations. New integrations should use sendDeposit, then explicitly await waitForDepositCredit when their UI needs investable funds. This convenience method transfers tokens from the user’s EOA to their Smart Wallet, then waits through a short normal credit-completion window before returning. 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), available on Mainnet and Base only.
  • NVDAc: 8 decimals — e.g., "100000000" = 1 NVDAc (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.WETH and NVDAc minimums are quoted in dollars, not in token units: the SDK reads the live price at deposit time, so the threshold in token units moves with the market. At $225 a share, the NVDAc minimum is roughly 0.44 NVDAc.

First Deposit Disclosure

Partners must show this notice directly above the first deposit confirmation button:
By depositing, you authorize Zyfai automation to monitor risk and rebalance your funds within your selected strategy to seek better yield.
Include a link to the Zyfai Terms and Conditions. Recommended button label: Deposit & Activate This disclosure is only required when the user makes their first deposit and activates automation. Later deposits do not need it. The same UI requirement applies if you transfer tokens yourself and then call logDeposit.

Compatibility 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.
  4. Waits through the normal credit-completion window. If still in progress, returns handover_pending so the caller can continue tracking it.

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, EURC, and NVDAc, each with the chains it exists on — [1, 8453, 42161] for USDC/WETH, [1, 8453] for EURC, [8453] for NVDAc.
  • Fetches protocols, filters by strategy / chain / asset + pool availability, and persists via updateUserProfile → assetTypeSettings.[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.
On every later deposit the argument is ignored, and no error is raised. Re-running the patch would overwrite a protocol selection the user may have customised. Passing "yieldmaxxing" to an account that has already deposited leaves it on its current strategy.To change the strategy of an existing account, call updateUserProfile for each asset concerned:

Returns

Deposit response with transaction hash, confirmation, and lifecycle metadata. registration is credited when funds are investable, or handover_pending when the normal completion window elapsed while the backend continues handover. For either a pending high-level deposit or an intentionally split logDeposit flow, use waitForDepositCredit with an explicit longer timeoutMs, or poll getDepositStatus.

Return Type

Example

Deposit USDC

Deposit WETH

Deposit EURC

Deposit NVDAc

NVDAc is Base-only and is held exclusively by protocols with delayed withdrawals, so it requires the yieldmaxxing strategy. On a conservative or aggressive profile the agent resolves zero protocols for NVDAc and never deploys the funds.
updateUserProfile stores the strategy but does not compute a protocol list, so on its own it leaves NVDAc with an empty whitelist and the deposit sits idle in the Safe with no error anywhere. setAssetStrategy does both.On a brand-new account this is handled for you: pass "yieldmaxxing" as the strategy argument of the very first depositFunds call instead.
Tokenized equities stop accepting deposits outside market hours, typically over the weekend. Funds stay idle in the Safe and are deployed at the next open; other assets are unaffected. getPortfolio returns ready-to-display copy in pauseMessageByToken["NVDAc"] while that lasts.
depositFunds logs the deposit for you. If you send the ERC-20 transfer yourself, call logDeposit after it confirms. Otherwise, the backend will not rotate a reserved pool wallet or start yield tracking.