Code Monkey home page Code Monkey logo

trading-post's Introduction

trading-post

Store stock trading transactions with funny money

A hosted version of this can be found at https://trading-post.club.

Codefresh build status

API

GET /profile/

Return the current user profile, including all currently owned stocks.

curl --header 'Authorization: Bearer <id_token>' https://trading-post.club/profile/
# {
#   "name": "Roy van de Water",
#   "riches": -1067.8401,
#   "stocks": [
#     {
#       "quantity": 2,
#       "ticker": "ctxs"
#     },
#     {
#       "quantity": 1,
#       "ticker": "goog"
#     }
#   ]
# }

POST /profile/buy-orders

Create a new buy order and subtract the market rate from the profile's riches.

curl \
  --request 'POST' \
  --header 'Authorization: Bearer <id_token>' \
  --data '{"ticker": "goog", "quantity": 3}' \
  https://trading-post.club/profile/buy-orders
# {
#   "id": "2fa48bba-dddb-4f23-8c95-bd2dd9e07ed3",
#   "price": 905.96,
#   "quantity": 3,
#   "ticker": "goog"
# }

POST /profile/sell-orders

Create a new sell order and add the market rate to the profile's riches

curl \
  --request 'POST' \
  --header 'Authorization: Bearer <id_token>' \
  --data '{"ticker": "goog", "quantity": 3}' \
  https://trading-post.club/profile/sell-orders
# {
#   "id": "ffe2ea60-9695-4e2b-8fd3-c978020f213b",
#   "price": 905.96,
#   "quantity": 3,
#   "ticker": "goog"
# }

trading-post's People

Contributors

royvandewater avatar sqrtofsaturn avatar

Stargazers

Serge Simard avatar Rob Wright avatar Peter DeMartini avatar

Watchers

James Cloos avatar Peter DeMartini avatar  avatar

trading-post's Issues

User Interface

Something better than just a JSON response would be nice. Would be cool if it showed a top 10 list, let you see what your current portfolio is, and do trades from there as well.

Top 10 List

An API get the top ten list showing current the current users and the value of their portfolio:

GET /top

[{
  "name": "Roy",
  "riches": 100
}, {
  "name": "Tin",
  "riches": -999
}]

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.