Open a session
Opens a session from a grant signed by the account owner. The grant’s signature is the authentication, so no token is needed.
The session key named in the grant can then sign in with POST /v1/auth
for the granting account and for each listed subaccount, one token per
account. A session can trade within its scopes and limits but can never
withdraw or transfer funds.
grant is the SessionGrant message exactly as signed, with its camelCase
field names. EVM-owned accounts sign it as EIP-712 (signature_type
eip712, with the wallet’s current chain as signature_chain_id);
Stark-owned accounts sign it as SNIP-12 (snip12) with their main key.
Grants naming a builder are accepted from EVM-owned accounts only.
Every limit is stated in the grant: a positive decimal, or none for no cap.
markets lists at least one market, * meaning every permitted market. The
limits are stored exactly as signed, with no server defaults. The server
accepts a number only for the limits it enforces: every other limit must be
none, and markets ["*"], or the request returns LIMIT_INVALID.
Builder grants follow the same rules. Where the server caps a limit, a value over
the cap, or none, returns LIMIT_INVALID. A builder maxFeeRate of zero,
with more than 8 decimal places, or over the server cap returns
INVALID_GRANT. A grant naming a builder from an account that cannot
approve builders yet returns SESSIONS_DISABLED.
A grant from a wallet with no Paradex account opens the account and its first
session in one call. The account is deployed when it is first funded. It takes
the checks onboarding takes, so it can also answer the onboarding errors below,
and it lists no subaccounts. referral_code, marketing_code and utm work
as on POST /v2/onboarding and are read only for such a request; they are not
part of what the wallet signs, so a grant naming a builder ignores them. A
PARADEX-PRIVY-ACCESS-TOKEN header skips the balance check for a verified Privy
user’s wallet. Contract wallets cannot open an account this way.
Each grant can be used once: resubmitting it, or another grant with the same
nonce, returns NONCE_REUSED. Every grant needs a fresh session key: a key
once used by a session, even one revoked or expired, returns
SESSION_KEY_IN_USE. The grant must use the field names exactly as defined,
each once per object, or it returns INVALID_GRANT. A grant that names a
builder also records the builder approval for every listed account; revoking
the session later does not revoke that approval.
Headers
Used only when the grant opens a new account: a Privy token for the signing wallet skips the balance check
Request
The owner’s signature: one 0x-hex r||s||v string for eip712; for snip12 the string ’[“0xr”,“0xs”]’, as orders carry it (a bare [r, s] array is also accepted).
eip712 for EIP-191 (EVM-owned) accounts, snip12 for Stark-owned accounts.
Marketing code of the campaign the owner came through. Used only when this grant opens a new account; not signed.
Referral code of the user who referred the owner. Used only when this grant opens a new account; not signed.
The EIP-712 domain chainId the wallet signed with. Required for eip712, ignored for snip12.
UTM tracking parameters. Used only when this grant opens a new account; not signed.
Response
Every account the session can trade: the granting account, then its listed subaccounts.
The grant id: the grant’s hash, 0x and 64 hex characters.