Rebase token support
Sovereign Pool supports rebase tokens natively, such as stETH and aTokens. Rebase tokens play an important role in Defi, and Valantis aims to treat them as first-class citizens where possible without introducing additional complexity. Rebase tokens change account balances over time due to rebase mechanisms and can lead to rounding errors during transfers by accounting balances using shares.
Rebase tokens can be supported in a Sovereign Pool by setting either isToken0Rebase=True
or isToken1Rebase=True
. If one of the above flags is True
, the following considerations are applied:
Transfers tolerate rounding errors of up to
REBASE_TOKEN_ABS_ERROR_TOLERANCE
, currently set at10
.Pool reserves are measured as raw token balances, in contrast to having fixed reserves that can only change on swaps, deposits, or withdrawals.
This assumes that swap fees are automatically re-compounded into reserves (balances). WARNING: This opens up donation attack vectors, since token transfers into the pool would directly increase token balances (hence reserves). It is up to each Liquidity Module to be aware of said risks and have appropriate internal checks and protections.
In addition to all of the above features, Liquidity Modules that handle rebase tokens must have their internal pricing logic robust to arbitrary changes in token balances.
Last updated