WebSocket API

Arkis provides a WebSocket API that delivers real-time maintenance updates on borrowings, including position details and the calculated risk factor. It uses the WebSocket protocol provided by the Centrifuge library. To receive real-time maintenance updates, use an official Centrifuge client. You will also need to generate an API key in the Arkis App settings and present it as a credential when connecting with the Centrifuge client. The sections below walk through each step and include development documentation.

Create a new API key

  1. Click on "Create API Key" button in the top right corner.

  2. Enter a token name, select an expiration date from the predefined options or specify a custom date, and choose the desired permissions.

  3. Click "Create API Key" to proceed.

Visual walkthrough
  1. Click on "Create API Key" button in the top right corner.

  1. Enter a token name, select an expiration date from the predefined options or specify a custom date, and choose the desired permissions.

Integrate the API with the Centrifuge Client

Now that your token has been generated, you can use one of the official Centrifuge clients to subscribe to Arkis real-time maintenance updates.

Prerequisites

Connection info

URL wss://api.arkis.xyz/e/v1/ws

Channel maintenance:wallet:{owner_wallet}

Tested client versions

Language
Client version
Runtime version

JavaScript

NodeJS v22.18.0

Go

go1.23.12

Python

Python 3.13.7

Examples

Below are examples in several popular programming languages. Replace <API TOKEN> with your generated token. Never hardcode or commit the token to your codebase. Replace <OWNER WALLET> with the checksummed address of wallet that was used to open the Margin Account.

Revoke an API key

  1. Locate the key by its name or tail (the last six characters of the key).

  2. Click "Revoke".

Visual walkthrough
  1. Locate the key by its name or tail (the last six characters of the key).

  1. Click "Revoke".

Last updated