That is unbelievably slick.
As a side note, you could use
let boost = ......
and then you could use a single variable instead of having the math calculated multiple times if you want to apply that initial boost to multiple things.
I wonder if there would be anyway to introduce entropy into this, such that product X that came out 1 year ago and sold 5000 items 1 year ago, doesn't supersede product Y that came out last week and has sold 500 items. I'm not sure off hand if this would be possible inside raven, although theoretically you could refilter or reorder the results in memory to account for entropy at the client.