Skip to content
This is repository with price feeds logic for Bitspark assets
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
.env.example
.gitignore
.rubocop.yml
Gemfile
Gemfile.lock
LICENSE
README.md
crontab
docker.yml.example
entrypoint.sh
install.sh

README.md

price-feed

Table of content

Get started

Overview

The purpose of that script is to calculate and provide price feed for PEG.PHP currency on the Bitshares DEX. It uses the couple of free & paid ones API in order to calculate average price via other currencies (eg, via BTC, BTS, etc).

Requirement

This price feed will use your bitshares client, so account name indicated in price feed should be added to bitshares client.

Instalation

Clone the project
git clone https://hub.teamvoy.com/Bitsparkbtc/price-feed.git
cd price-feed
./install.sh

Config

Configure BITSHARES_ENDPOINT in .env file

Configure
MAINTENANCE_COLLATERAL_RATIO default: 2000 (2.0)
MAXIMUM_SHORT_SQUEEZE_RATIO default: 1200 (1.2)
CORE_EXCHANGE_RATE default: 1.05
DEFAULT_ACCOUNT BitShares account that produce feed, default: nathan (please ensure keys for that account are imported on your bitsahres client)

Configure crontab file in root folder
PriceFeed constructor takes two parameters:
First parameter is bitshares name that can produce feed to PHP currency and should be added active key to your bitshares client.
Second parameter is adapter class, adapters can be found in lib\adapter folder

Run

Via docker swarm:

To start
docker stack deploy -c docker.yml price-feed
To stop
docker stack rm price-feed

Via docker composer

To start
docker-compose -f docker.yml up

to launch docker as daemon use -D
docker-compose -f docker.yml up -D
To stop daemonized process
docker-compose -f docker.yml down

Adapters table

Name Paid Pairs
Bloom yes PHP-BTC, PHP-USD
Coingecko no PHP-BTS, BTC-BTS, USD-BTS
Coinigy no BTC-BTS, USD-BTS
Coins.ph no PHP-BTC, PHP-USD
Currencylayer yes PHP-BTC, PHP-USD
Exchangeratelab yes PHP-USD
Exchangeratesapi no PHP-USD
Fixer yes PHP-EUR
Rebit no PHP-BTC
Xe yes PHP-USD
You can’t perform that action at this time.