Aquanow
Legacy
Legacy
  • About Aquanow
    • Introduction
  • VERSION DIFFERENCES
    • Latest vs Legacy
  • User Guide
    • Trading
      • Order Book
      • Submitting Orders
      • Order Types / Strategies
      • Trade Management
    • Automated Conversions
      • Autopilot
    • Deposits & Withdrawals
      • Deposits
      • Withdrawals
      • Balances
      • Transaction History
      • Approval Workflows
    • Account Management
      • CSV Exports
      • Address Management
      • IP Whitelisting
      • User List
  • Integration Guide
    • API Keys
      • Rate and API Key Limits
    • Authentication
    • Staging environment
    • Postman
    • Supported Assets and Tickers
    • Testnet and Faucet
  • API Endpoints | V1.0
    • Accounts API
      • User Balances
      • API Keys
    • Transaction API
      • Get Transactions
      • Create Transactions
      • Approvals API
      • Get Withdrawal Fee Estimate
    • Executions API
      • GET or Query Orders
      • Trading Strategies
    • Market Data API
      • Authorized Market Data
  • API Endpoints | V2.0
    • Transaction API
      • Get Transactions
    • Executions API
      • GET or Query Orders
      • Trading Strategies
  • Webhooks
    • Subscribing to Webhooks
    • Transaction Webhook
  • Websockets
    • Introduction
    • Authenticated Websockets
      • Market Data Websocket
      • Reporting Websocket
  • Data Objects & Statuses
    • Websocket Objects
    • Transaction Objects
      • Approval Objects
      • Fee Estimate Objects
    • Accounts Objects
    • Executions Objects
      • Duration Order Objects
    • Market Data Objects
    • Statuses
  • FAQs and Misc. Information
    • FAQs
    • Misc. Information
Powered by GitBook
On this page
  • Websocket Endpoints
  • Websocket Access and Authorization
  • Example Usage
  1. Websockets
  2. Authenticated Websockets

Reporting Websocket

This channel allows you to keep up to date with the status of your account. You can receive updates on your balances and orders. Each request requires authentication with signatures.

PreviousMarket Data WebsocketNextWebsocket Objects

Websocket Endpoints

Environments

There are two environments to access our authorized market data feeds:

  1. Live

wss://report.aquanow.io:8081/
  1. Sandbox

wss://report-staging.aquanow.io:8081/

Websocket Access and Authorization

API Authentication is done using an API key and a secret. User needs to associate the following information in the payload of the subscription message. View the for more detail.

Request Parameters

Name
Type
Description

apiKey

String

API key

apiSignature

String

Signature created using API secret

channel

String

Channel of subscription

type

String

Type of action; subscribe or unsubscribe

nonce

String

Numeric string timestamp in milliseconds

There are three channels you can subscribe for:

  1. executionReport - all order and balance updates

  2. parentOrderReport - all order updates

  3. balanceReport - all balance updates

Example Usage

const WebSocket = require("ws");
const crypto = require("crypto");

const ws = new WebSocket("");


const apiKey = "";
const secret = "";


function subscribeToOrders() {
  const timestamp = Date.now().toString();
  const payload = {
    type: "subscribe",
    channel: "executionReport",
    nonce: timestamp
  };
  const apiSignature = crypto
    .createHmac("sha384", secret)
    .update(JSON.stringify(payload))
    .digest("hex");


  const subsOption = JSON.stringify({
    ...payload,
    apiKey,
    apiSignature
  });


  ws.send(subsOption);
}


ws.on("open", () => {
  console.log(WS tunnel opened - trade);
  subscribeToOrders({ apiKey, secret });
});


ws.on("message", data => {
  console.log("data", data);
});
const WebSocket = require("ws");
const crypto = require("crypto");

const ws = new WebSocket("");


const apiKey = "";
const secret = "";


function subscribeToOrders() {
  const timestamp = Date.now().toString();
  const payload = {
    type: "subscribe",
    channel: "parentOrderReport",
    nonce: timestamp
  };
  const apiSignature = crypto
    .createHmac("sha384", secret)
    .update(JSON.stringify(payload))
    .digest("hex");


  const subsOption = JSON.stringify({
    ...payload,
    apiKey,
    apiSignature
  });


  ws.send(subsOption);
}


ws.on("open", () => {
  console.log(WS tunnel opened - trade);
  subscribeToOrders({ apiKey, secret });
});


ws.on("message", data => {
  console.log("data", data);
});java
const WebSocket = require("ws");
const crypto = require("crypto");

const ws = new WebSocket("");


const apiKey = "";
const secret = "";


function subscribeToOrders() {
  const timestamp = Date.now().toString();
  const payload = {
    type: "subscribe",
    channel: "balanceReport",
    nonce: timestamp
  };
  const apiSignature = crypto
    .createHmac("sha384", secret)
    .update(JSON.stringify(payload))
    .digest("hex");


  const subsOption = JSON.stringify({
    ...payload,
    apiKey,
    apiSignature
  });


  ws.send(subsOption);
}


ws.on("open", () => {
  console.log(WS tunnel opened - trade);
  subscribeToOrders({ apiKey, secret });
});


ws.on("message", data => {
  console.log("data", data);
});

Example Response

Balance Update

{
  "type": "balance",
  "payload": {
    "createdAt": 1554400262916,
    "symbol": "BTC",
    "totalBalance": 2.30044886,
    "depositAddress": "-",
    "usernameSymbol": "helloWorld_BTC",
    "pendingTransfer": 0,
    "itemDateTime": 1557267645512,
    "availableBalance": 2.24044886,
    "updatedAt": 1554400262916,
    "username": "helloWorld"
  }
}

Order Update

{
  "type": "order",
  "payload": {
    "createdAt": 1557267645477,
    "symbol": "BTC-USD",
    "totalBalance": 2.40047884,
    "depositAddress": "-",
    "usernameSymbol": "helloWorld_BTC",
    "pendingTransfer": 0,
    "itemDateTime": 1557267645646,
    "availableBalance": 2.24044886,
    "updatedAt": 1557267645477,
    "username": "helloWorld"
  }
}
{
  "type": "order",
  "payload": {
    "createdAt": 1557267645477,
    "symbol": "BTC-USD",
    "totalBalance": 2.40047884,
    "depositAddress": "-",
    "usernameSymbol": "helloWorld_BTC",
    "pendingTransfer": 0,
    "itemDateTime": 1557267645646,
    "availableBalance": 2.24044886,
    "updatedAt": 1557267645477,
    "username": "helloWorld"
  }
}
{
  "type": "balance",
  "payload": {
    "createdAt": 1554400262916,
    "symbol": "BTC",
    "totalBalance": 2.30044886,
    "depositAddress": "-",
    "usernameSymbol": "helloWorld_BTC",
    "pendingTransfer": 0,
    "itemDateTime": 1557267645512,
    "availableBalance": 2.24044886,
    "updatedAt": 1554400262916,
    "username": "helloWorld"
  }
}

Returns an .

Returns an .

Authorization page
AuthenticateObject
AuthenticateObject