Documentation Index
Fetch the complete documentation index at: https://docs.meteora.ag/llms.txt
Use this file to discover all available pages before exploring further.
Rate Limiter is a configurable fee slope that can charge fees ranging from the configured base_fee up to 99% fee (MAX_FEE).
Rate Limiter Formula
The rate limiter uses a progressive fee calculation with the following key components:
Parameters:
reference_amount (x₀): The base reference amount
cliff_fee_numerator (c): The base fee rate
fee_increment_bps (i): The fee increment in basis points
max_limiter_duration: Duration for which the rate limiter is active
The formula depends on the relationship between input_amount and reference_amount:
Case 1: input_amount ≤ reference_amount
Fee=Input Amount×c
Case 2: input_amount > reference_amount
First, decompose the excess amount:
Input Amount=x0+(a×x0+b)
where:
a: floor division of (Input Amount - x₀) / x₀
b: remainder of (Input Amount - x₀) mod x₀
Then calculate fees based on whether we exceed the maximum index:
Max Index can be calculated as:
Max Index=fee_increment_numeratorMAX_FEE_NUMERATOR−c
where:
fee_increment_numerator = (fee_increment_bps * FEE_DENOMINATOR) / 10_000
If a < max_index
Fee=x0×(c+c×a+i×a×(a+1)/2)+b×(c+i×(a+1))
If a ≥ max_index
d=a−Max Index
Fee=x0×(c+c×Max Index+i×Max Index×(Max Index+1)/2)+(d×x0+b)×Max Fee