Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.decibel.trade/llms.txt

Use this file to discover all available pages before exploring further.

Each user can have multiple Trading Accounts for different trading strategies.
In the SDK, API, and Move contracts, Trading Accounts are called subaccount. The endpoint is /subaccounts, the function is create_new_subaccount, and the SDK method is createSubaccount. We refer to them as Trading Accounts.
Function:
{package}::dex_accounts_entry::create_new_subaccount
ABI Object:
const functionAbi: MoveFunction = {
  name: "create_new_subaccount",
  visibility: "private",
  is_entry: true,
  is_view: false,
  generic_type_params: [],
  params: ["&signer"],
  return: [],
};
Parameters:
  • signer - The account signer (your account)
Example:
const transaction = await aptos.transaction.build.simple({
  sender: account.accountAddress,
  data: {
    function: `${PACKAGE}::dex_accounts_entry::create_new_subaccount`,
    typeArguments: [],
    functionArguments: [],
  },
});