mustafatufan / quote-service

Quote Service provides quotes for digital currency trades using data from the FTX orderbook.

Home Page:https://api.tufan.ee/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config#/quote-controller/quote

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quote Service

Quote Service provides quotes for digital currency trades using data from the FTX orderbook. It handles requests to buy or sell a particular amount of a currency (the base currency) with another currency (the quote currency).

Route

POST /quote

Request Body

  • action (String): Either “buy” or “sell”
  • base_currency (String): The currency to be bought or sold
  • quote_currency (String): The currency to quote the price in
  • amount (BigDecimal): The amount of the base currency to be traded - Note that it was String in the doc.

Request Body Example

{
  "action": "buy",
  "base_currency": "BTC",
  "quote_currency": "TRYB",
  "amount": 0.12
}

Response Body

  • total (String): Total quantity of quote currency - Note that it was String in the doc.
  • price (String): The per-unit cost of the base currency - Note that it was String in the doc.
  • currency (String): The quote currency

Response Body Example

{
  "total": 54610.212,
  "price": 455085.1,
  "currency": "TRYB"
}

Deployed Example

URL

https://api.tufan.ee/quote

Swagger

cURL

curl --location --request POST 'https://api.tufan.ee/quote' \
--header 'Content-Type: application/json' \
--data-raw '{
  "action": "buy",
  "base_currency": "BTC",
  "quote_currency": "TRYB",
  "amount": 0.12
}'

TODOs

1. Write more detailed tests in QuoteServiceImplTest
2. Test custom exceptions
  • InvalidAmountException
  • NoMarketException
  • ConnectionUnavailableException
3. Fix syntax of PriceType and QuoteAction enums

Enums should be uppercase.

About

Quote Service provides quotes for digital currency trades using data from the FTX orderbook.

https://api.tufan.ee/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config#/quote-controller/quote

License:MIT License


Languages

Language:Java 98.7%Language:Dockerfile 1.3%