Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

vaultTransfer

Moves USDC between the account's perp balance and a vault. isDeposit: true deposits usd from the perp account into the vault; isDeposit: false withdraws usd from the account's vault equity back to it. The action is signed by an approved agent.

POST/exchangetype vaultTransfer

Deposit USDC from the perp account into a vault, or withdraw it back.Agent-signed

Action fields
isDepositbooleanrequired

`true` deposits into the vault, `false` withdraws from it.

tokenstringrequired

`NAME:address` of the network USDC contract. Vault transfers are USDC-only.

typestringrequired

Must be `vaultTransfer`.

"vaultTransfer"
usdstringrequired

USDC amount in token units, at most 6 decimal places.

vaultAddressstring · addressrequired

Vault to deposit into or withdraw from. Hex on the wire; hashed as its 20 raw bytes.

Request example
curl -X POST https://rpc.txflow-testnet.xyz/exchange \
  -H "Content-Type: application/json" \
  -H "x-api-version: 2026-08-16" \
  -d '{
  "action": {
    "type": "vaultTransfer",
    "vaultAddress": "0x0303030303030303030303030303030303030303",
    "usd": "100",
    "isDeposit": true,
    "token": "USDC:0xd04f0d19E8FbA49cfA541E272F9C60a2ad720464"
  },
  "signature": {
    "r": "0x<r>",
    "s": "0x<s>",
    "v": 27
  },
  "nonce": 1757992743994,
  "vaultAddress": null,
  "signatureChainId": null
}'
Try it
Response · VaultTransfer 200
codeinteger

`0` on success.

dataobject
dataobject
typestring

The action's internal name, which does not always match the request `type`.

"VaultTransfer"
statusstring

A rejected request returns `err` with a non-zero `code` and the reason in `message` (or `response`).

"ok"
Response example
{
  "status": "ok",
  "code": 0,
  "data": {
    "type": "VaultTransfer",
    "data": {
      "statuses": [
        "success"
      ]
    }
  }
}

Signing

vaultTransfer is agent-signed with two differences from other actions:

  • vaultAddress inside the action is hashed as its 20 raw bytes (MessagePack binary), while the JSON body carries the hex string.
  • The hash always ends with a 0x00 vault flag. Send the envelope vaultAddress as null; the target vault is already in the action.

Keep the key order vaultAddress, usd, isDeposit, token. See MessagePack rules.

Next steps

Confirm the transfer and the new vault equity on vaultUpdates. The perp balance change shows in clearinghouseState.