opentensor / subtensor

Bittensor Blockchain Layer
The Unlicense
117 stars 107 forks source link

Investigate Transfer Fees #576

Open sam0x17 opened 1 week ago

sam0x17 commented 1 week ago

The transfer fee is currently exorbitantly low. This value should be investigated and made more suitable to protect the chain against DDOS.

The current implementation for calculating our fees is fee = 0 + (0.001 × weight) based on:

fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
    let coefficient = WeightToFeeCoefficient {
        coeff_integer: 0,
        coeff_frac: Perbill::from_parts(1),
        negative: false,
        degree: 1,
    };

    smallvec!(coefficient)
}

In this implementation we are increasing the fees linearly degree: 1.

We can increase the fee by increasing the weight to fee ratio, charging per byte in the transaction, enabling the FeeMultiplier, raising the base fee from 0, or ditching this and writing our own algorithm.

https://docs.substrate.io/reference/how-to-guides/weights/calculate-fees/