allocate
Move a subaccount’s available balance into its classic-pool allocated balance — the margin classic (non-instant) positions trade against. The call is routed through the AccountLayer _call proxy so the SYMMIO core attributes it to the subaccount; the connected wallet must be the subaccount’s on-chain owner. The subaccount must not be suspended or in liquidation as Party A.
Instant flow: skip this. Instant trading spends the available balance — allocating moves funds out of it and reduces what an instant open can use. See Balance Model.
import { allocate } from "@symmio/trading-core";
const hash = await allocate(config, {
account: "0xsub...",
amount: 1_000000000000000000n, // 18 decimals
});Parameters
accountAddressrequiredThe subaccount to allocate into. The signer must equal its on-chain owner.
amountbigintrequiredAmount moved into allocated balance, in 18 decimals (not collateral decimals).
chainIdnumberoptionalOptional chain override.
simulateBeforeWritebooleanoptionalDry-run via simulateContract first (defaults to the config’s setting, itself true by default).
gaslessboolean | GaslessWriteOptionsoptionalRelay 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.
Returns
HashsimulateAllocate(config, params).Gasless execution
allocate is relayable through the gasless execution mode — pass gasless: true
(or set the chain’s execution.mode to "gasless") and the SDK signs the same calldata as an InstantLayer operation,
relays it, and returns the relayer’s broadcast hash; the return type and receipt behavior are unchanged.