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
Go to "API Key Management" page.
Click on "Create API Key" button in the top right corner.
Enter a token name, select an expiration date from the predefined options or specify a custom date, and choose the desired permissions.
Click "Create API Key" to proceed.
The token is displayed only once. Make sure to copy it immediately and store it securely. Do not save the token in plain text files. If the token is lost or compromised, it must be manually revoked: Revoke an API key.
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}
Address of wallet must be checksummed: more info.
Tested client versions
If you're using NodeJS version earlier than v22.4.0 it does not include a built-in WebSocket implementation, so it must be provided manually: more info.
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
Only an Organization Admin can revoke an API key
Go to "API Key Management" page.
Locate the key by its name or tail (the last six characters of the key).
Click "Revoke".
Last updated






