API Reference

rysk 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.

rysk is available with Rest API and Websocket.

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
  • rysk Public Rest - public endpoints that require no authentication
  • rysk Auth Rest - endpoints that require authentication either via login OR through providing an EIP712 SignedAuthentication signature signed by the account owner
  • rysk Websockets - see the rysk websocket introduction

Endpoints

The following base endpoints are available:

Production

REST API: https://api.prod.rysk.finance

WEBSOCKET: https://api.prod.rysk.finance/v1/ws/operate

Staging

REST API: https://api.staging.rysk.finance

WEBSOCKET: https://api.staging.rysk.finance/v1/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", // rysk
			Type: "string",
		},
		{
			Name: "version", // "0.0.0"
			Type: "string",
		},
		{
			Name: "chainId", // 421614 - ARBITRUM testnet || 42161 - ARBITRUM mainnet
			Type: "uint256",
		},
		{
			Name: "verifyingContract", // OrderDispatch Arbitrum Mainnet | 0x6644D5B09EBae015fE4e3a87Eff1A07d33558E59
			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.