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)
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
- Resolves the Safe address for the EOA (backend-assigned for pre-deployed wallets, not derived from the EOA).
- Ensures the Safe is available on-chain.
- First-deposit protocol patching (see below), then transfers the token from the EOA to the Safe and logs the deposit.
- Waits through the normal credit-completion window. If still in progress, returns
handover_pendingso the caller can continue tracking it.
First-deposit protocol patching
Runs only when the USDC profile has nochains 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.
depositFunds call, not by any separate deploy or session-key step.
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 theyieldmaxxing strategy. On a
conservative or aggressive profile the agent resolves zero protocols for
NVDAc and never deploys the funds.
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.