Tenants
The tenant is the owner of your trading resources. Every account belongs to exactly one tenant, and your API keys are created under it.- Find your tenant ID next to your API keys on the DevTools page of the Plurex app.
- API keys act as the tenant. A request signed with your
X-API-KEYandX-API-SECREThas full access to the tenant’s accounts. - Tenant-wide operations take a
tenantId: Connect, List accounts and Create a paper account.
Accounts
An account is your account on one host. It lives on exactly one host for its whole life, and every operation on it takes only itsaccountId: Plurex resolves the host and checks your access from the account itself. You never pass a hostId or tenantId to trade.
credential.publicValue is the non-secret part of the credential, such as the API key, so you can tell which key an account uses. The secret is never returned. For a paper account publicValue is null and credentialType is Paper.
Real and paper accounts
Creation is the only part that differs: connecting an account links an existing exchange account, while creating a paper account starts a new simulation. After that, both kinds are traded and managed through the same operations, so code written against a paper account runs against a real one by switching the
accountId. Read each host’s capabilities before you switch, because paper and real hosts publish their own. See Going live.
Connecting an exchange account
Connect adds an exchange account using its API credentials. The host must listApiKey in supportedCredentialTypes.
- The key must allow reading and trading. Plurex needs to read your orders, balances and positions, and to place and cancel orders.
- Bybit keys must belong to a Unified Trading Account.
- A refused key creates no account. Connect verifies the key with the exchange and refuses it if the exchange rejects it or the key cannot read and trade. Retrying with the same key will not help: fix the key’s permissions at the exchange, or create a new key, then connect again.
Creating a paper account
Create a paper account takes yourtenantId, a name and the hostId of a paper host. Find paper hosts with List hosts: they have isPaper: true, and modelHostId names the real host each one simulates.
422 AccountLimit. See Paper trading.
Account lifecycle
For example, to list only your paper accounts:
Retry safety
A timeout or5xx does not prove that a command had no effect. Each account operation tells you how to recover:
Identify the new account by what it is, not by its name: after an unclear Connect, look for an account on the
hostId you sent whose credential.publicValue is the exchange key you sent; after an unclear Create, compare the list for that paper hostId with the accounts you already knew about. Names are labels for you; don’t rely on them to tell accounts apart.
Errors to expect
See Errors for the full list.
Related
- Venues and hosts for where accounts fit.
- Authentication for API keys.
- Add an exchange to connect an account in the web app.
- Paper trading to create, fund and trade paper accounts.