Hello, software engineer here.
I made several telegram bots for multiple purpouses, shopping, news, notifiers...
I want to let you know that I can make this bot for you, we just need a cheap VPS and a database,
so you will get the referal system working with a user analytics, ref counts, ref per user, ref per time, top referers, and anything you may want.
Hope it sounds good for you.
Kind regards