Skip to content

Instantly share code, notes, and snippets.

@kardasis

kardasis/API.md Secret

Last active September 18, 2017 15:09
Show Gist options
  • Save kardasis/30fbfc76577d362999597301bc35926c to your computer and use it in GitHub Desktop.
Save kardasis/30fbfc76577d362999597301bc35926c to your computer and use it in GitHub Desktop.
API for The 0cean

This API documetation has been moved to a public Github repository here

@foundingnimo
Copy link

Nice start! Some comments below:

  1. Might be good to use same naming scheme for url fragments and parameters: e.g. if using order_book -> use token_pair as parameter rather than camel casing.
  2. Are tokens guaranteed to not have ‘_’ in their name? I haven’t found any specification, so this may cause silliness down the road. Additionally, I think it might make sense to split this into 2 parameters (makerToken and takerToken) - which would solve this problem here.
  3. Might want to allow priceWindow in % as well.
  4. expirationTimestampInSec: Seconds might not be granular enough?
  5. Generally, I suggest to follow REST conventions e.g. PUT /v0/orders/match or POST v0/orders/:order_hash/cancel
  6. For PUT /v0/match - no errors detailed.
  7. For POST /v0/cancel:
    a) The return value is just the amountCancelled. However, I may POST an array of orders to cancel, I think the return value should be of the same magnitude (array with each element contains order hash and amountCancelled). I would also add a bool there to say whether the order is now gone completely.
    b) Do you also want to allow amending the order ‘upwards’?
    c) Name of this method is could be misunderstood for cancelling orders.
    d) What are the semantics of sending request for an existing order but tokenAmount=0?
  8. For GET /v0/asset_pairs:
    I think that when using names, only do this if it is meaningful in the context of the application or data. The names tokenA and tokenB returned in the response don’t seem to mean anything outside the context of the response. Consider returning this as an array with no named structures inside it. If an asset_pair describes a maker/taker relationship - why not call it maker and taker? If the asset_pair describes a 2-way maker/taker relationship - then how does this work?
  9. In GET /v0/orders - the descriptions of the last 6 querystring parms is incomplete

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment