Skip to content

annajersey/trading-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trading APP Backend

Cryptocurrency exchange rates application based on Binance API

Application API includes three GET endpoints and one sockets endpoint

Database update and clearing are launched with a periodicity settled in .env

Installation

Test Client

API Usage

Get all system symbols:

GET /symbols

Response:

[{
    "symbol": "BTCUSDT",
    "baseasset": "BTC",
    "quoteasset": "USDT",
},...]

Latest price for a symbol.

GET /price/{symbol}  

Example: /price/BTCUSDT

Response:

{
    "symbol": "BTCUSDT",
    "price": "7255.01000000"
}

OHLC data per minute for last hour. For candlestick bars.

GET /hourly/{symbol}

Example: /hourly/ETHBTC

Response:

[{
    "OpenTime": 1535958720000,
    "Open": "7238.44000000",
    "High": "7238.44000000",
    "Low": "7233.10000000",
    "Close": "7238.00000000",
    "Volume": "4.40431300",
    "CloseTime": 1535958779999
},...]

SocketIo Stream for ticker statistics pushed every second

?symbols={symbols_separeted_by_coma}

Example: ?symbols=ETHBTC,BTCUSDT,ETHUSDT

Event name: TradesAPI

Response:

{
    "symbol": "ETHBTC",
    "eventTime": 1535964640495,
    "priceChange": "-0.00106100",
    "priceChangePercent": "-2.588",
    "weightedAvg": "0.04031640",
    "prevDayClose": "0.04098900",
    "curDayClose": "0.03992800",
    "closeTradeQuantity": "0.41900000",
    "bestBid": "0.03990900",
    "bestBidQnt": "1.49300000",
    "bestAsk": "0.03992800",
    "bestAskQnt": "8.64000000",
    "openPrice": "0.04098900",
    "highPrice": "0.04105000",
    "lowPrice": "0.03983000",
    "volume": "153274.27600000",
    "volumeQuote": "6179.46705478",
    "openTime": 1535878240492,
    "closeTime": 1535964640492,
    "firstTradeId": 80072674,
    "lastTradeId": 80194571,
    "totalTrades": 121898
}

Technologies Used

  • Node.js
  • Express
  • SocketIo
  • PostgreSQL

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published