Moex securities

Prerequisites

Create empty database and describe configuration in this file. Flyway will apply migrations to your database after starting the program.

Application endpoints

Security

  1. Create security
    POST /securities
{
  "secid": "AEDRUB_TOD",
  "regnumber": "",
  "name": "AED/RUB_TOD - AED/РУБ", // nullable
  "emitentTitle": ""
}
  1. Get security by id
    GET /securities/{id}

  2. Get all securities
    GET /securities

  3. Update security
    PUT /securities/{id}

{
  // new body
  "secid": "AEDRUB_TOD",
  "regnumber": "",
  "name": "AED/RUB_TOD - AED/РУБ", // nullable
  "emitentTitle": ""
}
  1. Delete security by id
    DELETE /securities/{id}

  2. Upload security xml file
    POST /securities/upload-xml
    Filename should match format securities_*.xml
    See example

History

  1. Add history
    POST /history
{
  "secid": "AEDRUB_TOD",
  "tradedate": "2022-03-02",
  "numtrades": 224,
  "open": 3421.15, // nullable
  "close": 2900.8 // nullable
}
  1. Get hisotry by secid
    GET /history/{secid}

  2. Get hisotry by date
    GET /history/date/{date}

  3. Update hisotry
    PUT /history

{
  "secid": "AEDRUB_TOD",
  "tradedate": "2022-03-05",
  "numtrades": 224,
  "open": 3421.15, // nullable
  "close": 2900.8 // nullable
}
  1. Delete hisotry by secid
    DELETE /history/{secid}

  2. Upload history xml file
    POST /history/upload-xml
    Filename should match format history_*.xml
    See example

Info

  1. Get info by secid
    GET /info/{secid}

  2. Get all info
    GET /info

Stack: Scala, Http4s, Cats, cats-effect, doobie, PostgreSQL, Flyway