Contracts
Contracts · Flow

Withdraw

Open, finalize, and cancel withdraw requests, and read pending requests and cooldown timing.

Wallet
Not connected

useBalanceHistory
read
Read a subaccount's deposit / withdraw history from the analytics subgraph, filterable by movement type. Internal margin-transfer legs are excluded by default.
Margin legs
Enter a subaccount address to load its history.
getPendingWithdrawRequests
read
List a subaccount's active (non-terminal) withdraw requests.
Run the read to see pending requests.
getWithdrawRequests
read
Read a single withdraw request by subaccount and request id.
Run the read to see the request.
getLastWithdrawRequestId
read
Read a subaccount's most recent withdraw request id (0 when there are none).
Run the read to see the last request id.
getWithdrawableTime
read
Read the earliest time a withdrawal initiated now could be finalized for a subaccount.
Run the read to see the withdrawable time.
getWithdrawCooldownOf
read
Read when a subaccount was last deallocated or credited to withdrawable balance, and when it can deallocate next.
Run the read to see the subaccount’s cooldown timestamp.
getDeallocateDebounceTime
read
Read the minimum time the protocol enforces between two deallocations of the same account.
Run the read to see the deallocate debounce.

initiateWithdraw
write
Open a classic same-chain withdraw request for a subaccount (routed via AccountLayer _call).
Fill the fields above and submit.
finalizeWithdrawRequest
write
Finalize a matured withdraw request, paying out to its receivers. Permissionless after cooldown.
Fill the fields above and submit.
requestCancelWithdraw
write
Cancel a pending withdraw request for a subaccount (routed via AccountLayer _call).
Fill the fields above and submit.
executeAccountCalls
write
Run several SYMMIO core writes as one subaccount, in one atomic transaction. Reference only: this card explains the call and sends nothing.

How it works

  1. Pass a subaccount and an ordered list of { functionName, args }. Each name must be a write in the SDK’s SYMMIO core ABI, with its own units.
  2. The SDK encodes every call first, so a wrong name or argument fails before any wallet prompt.
  3. From the wallet, the calls go out as one AccountLayer _call transaction, simulated first. If one call reverts, none of them happen.
  4. Gasless, every call is relayed in order as one request. With gasless: true, a list holding a call the relayer cannot carry is refused instead of going to the wallet.
  5. Nothing is inferred: no request ids, and no call’s return value is fed into the next. Read what you need before you build the list.

Why this card cannot send it

This app uses the SDK only through @symmio/trading-react, and that package has no hook for this call: the calls are arbitrary core writes, so no fixed set of reads can be refreshed after them. For a withdrawal you do not need it: the useWithdraw flow already deallocates and initiates in one atomic transaction on a cross-margin subaccount.

In a React app

import { executeAccountCallsMutationOptions } from "@symmio/trading-core";
import { useSymmioConfig } from "@symmio/trading-react";
import { useMutation } from "@tanstack/react-query";

const config = useSymmioConfig();
const { mutate } = useMutation(executeAccountCallsMutationOptions(config));

mutate({
  account: subAccount,
  calls: [
    { functionName: "deallocate", args: [amount18, upnlSig] },
    { functionName: "initiateWithdraw", args: [parts, false, providerData] },
  ],
});
// Wait for the receipt, then refresh the reads these calls changed.

Full reference: SDK docs → Core → SYMMIO contract → executeAccountCalls.