How to tweak formula behaviour

Sigmoid coefficients Fee calculation can be tuned by the following parameters:

  struct Configuration {
    uint16 alpha1; // max value of the first sigmoid
    uint16 alpha2; // max value of the second sigmoid
    uint32 beta1; // shift along the x-axis for the first sigmoid
    uint32 beta2; // shift along the x-axis for the second sigmoid
    uint16 gamma1; // horizontal stretch factor for the first sigmoid
    uint16 gamma2; // horizontal stretch factor for the second sigmoid
    uint32 volumeBeta; // shift along the x-axis for the outer volume-sigmoid
    uint16 volumeGamma; // horizontal stretch factor the outer volume-sigmoid
    uint16 baseFee; // minimum possible fee
  }

Adaptive fee function is a combination of several sigmoids. The plot of the standard sigmoid function looks like this:

We use a more flexible formula for sigmoids:

So additional params (alpha, gamma, beta) allow us to shift, stretch and modify sigmoids.

Default params:

      3000 - Constants.BASE_FEE, // alpha1
      15000 - 3000, // alpha2
      360, // beta1
      60000, // beta2
      59, // gamma1
      8500, // gamma2
      0, // volumeBeta
      10, // volumeGamma
      Constants.BASE_FEE // baseFee

So

max fee value is: baseFee + alpha1 + alpha2 min fee value is: baseFee

midpoint of the first sigmoid: beta1 midpoint of the second sigmoid: beta2

sigmoid “jump” “starts” around beta - 6 * gamma, ends around beta + 6 * gamma

alpha1, alpha2, beta1, beta2, gamma1, gamma2 – coefficients for volatility sigmoids. volumeBeta, volumeGamma – coefficients for volume sigmoid