Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
136 lines (103 sloc) 6.25 KB

The website for TradersBit (formerly at tradersbit.com). TradersBit is shut down and open sourced.

What is TradersBit?

TradersBit is (was a) a marketplace for streams of Bitcoin trading signals.

Publishers create streams, send trading signals to streams, and sell subscriptions to streams. Publishing on TradersBit is completely free. Signals can be published through our website, API or by connecting your Bitfinex account. The API makes it possible to connect trading bots and other applications.

Statistics for each stream's performance are computed and displayed in the marketplace. Trading fees are incorporated in the statistics.

Subscribers can browse, filter and sort streams based on average monthly profit, average trade, and other indicators. When subscribing to a stream, users can receive signals via email or have the signaled trades automatically executed through their own Bitfinex accounts.

The publishers of the streams will set the monthly subscription fee. Upon selling subscriptions, publishers will earn 70 percent of the subscription fees. We get the remaining 30 percent. TradersBit earns profits only when the publishers make profits, so our respective interests are the same.

Upon the reception of a trading signal, we simulate the trade (including trading fees). As a result of this, there is no way for the publishers to manipulate statistics.

There is no social interaction in this marketplace because the statistics and trading signals speak for themselves. This way, subscribers will not be scammed easily. A subscriber should not need to know or care whether signals are sent manually by a teenager, an MBA graduate or automatically generated by a trading bot. At TradersBit, the streams and statistics matter, not the people behind them.

TradersBit will also host trading competitions. For instance, most profitable streams last 30 days, etc., with rewards in Bitcoins.

TradersBit consists of

  • tradersbit.com - the webpage
  • tb-front - serverless REST API
  • tb-back - serverless backend (not accessed directly by users)
  • tb-signals - microservice for handling incoming trading signals
  • tb-streams - microservice for handling stats for streams of trading signals

##After checkout npm install bower install typings install

##Run commands gulp serve gulp serve:dist

##Design main: Blue/Amber/Gray: hsl(202, 56%, 56%)/FFC107/hsl(227, 3%, 31%)

trading: Green/Red/Amber: "#81C784"/"#E57373"/"#FFD54F"

good/bad: #c8f0d3/#f0c8c8

#Troubleshout If 'gulp serve:dist' don't work: remove all (generted) js files in the /app folder. Also, remember, the order in bower.json mathers

cd src/app
find . -name "*.js" -type f|xargs rm -f

###Get the apiclient generated from AWS API Gateway

set

defaultContentType: 'application/json; charset=UTF-8'

####For AIM auth problems:

  1. Give invoke permissions to the role auth0-api-role
  2. Check correct region in tradersbit.com: createApiClient

#tb-front-sdk

Prerequisites

For the JavaScript SDK to work your APIs need to support CORS. The Amazon API Gateway developer guide explains how to setup CORS for an endpoint. The generated SDK depends on third-party libraries. Include all of the scripts in your webpage

<script type="text/javascript" src="lib/axios/dist/axios.standalone.js"></script>
<script type="text/javascript" src="lib/CryptoJS/rollups/hmac-sha256.js"></script>
<script type="text/javascript" src="lib/CryptoJS/rollups/sha256.js"></script>
<script type="text/javascript" src="lib/CryptoJS/components/hmac.js"></script>
<script type="text/javascript" src="lib/CryptoJS/components/enc-base64.js"></script>
<script type="text/javascript" src="lib/url-template/url-template.js"></script>
<script type="text/javascript" src="lib/apiGatewayCore/sigV4Client.js"></script>
<script type="text/javascript" src="lib/apiGatewayCore/apiGatewayClient.js"></script>
<script type="text/javascript" src="lib/apiGatewayCore/simpleHttpClient.js"></script>
<script type="text/javascript" src="lib/apiGatewayCore/utils.js"></script>
<script type="text/javascript" src="apigClient.js"></script>

Use the SDK in your project

To initialize the most basic form of the SDK:

var apigClient = apigClientFactory.newClient();

Calls to an API take the form outlined below. Each API call returns a promise, that invokes either a success and failure callback

var params = {
    //This is where any header, path, or querystring request params go. The key is the parameter named as defined in the API
    param0: '',
    param1: ''
};
var body = {
    //This is where you define the body of the request
};
var additionalParams = {
    //If there are any unmodeled query parameters or headers that need to be sent with the request you can add them here
    headers: {
        param0: '',
        param1: ''
    },
    queryParams: {
        param0: '',
        param1: ''
    }
};

apigClient.methodName(params, body, additionalParams)
    .then(function(result){
        //This is where you would put a success callback
    }).catch( function(result){
        //This is where you would put an error callback
    });

##Using AWS IAM for authorization To initialize the SDK with AWS Credentials use the code below. Note, if you use credentials all requests to the API will be signed. This means you will have to set the appropiate CORS accept-* headers for each request.

var apigClient = apigClientFactory.newClient({
    accessKey: 'ACCESS_KEY',
    secretKey: 'SECRET_KEY',
    sessionToken: 'SESSION_TOKEN', //OPTIONAL: If you are using temporary credentials you must include the session token
    region: 'eu-west-1' // OPTIONAL: The region where the API is deployed, by default this parameter is set to us-east-1
});

##Using API Keys To use an API Key with the client SDK you can pass the key as a parameter to the Factory object. Note, if you use an apiKey it will be attached as the header 'x-api-key' to all requests to the API will be signed. This means you will have to set the appropiate CORS accept-* headers for each request.

var apigClient = apigClientFactory.newClient({
    apiKey: 'API_KEY'
});