All Projects → ohld → python-viabtc-api

ohld / python-viabtc-api

Licence: Apache-2.0 license
API Wrapper for ViaBTC exchange server

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to python-viabtc-api

viabtc exchange server
A high performance and real time quotation push trade engine.
Stars: ✭ 35 (-10.26%)
Mutual labels:  exchange, viabtc
testnet.backend
Backend for a ViaBTC exchange server (trading engine)
Stars: ✭ 18 (-53.85%)
Mutual labels:  exchange, viabtc
frontend
testnet.exchange frontend
Stars: ✭ 18 (-53.85%)
Mutual labels:  exchange, viabtc
MoneroMixer
The easiest way to use Monero to anonymously exchange and properly mix XMR, BTC, LTC, ETH, BCH, & 100+ other coins on Tails OS or Whonix.
Stars: ✭ 57 (+46.15%)
Mutual labels:  exchange
0x-codesandbox
0x Codesandbox
Stars: ✭ 14 (-64.1%)
Mutual labels:  exchange
codechain-exchange
A decentralized exchange platform for CodeChain
Stars: ✭ 16 (-58.97%)
Mutual labels:  exchange
ethereum-dex
Decentralized exchange implementation for the 0xcert protocol on the Ethereum blockchain.
Stars: ✭ 18 (-53.85%)
Mutual labels:  exchange
crypto-convert
Instantly convert cryptocurrency and get price information
Stars: ✭ 26 (-33.33%)
Mutual labels:  exchange
TheWorldExchange
A purely client-side wallet and direct interface showcasing the full functionality of Ripple / blockchain.
Stars: ✭ 34 (-12.82%)
Mutual labels:  exchange
tellerbot
Telegram Bot for over-the-counter trading
Stars: ✭ 17 (-56.41%)
Mutual labels:  exchange
Huobi.Net
.Net API wrapper for the Huobi web API
Stars: ✭ 58 (+48.72%)
Mutual labels:  exchange
b2s-trader
Application to automate trading process
Stars: ✭ 22 (-43.59%)
Mutual labels:  exchange
price-prediction-bot
🔮 Run backtest over PancakeSwap and CandleGenie Prediction and place realtime bets - Trading Bot
Stars: ✭ 59 (+51.28%)
Mutual labels:  exchange
bitmex-client-websocket
🛠️ C# client for Bitmex websocket API
Stars: ✭ 60 (+53.85%)
Mutual labels:  exchange
cryptogalaxy
Get any cryptocurrencies ticker and trade data in real time from multiple exchanges and then save it in multiple storage systems.
Stars: ✭ 96 (+146.15%)
Mutual labels:  exchange
kunkka-match
高性能撮合引擎
Stars: ✭ 50 (+28.21%)
Mutual labels:  exchange
trader
a ping pong and maker/taker order bot for trading cryptocurrency on Waves Exchange, Poloniex, Bittrex, and Binance
Stars: ✭ 23 (-41.03%)
Mutual labels:  exchange
intrinio-realtime-python-sdk
Intrinio Python SDK for Real-Time Stock Prices
Stars: ✭ 79 (+102.56%)
Mutual labels:  exchange
Bitfinex.Net
Bitfinex Api wrapper for .Net
Stars: ✭ 76 (+94.87%)
Mutual labels:  exchange
MKT
Exchange Price Service , Stocks , Cryptocurrency,Stock prediction and more
Stars: ✭ 27 (-30.77%)
Mutual labels:  exchange

python-viabtc-api

API Wrapper for ViaBTC exchange server - open source cryptocurrency exchange engine. Also works with the original exchange server.

Installation

This API is very simple. The installation is just the downloading sources from github

git clone https://github.com/testnet-exchange/python-viabtc-api
cd python-viabtc-api
pip3 install -r requirements.txt

Usage

The basic usage:

from ViaBTCAPI.ViaBTCAPI import ViaBTCAPI

exchange_url = "http://localhost:8080/"  # choose to your exchange url
api = ViaBTCAPI(exchange_url)

resp = api.market_list()
market_names = [m["name"] for m in resp["result"]]
print("Exchange markets: ", market_names)

print()
print("Orderbooks:")
for market in market_names:
    ob = api.order_depth(market=market)
    print(market, ob["result"])

More usage code examples you can find in examples folder. Read the code first, it may contain some hardcoded constants that should be changed.


Working with the exchange server

Since I have had a lot of troubles with the original exchange server by ViaBTC, I've decided to write this tutorial for beginners. I hope that helps.

Install exchange

For me the easiest way to install the exchange was found in bitlum's fork of the original ViaBTC repository. You need docker and docker-compose (up-to-date) to launch this installation script.

git clone https://github.com/testnet-exchange/viabtc_exchange_server
cd viabtc_exchange_server/docker
sudo docker-compose up

That's it! It successfully run on Ubuntu and Debian servers, but failed on macOS (there were some disk path errors that I balieve can be easily fixed if you are familiar with docker or stackoverflow).

Connect to exchange local network

Docker-compose creates the local net for all dockers images. Take a look at docker-compose file: you may notice the local ip addresses near every docker container. We will use the address of accesshttp container to make API requests.

As all of that stuff is happening on the remote server's local network, we need to make some port forwarding from it to out development machine (in my case this is my macbook laptop):

ssh user@<your-server-id-address-> -L 8080:192.168.18.45:8080 -N -f

where 192.168.18.45 is the ip address of accesshttp container and 8080 is its port.

And now you can send API requests to exchange_url = "http://localhost:8080"


I spent a few hours to figure out how to run the exchange and make requests to it. If this tutorial helped you, smash the star button at the top of the page. And fell free to make Pull Requests with some additional functionallity.

Happy Coding!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].