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.
Function:
{package}::dex_accounts_entry::place_twap_order_to_subaccount_v2
ABI Object:
const functionAbi: MoveFunction = {
name: "place_twap_order_to_subaccount_v2",
visibility: "private",
is_entry: true,
is_view: false,
generic_type_params: [],
params: [
"&signer",
"0x1::object::Object<{package}::dex_accounts::Subaccount>",
"0x1::object::Object<{package}::perp_market::PerpMarket>",
"u64",
"bool",
"bool",
"0x1::option::Option<0x1::string::String>",
"u64",
"u64",
"0x1::option::Option<address>",
"0x1::option::Option<u64>",
],
return: [],
};
Parameters:
signer - The account signer
subaccount - The Trading Account object
market - The PerpMarket object
size - Total size to execute (u64)
is_buy - True for buy, false for sell
is_reduce_only - Whether order can only reduce position
client_order_id - Optional client-assigned order ID `<Option<String>>`
twap_frequency_seconds - How often to execute sub-orders (u64)
twap_duration_seconds - Total duration for TWAP order (u64)
builder_address - Optional builder address `<Option<address>>`
builder_fees - Optional builder fee `<Option<u64>>`
Example:
const transaction = await aptos.transaction.build.simple({
sender: account.accountAddress,
data: {
function: `${PACKAGE}::dex_accounts_entry::place_twap_order_to_subaccount_v2`,
typeArguments: [],
functionArguments: [
"0x123...abc", // subaccountAddr
"0x456...def", // marketAddr (PerpMarket object address)
10000000000, // size (10.0 with 9 decimals)
true, // isBuy (true for buy, false for sell)
false, // isReduceOnly
null, // clientOrderId (optional)
60, // twapFrequencySeconds (execute every 60 seconds)
3600, // twapDurationSeconds (total duration: 1 hour)
null, // builderAddress (optional)
null, // builderFees (optional)
],
},
});