Apato is a subscription service built to give you an edge on the competitive real estate market. Apato lets you subscribe to certain areas of interest and pings you whenever a listing matching your investment criteria appears on the market. No more tedious manual searching and long hours of excel models.
- Get pinged when a investment opportunity appears on the market Let's you subscribe to a watchlist with your investment criteria (target IRR, size, location).
- Get accurate IRR immediately Calculates the Internal Rate of Return for all apartments listed in your watchlists.
- Notifies you whenever a new apartment that matches your criteria comes to market.
- Can handle multiple users, from multiple chats.
Technologies used:
Apato is designed using the Producer-Consumer pattern. High level functionality goes approximately like this:
- User subscribes to watchlist via Telegram.
- Producer pushes update and calculation tasks to the task queue.
- Consumer processes tasks. Sends update or calculates IRR for all apartments of given watchlist.
Apato uses real cash flow IRR calculations to estimate yield of investments.
The source code can be found in src/consumer/calculations.rs.
IRR is a classic problem where one wants to find the roots of a polynomial of a high degree. In this case the degree is equal to the length of the loan (25 by default).
Apato solves for the roots by evaluating the eigenvalues of the companion matrix to the given cashflow.
To run locally, make sure to have Rust and Docker installed.
First, spin up the database.
docker-compose up -d
Run migrations:
diesel setup
Run Apato:
cargo run
Apato exposes an HTTP API alongside the Telegram bot. It listens on http://localhost:8080 by default and mirrors the same watchlist operations.
To start the API together with the workers, simply run cargo run as above. Then, in a separate terminal, install the TypeScript front-end dependencies and launch the development server:
cd webapp
npm install
npm run dev
The UI is available at http://localhost:5173. Set the chat id in the form to browse, create, or delete watchlists, and to fetch matching apartments. You can change the backend URL by setting the VITE_APATO_API environment variable before running npm run dev.
Apato can call a separate Python service to predict rents instead of using the built-in heuristic.
-
Install dependencies
cd ml python -m venv .venv source .venv/bin/activate pip install fastapi uvicorn numpy keras
-
Provide the model
Place your trained Keras model at
ml/models/rent_model.keras. If the file is missing the service will fall back to a baseline heuristic. -
Run the service
uvicorn ml.server:app --reload --port 8000
-
Point Apato to the service
Set
ml_service_urlinconfig.toml, for example:ml_service_url = "http://127.0.0.1:8000"
Leave the value empty or unset to keep using the heuristic calculator.
Subscribe to a watchlist at location id and set the wanted yield to be yield
/sub {location id} yield={yield} size={size}
Unsubscribe to a watchlist with watchlist id id
/unsub {watchlist_id}
Lists all the current watchlists of the caller
/listsubs
Get information about all apartments currently in the watchlist of interest.
/getall {watchlist_id}
Get information about all apartments matching your investment criteria in the watchlist of interest.
/getallvalid {watchlist_id}
Helper for all commands
/help
TODO