deallocate
Move a subaccount’s classic-pool allocated balance back into its available balance — the reverse of allocate. (The instant flow never allocates in the first place — see Balance Model.) Routed through the AccountLayer _call proxy; the connected wallet must be the subaccount’s on-chain owner. Requires a fresh Muon uPnL attestation so the contract can verify the subaccount stays solvent, and is subject to the on-chain deallocate debounce.
import { deallocate, getDeallocateUpnlSig } from "@symmio/trading-core";
const upnlSig = await getDeallocateUpnlSig(config, { virtualAccount: "0xsub..." });
const hash = await deallocate(config, {
account: "0xsub...",
amount: 1_000000000000000000n, // 18 decimals
upnlSig,
});Parameters
accountAddressrequiredThe subaccount to deallocate from. The signer must equal its on-chain owner.
amountbigintrequiredAmount moved back into available balance, in 18 decimals (not collateral decimals).
upnlSigSingleUpnlSigrequiredA fresh Muon uPnL attestation — fetch with getDeallocateUpnlSig right before submitting.
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
HashsimulateDeallocate(config, params).Gasless execution
deallocate 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.