You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the cellarfees module only considers denominations bridged over Gravity from a Cellar contract when evaluating whether to start auctions. It keeps a count of how many fee accruals have occurred per-denomination in state, and after a counter reaches some threshold, an auction is triggered.
This design requires:
Extra state (counters)
Event handling code to determine whether to alter that state every time the module account receives tokens.
In order to support IBC fee token denominations under the current model, we would need an IBC Middleware to do the same kind of validation for each token transferred in order to update fee accrual counter state.
Proposed design
One alternative to this approach is to instead evaluate auction eligibility based on the USD value of each denomination that has a registered TokenPrice in the auction module. Each TokenPrice is by convention set to a recent 52-week high price to help ensure auctions start with high prices. If the USD value threshold for auction start is sufficiently high, say ~$5000-$10000, auctions are still likely to present acceptable arbitrage opportunities even if a token's market value is significantly lower. In fact, setting an arbitrary USD value doesn't seem to be any more or less accurate at determining arbitrage validity than fee accrual counters to me, but it does allow us to significantly reduce module complexity.
Doing this would mean we don't need IBC middleware or the existing gravity hook, because we wouldn't need the counter state. And without the counter state, we don't need to check that the sender of the fees was a Cellar to prevent spam from starting auctions. Less significantly this also means if for some reason the module account receives a lot of valid fee tokens from other sources, they can be auctioned without an extra fee accrual needed to trigger it.
Resulting changes to x/cellarfees
Removal of the AfterSendToCosmos gravity hook
Removal of cellarfees gravity keeper entirely as it is only currently used to do ERC20 denom lookups in the hook
Change BeginBlock to iterating over TokenPrices and checking the module account's balances against a USD threshold instead of checking fee accrual counter
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Current design
Currently the
cellarfees
module only considers denominations bridged over Gravity from a Cellar contract when evaluating whether to start auctions. It keeps a count of how many fee accruals have occurred per-denomination in state, and after a counter reaches some threshold, an auction is triggered.This design requires:
In order to support IBC fee token denominations under the current model, we would need an IBC Middleware to do the same kind of validation for each token transferred in order to update fee accrual counter state.
Proposed design
One alternative to this approach is to instead evaluate auction eligibility based on the USD value of each denomination that has a registered
TokenPrice
in the auction module. EachTokenPrice
is by convention set to a recent 52-week high price to help ensure auctions start with high prices. If the USD value threshold for auction start is sufficiently high, say ~$5000-$10000, auctions are still likely to present acceptable arbitrage opportunities even if a token's market value is significantly lower. In fact, setting an arbitrary USD value doesn't seem to be any more or less accurate at determining arbitrage validity than fee accrual counters to me, but it does allow us to significantly reduce module complexity.Doing this would mean we don't need IBC middleware or the existing gravity hook, because we wouldn't need the counter state. And without the counter state, we don't need to check that the sender of the fees was a Cellar to prevent spam from starting auctions. Less significantly this also means if for some reason the module account receives a lot of valid fee tokens from other sources, they can be auctioned without an extra fee accrual needed to trigger it.
Resulting changes to x/cellarfees
AfterSendToCosmos
gravity hookcellarfees
gravity keeper entirely as it is only currently used to do ERC20 denom lookups in the hookBeginBlock
to iterating overTokenPrice
s and checking the module account's balances against a USD threshold instead of checking fee accrual counterBeta Was this translation helpful? Give feedback.
All reactions