const transaction = await aptos.transaction.build.simple({
sender: account.accountAddress,
data: {
function: `${PACKAGE}::dex_accounts_entry::place_tp_sl_order_for_position`,
typeArguments: [],
functionArguments: [
"0x123...abc", // subaccountAddr
"0x456...def", // marketAddr (PerpMarket object address)
6000000, // tpTriggerPrice (optional, $6.00 with px_decimals 6)
6050000, // tpLimitPrice (optional, $6.05 with px_decimals 6)
500000, // tpSize (optional, 5 APT with sz_decimals 5)
5500000, // slTriggerPrice (optional, $5.50 with px_decimals 6)
5450000, // slLimitPrice (optional, $5.45 with px_decimals 6)
500000, // slSize (optional, 5 APT with sz_decimals 5)
null, // builderAddress (optional)
null, // builderFees (optional)
],
},
});