yes the bike has a speed sensor. It is located near the front sprocket. I attached a picture below. It does NOT get it's calculations from rpm and throttle.
I have not tried changing the sprocket size. However the 2018 model uses one less tooth up front and one more tooth in the rear than that of the 2015-16 models. When it's time for me to replace my chain i will most likely go down one tooth up front and +2 in the rear.