> ## 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.

# Place Spot Bulk Order

> Place a two-sided ladder of orders on a spot market in one transaction

**Function:**

```
{package}::dex_accounts_spot_entry::place_spot_bulk_order_to_subaccount
```

**ABI Object:**

```typescript theme={null}
const functionAbi: MoveFunction = {
  name: "place_spot_bulk_order_to_subaccount",
  visibility: "private",
  is_entry: true,
  is_view: false,
  generic_type_params: [],
  params: [
    "&signer",
    "0x1::object::Object<{package}::dex_accounts::Subaccount>",
    "0x1::object::Object<{package}::spot_market::SpotMarket>",
    "u64",
    "vector<u64>",
    "vector<u64>",
    "vector<u64>",
    "vector<u64>",
    "0x1::option::Option<address>",
    "0x1::option::Option<u64>",
  ],
  return: [],
};
```

**Parameters:**

* `auth` - The account signer
* `subaccount` - The Trading Account object
* `market` - The SpotMarket object
* `sequence_number` - Monotonic sequence number used to replace the resting ladder `` `<u64>` ``
* `bid_prices` - Bid prices in raw quote units `` `<vector<u64>>` ``
* `bid_sizes` - Bid sizes in raw base units `` `<vector<u64>>` ``
* `ask_prices` - Ask prices in raw quote units `` `<vector<u64>>` ``
* `ask_sizes` - Ask sizes in raw base units `` `<vector<u64>>` ``
* `builder_address` - Optional builder/referrer address `` `<Option<address>>` ``
* `builder_fees` - Optional builder fee cap `` `<Option<u64>>` ``, in units of 0.0001% (basis points × 100; e.g. `1000` = 10 bps = 0.1%, the protocol maximum). The TypeScript SDK takes basis points and does this conversion for you

A single builder code applies to every level of the bulk order.

> [!NOTE]
>
> Each call **replaces** the account's entire resting ladder on that market rather than adding to it. Use a strictly increasing `sequence_number` so stale submissions are rejected rather than reinstating an old ladder.

> [!WARNING]
>
> Spot bulk orders are funded from the primary fungible store (PFS) only — unlike single spot orders, they do not fall back to collateral-backed storage. The transaction aborts if PFS is short on either side of the ladder.

To place a ladder directly from a wallet, use `place_spot_bulk_order`, which takes the same arguments without the `subaccount` parameter.

**Example:**

```typescript Typescript theme={null}
const transaction = await aptos.transaction.build.simple({
  sender: account.accountAddress,
  data: {
    function: `${PACKAGE}::dex_accounts_spot_entry::place_spot_bulk_order_to_subaccount`,
    typeArguments: [],
    functionArguments: [
      "0x123...abc", // subaccountAddr
      "0x456...def", // marketAddr (SpotMarket object address)
      7, // sequenceNumber (must increase on each replacement)
      [44950000, 44900000], // bidPrices (raw quote units)
      [20000, 30000], // bidSizes (raw base units)
      [45100000, 45200000], // askPrices (raw quote units)
      [15000, 25000], // askSizes (raw base units)
      null, // builderAddress (optional)
      null, // builderFees (optional)
    ],
  },
});
```

```python Python theme={null}
transaction = rest_client.build_transaction(
    sender=account.address(),
    payload={
        "function": f"{PACKAGE}::dex_accounts_spot_entry::place_spot_bulk_order_to_subaccount",
        "type_arguments": [],
        "function_arguments": [
            "0x123...abc",  # subaccountAddr
            "0x456...def",  # marketAddr (SpotMarket object address)
            7,  # sequenceNumber (must increase on each replacement)
            [44950000, 44900000],  # bidPrices (raw quote units)
            [20000, 30000],  # bidSizes (raw base units)
            [45100000, 45200000],  # askPrices (raw quote units)
            [15000, 25000],  # askSizes (raw base units)
            None,  # builderAddress (optional)
            None,  # builderFees (optional)
        ],
    },
)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.