100x API documentation

General Info

If you need support please contact us at [email protected]. or join our API integration telegram chat at https://t.me/+tRoJlL37Ih02YzA0 where you will have direct access to the team.

100x is available with Rest API and Websocket.

As of 23/02/2023 the APIs are still subject to change as they are still under active development, this will be communicated promptly in the telegram chat, once the API is frozen, all chats will be informed. During this period, if you run into issues please ping the team straightaway, this will be very useful during the early stages of API consumption.

If anything is unclear or not explained please inform us immediately and we will fix it.

The docs are split into:

  • Constructing EIP712 signatures - how to build EIP712 signature for API authentication
  • 100x Public Rest - public endpoints that require no authentication
  • 100x Auth Rest - endpoints that require authentication either via login OR through providing an EIP712 SignedAuthentication signature signed by the account owner
  • 100x Websockets - see the 100x websocket introduction

Cloud Details: GCP Tokyo

Endpoints

The following base endpoints are available:

Production

REST API: https://api.100x.finance

WEBSOCKET: https://api.100x.finance/ws/operate

Staging

REST API: https://api.staging.100x.finance

WEBSOCKET: https://api.staging.100x.finance/ws/operate

All endpoints return either a simple string, JSON object or array.

A word on signatures

All endpoints that check signatures rely on EIP712 signing. For details on EIP712 signing let us know what your preferred language is and we can direct you to the correct way of constructing these signatures. And make sure to read Constructing EIP712 signatures in the following section.

Here is the typed data definition in go:

var EIP712_TYPES = &apitypes.Types{
	"EIP712Domain": {
		{
			Name: "name", // 100x
			Type: "string",
		},
		{
			Name: "version", // "0.0.0"
			Type: "string",
		},
		{
			Name: "chainId", // 168587773 - Blast testnet | 
			Type: "uint256",
		},
		{
			Name: "verifyingContract", // ORDER_DISPATCH_ADDRESS
			Type: "address",
		},
	},
	"LoginMessage": {
		{
			Name: "account",
			Type: "address",
		},
		{
			Name: "message",
			Type: "string",
		},
		{
			Name: "timestamp",
			Type: "uint64",
		},
	},
	"Order": {
		{
			Name: "account",
			Type: "address",
		},
		{
			Name: "subAccountId",
			Type: "uint8",
		},
		{
			Name: "productId",
			Type: "uint32",
		},
		{
			Name: "isBuy",
			Type: "bool",
		},
		{
			Name: "orderType",
			Type: "uint8",
		},
		{
			Name: "timeInForce",
			Type: "uint8",
		},
		{
			Name: "expiration",
			Type: "uint64",
		},
		{
			Name: "price",
			Type: "uint128",
		},
		{
			Name: "quantity",
			Type: "uint128",
		},
		{
			Name: "nonce",
			Type: "uint64",
		},
	},
	"CancelOrders": {
		{
			Name: "account",
			Type: "address",
		},
		{
			Name: "subAccountId",
			Type: "uint8",
		},
		{
			Name: "productId",
			Type: "uint32",
		},
	},
	"CancelOrder": {
		{
			Name: "account",
			Type: "address",
		},
		{
			Name: "subAccountId",
			Type: "uint8",
		},
		{
			Name: "productId",
			Type: "uint32",
		},
		{
			Name: "orderId",
			Type: "string",
		},
	},
	"ApproveSigner": {
		{
			Name: "account",
			Type: "address",
		},
		{
			Name: "subAccountId",
			Type: "uint8",
		},
		{
			Name: "approvedSigner",
			Type: "address",
		},
		{
			Name: "isApproved",
			Type: "bool",
		},
		{
			Name: "nonce",
			Type: "uint64",
		},
	},
	"Deposit": {
		{
			Name: "account",
			Type: "address",
		},
		{
			Name: "subAccountId",
			Type: "uint8",
		},
		{
			Name: "asset",
			Type: "address",
		},
		{
			Name: "quantity",
			Type: "uint256",
		},
		{
			Name: "nonce",
			Type: "uint64",
		},
	},
	"Withdraw": {
		{
			Name: "account",
			Type: "address",
		},
		{
			Name: "subAccountId",
			Type: "uint8",
		},
		{
			Name: "asset",
			Type: "address",
		},
		{
			Name: "quantity",
			Type: "uint128",
		},
		{
			Name: "nonce",
			Type: "uint64",
		},
	},
	"SignedAuthentication": {
		{
			Name: "account",
			Type: "address",
		},
		{
			Name: "subAccountId",
			Type: "uint8",
		},
	},
}

Endpoints for reading data require either one of the following forms of authentication:

  • Attaching a signature of account and subAccountId params
  • Logging in via the /v1/session/login endpoint and only using the required query params

All endpoints to update state require a signature in the request's body.