Why create your own users
If you run one SX Bet account for your whole platform, every user’s bets land in one balance and one history, and you tell them apart withexternalUserId. See
Account models.
The Partner API gives each user their own account instead:
- Per-user balances and risk. Funds, open orders, positions and settlements are separate for every user, so one user’s activity never touches another’s.
- Per-user history. Orders, fills, bets and the ledger come back per account, with no attribution layer to maintain.
- You stay in control. You choose which permissions each user’s API key gets, and you keep the key. SX Bet never sees a user’s private key.
- No separate sign-up. Users are created from your backend in one call. They don’t need an sx.bet login.
- Externally owned accounts. The signature must recover to the user’s address, from
eth_signTypedData_v4on a standard externally owned account. Contract-wallet signatures (EIP-1271) are not accepted. - Server-side integration. Anything done on behalf of the user is done server side with the API key, which gives you complete control over your front-end
How it works
There are two kinds of key.Only new addresses can be added. If an address already has an SX Bet account, create-user refuses
it.
Becoming a partner
1
Register on sx.bet and reach out
Register an account on sx.bet, then email
business@sx.bet with the email address you registered with, your
platform, what you’re building and roughly how many users you expect. Each person or system that
needs a partner key registers their own account and sends us its email. We’ll get back to you.
2
We set you up
We create your partner account and send you your partner ID and your partner keys, each
issued on the account you registered. Partner keys are per environment, so you get separate keys
for testnet and mainnet. For testnet keys, register on
toronto.sx.bet too and send us that email.
3
Create users
Create a user for each new wallet, as described below.
4
Trade for your users
Use each user’s key with the standard API: deploy their proxy wallet, fund it and place orders.
Create a user
Send every Partner API request with your partner key in thex-sx-api-key header.
1
Get the statement to sign
Call
GET /partner/attestation with the user’s wallet
address. It returns EIP-712 typed data with your partner ID, the address and the environment’s
chain ID filled in.2
Sign it with the user's wallet
Sign the typed data with the wallet that will own the account (
eth_signTypedData_v4).3
Create the user
Call
POST /partner/users with the address, the user’s
email, the permissions for their API key and the signature. The response includes the user’s
API key.4
Store the user key
The key is shown once. Store it securely before doing anything else. It cannot be fetched
again.
wallet: admin if you will deploy the user’s proxy wallet with their key.
After a user is created
The user’s account is ready, and their proxy wallet is being deployed. From here on, use the user key, not your partner key.- Wait for the proxy wallet. The create response reports the deployment status in
proxyDeployment.status:SUCCESS: deployed, carry on.PENDING: a deployment is running. Don’t start another; pollGET /partner/usersuntil the user’sproxyDeployedistrue.FAILEDorNOT_STARTED: callPOST /user/deploy-proxywith the user key, then poll the same way.
- Fund it. Send funds to the user’s
proxyWalletAddressonly after deployment completes. See Funding. - Trade. Place orders with
POST /orders-v3. Each order is signed by the user’s wallet, as for any account.
View your users
GET /partner/users lists the users you have created, newest
first, with each user’s wallet, proxy wallet, email, status and whether their proxy wallet is
deployed. Filter by address to look up one user.
A user’s status is SUSPENDED while SX Bet has suspended the account, and ACTIVE otherwise. A
suspended user cannot place orders.
Rate limits
Each partner key has its own rate limit, separate from your other partner keys and from your users’ keys. By default a partner key can create up to 100 users per 60 seconds, and listing users has its own, separate limit. User keys follow the standard rate limits, counted per user.Managing users
Today, to suspend a user, contact us and we make the change.Related
Create a user
POST /partner/users: request, response and errors.List your users
GET /partner/users: filters and pagination.Get the attestation
GET /partner/attestation: the typed data a wallet signs.API key permissions
Scopes you can give your users’ keys.