trading-post

command module
v6.5.4+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2018 License: MIT Imports: 9 Imported by: 0

README

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"
# }

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL