For every investor it is very important to manage invested funds, understanding gains and losses to be able to draw conclusions based on particular data. The most simple way is to use something like an Excel which is capable to make calculations. Using Google Docs isn’t smart idea but it is very useful in part of access from everywhere. Nextcloud along with OnlyOffice helped me with this issue, I’ve installed it locally on my OrangePI5 home server. It is accessible from everywhere when I connected to my home VPN and secure. First part is done.
After all this setup and filling the spreadsheet with some data I realised that missing part of all this setup is actual prices of coins and tokens I bought. To do it manually is a nightmare. CoinMarketCapAPI allows to request prices in real time. OnlyOffice supports macros which uses JavaScript language syntax. But here things go not so easy because making direct request from macros resulted of CORS error. It is happening because the server address and requested address are in the different networks. Using additional server to make request solved the issue. The server was wrapped in the Docker container and run at the same server as OnlyOffice and NextCloud and everything works as expected.
The cons of this solution that if in my portfolio appears a new token I need to manually add it’s index to server request file and rebuild the container as well as modify script for OnlyOffice with new token and it position.
The code for running the server and script for OnlyOffice can be found in git repository.
Content for educational purpose and keep in mind that you do it on your own risk.
Leave a Reply