Author

Topic: Coygo API - A node.js toolkit for building cryptocurrency trading bots & more (Read 68 times)

jr. member
Activity: 88
Merit: 9
Hey everyone,

https://www.coygo.app/api.html

The Coygo API has been announced recently as a node.js toolkit for building trading bots, reporting dashboards, real-time analytics systems, and anything else that reads data from and interacts with exchanges. This is the same API that powers the Coygo app internally.

This isn't a rest API as a remote service, this is a node.js package that you can use in your own node.js codebase. API keys are only stored on your hard drive, you provide them to the library. Coygo's servers never touch your API keys. Your machine is connected directly to each exchange, Coygo's servers don't act as a middle man. That means there is no latency when using this API.

Some benefits include:

  • Unified API - One API for every supported exchange.
  • Your Infrastructure - You run the library on your own infrastrcture, Coygo's servers never have access to your accounts.
  • Zero Latency - Connect your machine directly to each exchange for real-time data, no middleman means no latency.
  • Derived Data - Access derived calculations from order book data including order book superiority and true cost determination.
  • Smart Order Routing - Calculation potential smart order router orders using order book data across multiple exchanges to ensure the best rate.
  • Trading - Submit trades of multiple order types and manage open orders across every supported exchange.
  • Transfer - Transfer between wallets at different exchanges, retrieve deposit addresses, and send to personal wallets.
  • Crypto Arbitrage API - Real-time tickers and calculated spreads for any trading pair across multiple exchanges.
  • Portfolio tracking - Read balances of all of your exchange wallets along with their USD estimated value using public market data.

You can learn more and sign up for early access at https://www.coygo.app/api.html

Any feedback is welcome!

Code examples
In this code example we will listen for real-time order book updates from Kraken.

Code:
import { Coygo, SUPPORTED_EXCHANGE_IDS } from 'coygo-api';
// set up coygo instance and each exchange
const coygo = new Coygo({
  apiKey: '',
  exchanges: [
    {
      exchangeId: SUPPORTED_EXCHANGE_IDS.KRAKEN,
      apikey: '',
      apiSecret: ''
    },
    {
      exchangeId: SUPPORTED_EXCHANGE_IDS.COINBASE_PRO,
      apikey: '',
      apiSecret: '',
      apiPassphrase: ''
    },
    {
      exchangeId: SUPPORTED_EXCHANGE_IDS.BITTREX,
      apikey: '',
      apiSecret: ''
    }
  ]
});
// retrieve an exchange client
const krakenClient = coygo.getClient({
  exchangeId: SUPPORTED_EXCHANGE_IDS.KRAKEN
});
// set up order book listener
krakenClient.registerOrderBookListener({
  baseSymbol: 'BTC',
  quoteSymbol: 'USD',
  callback: (orderBook) => {
    // receives updates in real-time directly from the exchange
    console.log(orderBook);
  }
});
// callback orderBook example
{
  last: 8081.1,
  asks: {
    '8083.1': 0.65,
    '8084': 0.25,
    '8085.2': 1.4,
    ...
  },
  bids: {
    '8080.5': 2.42,
    '8078': 0.31,
    '8077.8': 0.9,
    ...
  }
}

In this example we will submit a transfer between two exchanges
Code:
// get exchange client for sending and receiving exchanges
const krakenClient = coygo.getClient({
  exchangeId: SUPPORTED_EXCHANGE_IDS.KRAKEN
});
const bittrexClient = coygo.getClient({
  exchangeId: SUPPORTED_EXCHANGE_IDS.COINBASE_PRO
});
// get deposit address
const bittrexDepositAddressResult = await bittrexClient.getDepositWalletAddress({
  symbol: 'LTC'
});
// submit transfer
const exchangeTransferId = await krakenClient.sendFunds({
  symbol: 'LTC',
  amount: 5,
  destinationWalletAddress: bittrexDepositAddressResult.address
});
Jump to: