Skip to Content
Symmio Trading-SDK — the SDK surface for builders on HyperEVM
CoreAccountLayerdepositAndAllocateForAccount

depositAndAllocateForAccount

Deposit collateral into a subaccount and allocate it into the classic pool in one transaction. Calls AccountLayer.depositAndAllocateForAccount — equivalent to depositForAccount followed by an allocate, but atomic.

Not the instant-flow funding step. Instant trading spends the available balance; funds allocated here land in the classic pool, which an instant open does not consume — the symptom is “deposited, but the trade form shows zero margin.” For the instant (lowcap) flow, fund with depositForAccount alone. See Balance Model.

Like depositForAccount, it requires a prior ERC-20 approval of the collateral token to the SYMMIO core (symmioAddress).

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

Parameters

accountAddressrequired

The subaccount to credit and allocate for. The signer must equal its on-chain owner.

amountbigintrequired

Amount of collateral to deposit and allocate, 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).

Returns

Hash

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

Last updated on