Skip to content

Commit 04f4af2

Browse files
committed
fix: Hard-coded price for XUSD.
1 parent 8567527 commit 04f4af2

File tree

1 file changed

+11
-0
lines changed
  • models/aggregated_block_feed/pyth_feed

1 file changed

+11
-0
lines changed

models/aggregated_block_feed/pyth_feed/model.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ package pyth_feed
22

33
import (
44
"encoding/hex"
5+
"math/big"
56

67
"github.com/Gearbox-protocol/sdk-go/artifacts/multicall"
78
"github.com/Gearbox-protocol/sdk-go/core"
89
"github.com/Gearbox-protocol/sdk-go/core/schemas"
910
"github.com/Gearbox-protocol/sdk-go/log"
1011
"github.com/Gearbox-protocol/sdk-go/pkg"
12+
"github.com/Gearbox-protocol/sdk-go/utils"
1113
"github.com/Gearbox-protocol/third-eye/ds"
1214
"github.com/Gearbox-protocol/third-eye/models/aggregated_block_feed/base_price_feed"
1315
"github.com/ethereum/go-ethereum/common"
@@ -45,6 +47,15 @@ func (adapter *PythPriceFeed) ProcessResult(blockNum int64, results []multicall.
4547
ts := adapter.Repo.SetAndGetBlock(blockNum).Timestamp
4648
obj, err := pkg.GetPythPrice(adapter.DetailsDS.Underlyings[0], int64(ts))
4749
if err != nil {
50+
if adapter.Address == "0x258b53A9eAe313ca83E42C444ff2799781fC791E" {
51+
price := big.NewInt(126_000_000)
52+
return &schemas.PriceFeed{
53+
RoundId: 0,
54+
PriceBI: (*core.BigInt)(price),
55+
Price: utils.GetFloat64Decimal(price, 8),
56+
BlockNumber: blockNum,
57+
}
58+
}
4859
log.Fatal("Pyth price feed", adapter.GetAddress(), " failed at block: ", blockNum, err)
4960
}
5061
return &schemas.PriceFeed{

0 commit comments

Comments
 (0)