This repository contains configuration files that are used to estimate slippage at the /swap
endpoint.
slippage_config.json
contains the min max heuristics for different token categories.token_categories.json
contains the categorisations of tokens.
- We run a backend slippage estimator that uses real time and historical swap data to calculate and estimate slippage values.
- The estimator then reads the token categories to determine which category the input/output tokens belong to.
- Based on the categories, the estimator will apply the worse of min max heuristics between the 2 tokens on to the estimated slippage value.
- The estimator will then return the final slippage value as part of the swap transaction in the
/swap
response.
Internal test stuff
Validate dynamic slippage config
cargo test