Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimum auction height update and fee counter initialization #276

Merged
merged 5 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/upgrades/v7/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ package v7
// UpgradeName defines the on-chain upgrade name for the Sommelier v7 upgrade
const UpgradeName = "v7"

// Fee denominations
const (
usdcDenom = "gravity0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
fraxDenom = "gravity0x853d955aCEf822Db058eb8505911ED77F175b99e"
wethDenom = "gravity0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
wbtcDenom = "gravity0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"
)

// 7seas domain
const SevenSeasDomain = "sevenseas.capital"

Expand Down
33 changes: 28 additions & 5 deletions app/upgrades/v7/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,29 @@ func CreateUpgradeHandler(
func cellarfeesInitGenesis(ctx sdk.Context, cellarfeesKeeper cellarfeeskeeper.Keeper) {
genesisState := cellarfeestypes.DefaultGenesisState()

counters := cellarfeestypes.FeeAccrualCounters{
Counters: []cellarfeestypes.FeeAccrualCounter{
{
Denom: fraxDenom,
Count: 2,
},
{
Denom: usdcDenom,
Count: 2,
},
{
Denom: wbtcDenom,
Count: 2,
},
{
Denom: wethDenom,
Count: 2,
},
},
}

genesisState.FeeAccrualCounters = counters

if err := genesisState.Validate(); err != nil {
panic(fmt.Errorf("cellarfees genesis state invalid: %s", err))
}
Expand All @@ -86,7 +109,7 @@ func cellarfeesInitGenesis(ctx sdk.Context, cellarfeesKeeper cellarfeeskeeper.Ke
func auctionInitGenesis(ctx sdk.Context, auctionKeeper auctionkeeper.Keeper) {
genesisState := auctiontypes.DefaultGenesisState()

genesisState.Params.MinimumAuctionHeight = 13020000 // roughly 2024-02-08 09:30 UTC
genesisState.Params.MinimumAuctionHeight = 13110000 // roughly 2024-02-14 01:00 UTC

usomm52WeekLow := sdk.MustNewDecFromStr("0.079151")
eth52WeekHigh := sdk.MustNewDecFromStr("2618.33")
Expand All @@ -104,7 +127,7 @@ func auctionInitGenesis(ctx sdk.Context, auctionKeeper auctionkeeper.Keeper) {

// setting stables to 1 dollar
usdcPrice := auctiontypes.TokenPrice{
Denom: "gravity0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
Denom: usdcDenom,
UsdPrice: oneDollar,
Exponent: 6,
LastUpdatedBlock: lastUpdatedBlock,
Expand All @@ -125,22 +148,22 @@ func auctionInitGenesis(ctx sdk.Context, auctionKeeper auctionkeeper.Keeper) {
}

fraxPrice := auctiontypes.TokenPrice{
Denom: "gravity0x853d955aCEf822Db058eb8505911ED77F175b99e",
Denom: fraxDenom,
UsdPrice: oneDollar,
Exponent: 18,
LastUpdatedBlock: lastUpdatedBlock,
}

// setting non-stables
wethPrice := auctiontypes.TokenPrice{
Denom: "gravity0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
Denom: wethDenom,
UsdPrice: eth52WeekHigh,
Exponent: 18,
LastUpdatedBlock: lastUpdatedBlock,
}

wbtcPrice := auctiontypes.TokenPrice{
Denom: "gravity0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
Denom: wbtcDenom,
UsdPrice: btc52WeekHigh,
Exponent: 8,
LastUpdatedBlock: lastUpdatedBlock,
Expand Down
Loading