Skip to Content
Symmio Trading-SDK — the SDK surface for builders on Arbitrum
CoreAccountLayerdepositForAccount

depositForAccount

Deposit collateral into a subaccount’s available balance — the balance instant trading spends and withdrawals draw from. Calls AccountLayer.depositForAccount, which pulls the collateral from the connected wallet into the SYMMIO core and credits the subaccount. For the instant (lowcap) flow this is the whole funding step: deposited funds are directly tradeable, with no allocate step afterwards. See Balance Model.

Requires a prior ERC-20 approval of the collateral token to the SYMMIO core (symmioAddress) — the core is the contract that pulls the funds, so approving the AccountLayer address makes the deposit revert. See getCollateralAllowance and approveCollateral under SYMMIO Contract.

import { depositForAccount } from "@symmio/trading-core"; const hash = await depositForAccount(config, { account: "0xsub...", amount: 1_000000n, // collateral decimals (e.g. 1 USDC at 6 decimals) });

Parameters

accountAddressrequired

The subaccount (or virtual account) to credit. The signer must equal its on-chain owner.

amountbigintrequired

Amount of collateral to deposit, in the collateral token’s decimals (getChainConfig().addresses.collateralDecimals) — not 18 decimals.

chainIdnumberoptional

Optional chain override.

simulateBeforeWritebooleanoptional

Dry-run via simulateContract first (defaults to the config’s setting, itself true by default).

gaslessboolean | GaslessWriteOptionsoptional

Relay this write through the gasless execution mode instead of the wallet. A boolean for the common case, or a per-call GaslessWriteOptions bag; omitted, the chain’s execution.mode decides. Relaying removes the gas, not the approval — the collateral is still pulled from the owner’s wallet, so the ERC20 allowance must already exist. A wallet holding no native gas at all should deposit through settleGaslessDepositNewAccount instead.

Returns

Hash

The broadcast tx hash. Dry-run without sending via simulateDepositForAccount(config, params).

Last updated on