> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bulk.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# v1.0.35 Client Migration

> Prepare clients for explicitly funded ISO accounts, child-debt handling and account-local responses.

> [!NOTE]
>
> **Upcoming mainnet upgrade.** These changes are already live on **testnet**.
> Mainnet deployment is scheduled for **10 December 2026 at 14:00 UTC**.

This guide covers the client changes for v1.0.35: explicitly funded ISO accounts,
retained collateral, child-debt handling and separate account margin pools.
See [Isolated Margin](https://docs.bulk.trade/bulk-exchange/isolated-margin.md) for how isolated accounts
are funded, traded and removed.

The examples use illustrative balances and placeholder public keys. Replace
placeholders, generate a fresh nonce and sign the complete transaction with the
appropriate network domain before submitting. Funding amounts in these examples
are not a quote for an order's actual margin requirement.

## Migration at a Glance

| Area | Client migration |
| - | - |
| Opening an ISO account | Create or fund the account explicitly before placing the ISO order. |
| Closing or cancelling | Keep positive collateral and the account link visible until an explicit transfer or eligible removal. |
| Cross versus ISO | Remove an eligible linked account before adding cross exposure in that parent and market, including when the account is empty. |
| Child capacity | Count ordinary and ISO children together against the 64-child limit per parent. |
| Child deficits | Account for eligible flat child debt settling into the direct parent, including before a later outflow rejection. |
| Account responses | Read the top level locally and render nested `isoAccounts` as separate margin pools. |
| Signing library | Update to `bulk-keychain` 0.1.35, or `bulk-keychain-wasm` 0.1.35 for browsers, before testing the new ISO transfer flow. |

## 1. Create or Fund an ISO Account Explicitly

An order with `i: true` still selects isolated routing, but it no longer creates
or funds the ISO account by pulling collateral from the parent. The protocol
rejects the order if the ISO account is missing or unlinked. A funded parent
does not compensate for insufficient collateral in its ISO account.

Use an authorized internal transfer before placing the ISO order. These are
**action snippets** inside the normal signed transaction's `actions` array:

```json Ordinary internal transfer theme={null}
{
  "transfer": {
    "k": "internal",
    "from": "<source-account>",
    "to": "<destination-account>",
    "marginAmount": 100.0
  }
}
```

```json Create or fund the parent's BTC ISO account theme={null}
{
  "transfer": {
    "k": "internal",
    "from": "<source-account>",
    "to": "<parent-account>",
    "marginAmount": 100.0,
    "symbol": "BTC-USD"
  }
}
```

When `symbol` is supplied, **`to` names the parent**, and the protocol resolves
that parent's deterministic ISO account for the perpetual market. To fund an ISO
account from its parent, set both `from` and `to` to the parent in the second example;
the resolved destination is the ISO account.

**`symbol` selects the ISO market, not the collateral currency.** It must name
a supported perpetual order market such as `BTC-USD`, not a collateral symbol
such as `USD`. `marginAmount` is the USD-denominated value to move; the protocol
applies its collateral-transfer and risk rules.

Remove stale `marginSymbol` fields from request builders. `marginSymbol` is not
a current `Transfer` input and does not select a collateral asset.

### Later Transfers Can Use the Account Public Key

Once the account exists, address it directly and omit `symbol`:

```json theme={null}
{
  "transfer": {
    "k": "internal",
    "from": "<parent-account>",
    "to": "<iso-account-pubkey>",
    "marginAmount": 50.0
  }
}
```

An ordinary direct transfer does not create an unknown off-curve destination.
Use the parent-plus-`symbol` form when creating the account, then retain the account
public key from the refreshed account tree.

### Use the Correct Account Authority

The transaction's `account` supplies the transfer authority. Both internal
transfer endpoints must be that account or its direct children, and the signer
must be authorized for the transaction account.

For an ISO account under an ordinary sub-account, use that sub-account as the
transaction `account`, with an authorized signer. A root account's authority
does not turn every deeper descendant into a direct transfer endpoint. Move
funds through the relevant parent contexts when necessary. External transfers
cannot be used to create or fund ISO accounts.

Registered conditional, On-Fill and other deferred instructions that open ISO
exposure also need an existing, adequately funded account when the order executes.
Review that intent as well as new immediate submissions.

## 2. Keep Closing, Funding and Mode Changes Separate

Closing the final position or cancelling orders does **not** return positive
ISO collateral to the parent. The collateral stays in the account, and the account
can remain linked even with no position, no orders and a zero balance.

To return available margin, use an explicit internal transfer:

```json theme={null}
{
  "transfer": {
    "k": "internal",
    "from": "<iso-account-pubkey>",
    "to": "<parent-account>",
    "marginAmount": 25.0
  }
}
```

Alternatively, the direct parent can remove an eligible account and return its
remaining collateral:

```json theme={null}
{
  "removeSubAccount": {
    "toRemove": "<iso-account-pubkey>"
  }
}
```

The child must have no open positions, open orders, locked funds, pending locked
funds or listed children. Removal unlinks the ISO account and returns its remaining
collateral to the parent. It does not mean the account's identity and historical
records are permanently erased; an authorized later funding transfer can relink
an existing account.

### One Margin Mode per Parent and Market

A linked BTC ISO account blocks new BTC cross exposure on the same parent, even
when that account is empty. Transferring its positive balance back or closing its
position does not switch the parent to cross mode. Remove the eligible account
before submitting new cross exposure for that parent and market.

Likewise, funding or linking an ISO account cannot bypass an existing same-market
cross position or resting order in the parent. This rule is per parent and
market, not a prohibition on using different markets or separate account pools.

Ordinary and ISO children share a **64-child limit per parent**. Include both
types in capacity checks before creating another child or linking another account.

## 3. Reconcile Child Debt Before Retrying Outflows

Eligible flat deficits from either ordinary or ISO children can settle into
their **direct parent**. Separate ISO trading collateral therefore does not
guarantee that a residual deficit can never affect the parent. If a parent
itself becomes eligible with a remaining deficit, debt can propagate farther
up the account tree through its own parent.

The protocol can settle eligible descendants before assessing a transfer,
withdrawal lock or funded child creation. Unresolved descendant debt can block
an outflow. A child that still has open positions need not be eligible for
immediate collection.

> [!WARNING]
>
> **An outflow rejection does not guarantee unchanged account state.** Debt
> settlement, including cancellation of a debtor's live orders, can occur before
> the requested outflow subsequently rejects. The rejected outflow and the earlier
> debt collection are different effects.

For example, suppose a parent has 200 of collateral, an ordinary child has a
flat deficit of 100, and its ISO child has a flat deficit of 25. Collection can
leave the parent with 75 and the children with zero. A requested outflow of 100
can then reject: the requested payment did not occur, but the earlier debt
collection remains applied.

After a rejection, inspect the action result and refresh the affected parent
and children before recalculating transfer capacity or retrying. Do not infer
success from HTTP `200` or top-level `status: "ok"` alone.

Automatic child-debt collection is not exposed as a dedicated account-history
or account-WebSocket activity entry in this release. Use refreshed current
account state when reconciling these adjustments; do not rely on transfer
history alone to reconstruct them.

## 4. Read and Render Separate Margin Pools

### Response Before and After

Previously, a parent's `positions` and `openOrders` mixed its own rows with ISO
rows identified by `isoPubkey`. They now contain only the parent's own rows.
Each ISO account has its own `margin`, `positions` and `openOrders` inside
`isoAccounts`.

These are **partial HTTP `fullAccount` responses** showing selected fields.
The same parent has a SOL position and order, a BTC ISO account, and an ordinary
sub-account. Balances and margin requirements are illustrative.

```json Before theme={null}
[
  {
    "fullAccount": {
      "name": null,
      "margin": {
        "totalMargin": 1000.0,
        "marginUsed": 50.0,
        "aggTotalMargin": 1200.0,
        "aggMarginUsed": 70.0
      },
      "positions": [
        {"symbol": "SOL-USD", "size": 1.0},
        {"symbol": "BTC-USD", "size": 0.01, "iso": true, "isoPubkey": "<btc-iso-account>"}
      ],
      "openOrders": [
        {"symbol": "SOL-USD", "orderId": "<sol-order>"},
        {"symbol": "BTC-USD", "orderId": "<btc-order>", "iso": true, "isoPubkey": "<btc-iso-account>"}
      ],
      "subAccounts": [
        {"pubkey": "<ordinary-sub-account>"}
      ]
    }
  }
]
```

```json After v1.0.35 theme={null}
[
  {
    "fullAccount": {
      "name": null,
      "margin": {
        "totalMargin": 1000.0,
        "marginUsed": 50.0
      },
      "positions": [
        {"symbol": "SOL-USD", "size": 1.0}
      ],
      "openOrders": [
        {"symbol": "SOL-USD", "orderId": "<sol-order>"}
      ],
      "isoAccounts": [
        {
          "pubkey": "<btc-iso-account>",
          "symbol": "BTC-USD",
          "margin": {
            "totalMargin": 200.0,
            "marginUsed": 20.0
          },
          "positions": [
            {"symbol": "BTC-USD", "size": 0.01}
          ],
          "openOrders": [
            {"symbol": "BTC-USD", "orderId": "<btc-order>"}
          ]
        }
      ],
      "subAccounts": [
        {"pubkey": "<ordinary-sub-account>", "name": "desk-1"}
      ]
    }
  }
]
```

Read the updated response as follows:

| Data | Read from |
| - | - |
| Parent margin, SOL position and SOL order | `fullAccount.margin`, `fullAccount.positions`, `fullAccount.openOrders` |
| BTC ISO account identity and market | `fullAccount.isoAccounts[0].pubkey`, `fullAccount.isoAccounts[0].symbol` |
| BTC ISO margin, position and order | `fullAccount.isoAccounts[0].margin`, `.positions`, `.openOrders` |
| Ordinary sub-account reference | `fullAccount.subAccounts[0].pubkey` and `.name`; query that public key for its state |

The parent's `totalMargin` remains 1,000. The BTC ISO account's 200 is shown
separately. Removing `aggTotalMargin: 1200` does not remove collateral; it removes
the combined display field. Likewise, the parent's `marginUsed` remains 50 and
the ISO account's 20 is separate.

Nested ISO position and order rows no longer repeat `iso` or `isoPubkey`. Their
account identity is the enclosing `isoAccounts[].pubkey`. Standalone updates,
direct ISO account responses and history retain their ISO identifiers.

`pendingOnFill`, when present, belongs to the account that contains it. Empty
optional collections such as `isoAccounts`, `subAccounts` and `pendingOnFill`
can be omitted; treat an absent collection as empty.

### Removed Margin Fields

The following fields are removed from `margin`:

```text theme={null}
aggTotalMargin
aggAvailableMargin
aggExecutionImpact
aggTransferableBalance
aggMarginUsed
aggBufferedMargin
aggNotional
aggRealizedPnl
aggUnrealizedPnl
aggFees
aggFunding
```

### HTTP Queries and WebSocket Snapshots

The HTTP full-account request remains:

```json theme={null}
{"type": "fullAccount", "user": "<parent-account>"}
```

Send it to `POST /api/v1/account`. The response remains an array of
`{"fullAccount": ...}` items. Account WebSockets use the same account fields
inside `data` of a message with `type: "account"`,
`data.type: "accountSnapshot"` and topic `account.<pubkey>`; they do not add the HTTP
`fullAccount` wrapper. Incremental `positionUpdate` and `orderUpdate` messages
remain separate message types.

The parent `openOrders` query now returns **parent-local** orders. Read
`fullAccount.isoAccounts[].openOrders` or query the ISO account directly for its
orders. The `positions` HTTP query type is **closed-position history**, not a
replacement for reading current positions from `fullAccount`.

Keep the ISO account's public key, parent and market from funding and from the
parent's `isoAccounts` collection, including when the account is empty. A direct query of an empty,
unnamed ISO does not reliably expose its assigned market through its name or
position rows. Do not infer the market by parsing a display name.

### Rendering Checklist

1. Render the requested account's margin, positions and orders as its own pool.
2. Render each `isoAccounts[]` entry as a separate pool, keyed by `pubkey`.
3. Treat ordinary `subAccounts[]` as navigation references and fetch their
   account state separately, including their own ISO accounts.
4. Route standalone ISO updates and history using their ISO identifiers.
5. If showing an informational total across pools, label it clearly. Do not
   present summed available margin as collateral immediately usable by any one
   pool. Funding and outflow checks still apply to the relevant accounts.

## 5. Update Your Signing Library

> [!TIP]
>
> **No signing change for ordinary trading.** Transactions containing only existing
> order actions and transfers without `symbol` keep their current signing format.
> To create or fund an ISO account using the new transfer `symbol` field, update
> to **bulk-keychain 0.1.35** (or **bulk-keychain-wasm 0.1.35** for browsers).

Use [bulk-keychain 0.1.35](https://github.com/Bulk-trade/bulk-keychain/releases/tag/v0.1.35)
for the new ISO transfer flow. Choose the package for your language and runtime:

| Library | Published version and links | Runtime |
| - | - | - |
| `bulk-keychain` | **0.1.35** · [Rust](https://crates.io/crates/bulk-keychain/0.1.35) · [Node.js](https://www.npmjs.com/package/bulk-keychain/v/0.1.35) · [Python](https://pypi.org/project/bulk-keychain/0.1.35/) | Rust, Node.js and Python |
| `bulk-keychain-wasm` | **[0.1.35](https://www.npmjs.com/package/bulk-keychain-wasm/v/0.1.35)** | Browser signing |

Update your application's HTTP and WebSocket account-response parsers separately
using the response changes above.

## Client Readiness Checklist

* Use `bulk-keychain` 0.1.35, or `bulk-keychain-wasm` 0.1.35 for browsers, for the new ISO transfer flow.
* Add explicit account creation/funding before immediate or deferred ISO orders.
* Keep positive account collateral visible after a close or cancellation.
* Require eligible account removal before switching that parent/market to cross.
* Count ordinary and ISO children together against the 64-child limit.
* Refresh affected account state after an outflow rejection that may have
  collected child debt.
* Replace `agg*` parsing and flattened ISO collections with separate pool views.
* Preserve ISO identifiers in standalone updates and history handlers.
* Exercise these flows on testnet before the scheduled mainnet deployment.

See the [upcoming changelog entry](https://docs.bulk.trade/api-reference/changelog.md#v1-0-35-10th-december-2026)
for the release summary. Existing [Transfer](https://docs.bulk.trade/api-reference/transfer.md),
[Account Queries](https://docs.bulk.trade/api-reference/getAccount.md) and
[Signing](https://docs.bulk.trade/api-reference/signing.md) pages remain useful for shared endpoint and
envelope conventions; use this guide for the v1.0.35 differences described above.


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