You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- use `secondary:N` for sub-accounts that hold funds or trade independently
435
+
- only set `routeViaMaster=true` when the exchange requires master-executed withdrawals
436
+
437
+
#### Meaning of `sourceAccount` and `masterAccount`
438
+
439
+
-`sourceAccount`: the account that currently holds the funds
440
+
-`masterAccount`: the account that should perform the final external withdraw
441
+
442
+
Accepted selector values:
443
+
444
+
-`primary`
445
+
-`secondary:1`, `secondary:2`, ...
446
+
-`current` for `sourceAccount`, which means "whatever account was selected by metadata or by default"
447
+
448
+
#### Purpose of `role`, `uid`, `email`, and `subAccountId`
449
+
450
+
These fields are **not all required today**, and for the current Binance implementation they are mostly future-proofing rather than something you must configure immediately.
451
+
452
+
-`role`: broker-level intent. This is the useful one today. It marks an account as `master` or `subaccount` and makes configuration easier to audit.
453
+
-`email`: exchange-specific sub-account identifier. Some exchanges identify sub-accounts by email rather than by API key relationship.
454
+
-`subAccountId`: exchange-specific sub-account identifier used by APIs that require an explicit account id.
455
+
-`uid`: exchange-specific account/user identifier required by some transfer APIs.
456
+
457
+
If you enforce the convention that **primary is always the master account**, then yes, `uid`, `email`, and `subAccountId` are redundant for the current Binance flow.
458
+
459
+
They still exist for two reasons:
460
+
461
+
- to support future exchange adapters where API keys alone are not enough to identify the transfer source or destination
462
+
- to make the broker config model stable now instead of redesigning it later per exchange
463
+
464
+
Practical rule:
465
+
466
+
- for Binance today, configure `primary` as master and `secondary:N` as sub-accounts; `role` is optional but recommended
467
+
- you do not need `uid`, `email`, or `subAccountId` unless a future exchange adapter requires them
468
+
469
+
#### Does deposit require the same setup?
470
+
471
+
Usually no.
472
+
473
+
Deposits are different from withdrawals:
474
+
475
+
- withdrawals may require a master account to authorize the external transfer
476
+
- deposits usually just require fetching the deposit address for the account or sub-account you want to receive funds
477
+
478
+
So the normal approach is:
479
+
480
+
- deposit directly to the intended target account or sub-account
481
+
- only do an internal transfer afterward if funds landed in the wrong internal account for your workflow
482
+
379
483
### Zero-Knowledge Proof Integration
380
484
381
485
**Enable privacy-preserving proof over CEX data** with [Verity zkTLS integration](https://github.com/usherlabs/verity-dp):
0 commit comments