Skip to content

Instantly share code, notes, and snippets.

@patio11
Last active October 30, 2015 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patio11/1ad9a632fe94e8699434 to your computer and use it in GitHub Desktop.
Save patio11/1ad9a632fe94e8699434 to your computer and use it in GitHub Desktop.
Starfighter REST API request and response JSON samples
//JSON to POST to /venues/FOOEX/stocks/BAR/orders
{
“symbol”: “BAR”,
“venue”: “FOOEX”,
“direction”: “buy”,
“qty”: 20,
“price”: 5100,
“type”: “limit”,
“account” : “OGB12345”, // your trading account (game gives you this)
}
// JSON you get as a response if you do that
{
“ok”: true,
“symbol”: “BAR”,
“venue”: “FOOEX”,
“direction”: “buy”,
“originalQty”: 100,
“qty”: 20, // this is the quantity *left outstanding*
“price”: 5100, // the price on the order — may not match that of fills!
“type”: “limit”,
“id”: 12345, // guaranteed unique *on this venue*
“account” : “OGB12345”,
“ts”: “2015-07-05T22:16:18+00:00”, // ISO-8601 timestamp for when we received order
“fills”:
[
{
“price”: 5050,
“qty”: 50
“ts”: “2015-07-05T22:16:18+00:00”
}, … // may have zero or multiple fills. Note this order presumably has a total of 80 shares worth
],
“totalFilled”: 80,
“open”: true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment