An app that helps people in hyperinflation economies manage stablecoin assets by finding the cheapest conversion rates from local currency and providing financial intelligence on wealth management.
- Install Poetry
curl -sSL https://install.python-poetry.org | python3 -- Install dependencies:
poetry install- Set up environment variables (copy
.env.exampleto.envand fill in your values):
cp .env.example .envEdit .env with your API keys:
BITSO_API_KEY=your_api_key
BITSO_API_SECRET=your_api_secret
BITSO_BASE_URL=https://stage.bitso.com
Activate the Poetry shell:
poetry shellThen run:
python run.pyOr with uvicorn directly:
uvicorn app.main:app --reloadpoetry run python run.pyOr:
poetry run uvicorn app.main:app --reloadThe API will be available at http://localhost:8000
Format code with black and isort:
poetry run black app/ run.py
poetry run isort app/ run.pyConvert currency using exchange rates.
Request:
{
"from_ccy": "USD",
"to_ccy": "BTC",
"amount": 1000.0
}Response:
{
"converted_amount": 0.0234
}Get the cost (fee) for converting from one currency to another.
Request:
{
"from_currency": "USDC",
"to_currency": "ARS",
"amount": 1000.0
}Response:
{
"cost": 6.5,
"exchange": "bitso"
}Run Dijkstra's algorithm to find shortest path costs from a starting currency.
Request:
{
"start_currency": "USDC",
"amount": 1000.0
}Response:
{
"costs": {
"USDC": 0.0,
"ARS": 0.0065,
"MXN": 0.0065,
...
},
"previous": {
"USDC": null,
"ARS": "USDC",
...
}
}