Skip to content

Cryptocurrency exchange with the ability to buy and sell and automatic change of exchange rates.

Notifications You must be signed in to change notification settings

AndrejTsvetkov/cryptocurrency_exchange

Repository files navigation

Cryptocurrency exchange

Description:

Cryptocurrency exchange where users can buy and sell currency.

Makefile commands

Create venv:

make venv

Run tests:

make test

Run linters:

make lint

Run formatters:

make format

Init database

make init_db

Run server

make up

Api Endpoints

POST /currency/add

Adds a new cryptocurrency with the specified name if it doesn't exist.

Body

{
 "name": "your_currency"
}
GET /currency/<currency_name>

Returns extended information about the specified cryptocurrency if it exists. Note that currency_name parameter must be in lowercase.

GET /currency/all

Returns information about all cryptocurrencies.

POST /user/registration

Body

{
 "name": "your_name"
}

Adds a user to the exchange.

GET /user/<user_name>

Returns information about the specified user if it exists.

GET /user/<user_name>/operations?limit=10&page=1
Parameter Type Description
limit int Required. Number of operations per page.
page int Required. Page number (starts with 0).

Returns paginated list of user operations.

POST /trade
{
  "currency_name": "currency_name",
  "user_name": "user_name",
  "operation": "buy/sell",
  "currency_amount": 1.1,
  "exchange_rate": 43.21
}

Performs the specified operation for the specified user.

Technologies Used

  • Python
  • Poetry
  • Flask
  • SQLAlchemy
  • Pydantic
  • Pytest
  • Git
  • GitHub
  • Docker
  • Docker Compose

Authors

About

Cryptocurrency exchange with the ability to buy and sell and automatic change of exchange rates.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published