Skip to content

Commit

Permalink
fix: remove hard-coded unibi:uusd price
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yang committed Apr 24, 2024
1 parent 38b9be6 commit 0408661
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions feeder/priceprovider/aggregateprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"encoding/json"

"github.com/NibiruChain/nibiru/x/common/asset"
"github.com/NibiruChain/nibiru/x/common/denoms"
"github.com/NibiruChain/pricefeeder/types"
"github.com/rs/zerolog"
)
Expand Down Expand Up @@ -42,29 +41,6 @@ func NewAggregatePriceProvider(
// Iteration is exhaustive and random.
// If no correct PriceResponse is found, then an invalid PriceResponse is returned.
func (a AggregatePriceProvider) GetPrice(pair asset.Pair) types.Price {
// Temporarily treat NUSD as perfectly pegged to the US fiat dollar
// TODO(k-yang): add the NUSD pricefeed once it's available on exchanges
if pair.Equal(asset.Registry.Pair(denoms.NUSD, denoms.USD)) {
return types.Price{
SourceName: "temporarily-hardcoded",
Pair: pair,
Price: 1,
Valid: true,
}
}

// Temporarily provide NIBI price based on last raise, 1.5 billion token supply @ $100M
// TODO(k-yang): add the NUSD pricefeed once it's available on exchanges
if pair.Equal(asset.Registry.Pair(denoms.NIBI, denoms.USD)) ||
pair.Equal(asset.Registry.Pair(denoms.NIBI, denoms.NUSD)) {
return types.Price{
SourceName: "temporarily-hardcoded",
Pair: pair,
Price: 0.06666666666666667,
Valid: true,
}
}

// iterate randomly, if we find a valid price, we return it
// otherwise we go onto the next PriceProvider to ask for prices.
for _, p := range a.providers {
Expand Down

0 comments on commit 0408661

Please sign in to comment.