// max_depth - the max number of contracts rewarded in this PerpMarket
// depth - how many contracts are ahead your order on the bids or asks
// quantity - quantity of the order or the
let depth = max(depth_initial, depth_final)
let depth_factor = max_depth - depth
// time the order was on the book in seconds
let time_factor = time_final - time_initial
// limit to rewarding the amount of your order that remains in the window
let quantity_factor = min(quantity, depth_factor)
let points = depth_factor.pow(2) * time_factor * quantity_factor
// Convert the points into MNGO; adjust the rate of disbursement
return convert_points(points)