Giter Club home page Giter Club logo

codebuddiesase's Introduction

Dependencies:

apt-get install libsqlite3-dev # sqlite3 dev
apt-get install libcurl4-gnutls-dev # libcurl
https://github.com/CrowCpp/Crow/releases/tag/v1.0+5 # crow
apt install crow-v1.0+5.deb # to install crow deb
apt-get install libboost-all-dev # boost (needed by crow)

gcc --version >= 9.0.0

To run service:

bazel run //entry:service
bazel build //entry:service # to just build the binary, then the binary will exist in bazel-bin/

To modify database ddl:
(eventually this will be done via an admin-only api endpoint)

./data/db_admin.sh {create, clear, dump} # any other input will print a help message

To run style checker:

pip install cpplint # only need to run install once
cpplint */*  # to run for entire repo
cpplint <path_to_file> # to run for single file

To run tests:

bazel test --test_output=all //... # run every test
bazel test --test_output=all //<target> # run single test suite

Endpoint Specification :

Except for /getcredentials, calls to all other endpoints must be authenticated with the API key (or the refresh token when calling /refreshcredentials) by sending it in the Authorization header, where the API key (or the refresh token) is concatenated to the string "Bearer " . (Note that the space after the letter r is intentional.)

Endpoint url Description Input Output
/getcredentials GET Generates credentials. Called the first time client uses the api None Json data with keys client_id, api_key and refresh_token
/refreshcredentials GET Generates new API key and refresh_token for existing client. Client needs to authenticate with refresh_token instead of API key for this call None Json data with keys client_id, api_key and refresh_token
/trade POST Takes information about a trade and saves it in the database Json data with keys timestamp, sold_currency, bought_currency, sold_amount and bought_amount HTTP Status Code
/exchangekey POST Takes read key for a supported exchange and stores in database Json data with keys exchange, secretkey and readkey HTTP Status Code
/removekey POST Takes read key for a supported exchange and deletes that key from database Json data with key exchange HTTP Status Code
/get_annotated_trades GET Gets matched trades None Matched trades
/year_end_stats GET Gets year end statistics for a year None Json data with keys lt_realized_pnl, st_realized_pnl and actual_pnl
/trade_pnl POST Gets the profit and loss for the input trade and returns it Json data with keys timestamp, sold_currency, bought_currency, sold_amount and bought_amount The profit or loss : Json data with key pnl whose value is the profit or loss
/portfolio_pnl GET Get profit and loss of portfolio at various points in time None Profit and loss over time

Example curl commands to send requests to the endpoints are in entry/README.md

codebuddiesase's People

Contributors

nanason01 avatar urveeausekar avatar pigulkasomy avatar larkjennice avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.