Skip to content

Commit 26ffe85

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

File tree

1 file changed

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

1 file changed

+12
-0
lines changed

models/aggregated_block_feed/pyth_feed/model.go

Lines changed: 12 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"
@@ -39,7 +41,17 @@ func (feed PythPriceFeed) GetCalls(blockNum int64) (calls []multicall.Multicall2
3941
}
4042

4143
func (adapter *PythPriceFeed) ProcessResult(blockNum int64, results []multicall.Multicall2Result, _ string, force ...bool) *schemas.PriceFeed {
44+
if adapter.Address == "0x258b53A9eAe313ca83E42C444ff2799781fC791E" {
45+
price := big.NewInt(126_000_000)
46+
return &schemas.PriceFeed{
47+
RoundId: 0,
48+
PriceBI: (*core.BigInt)(price),
49+
Price: utils.GetFloat64Decimal(price, 8),
50+
BlockNumber: blockNum,
51+
}
52+
}
4253
result := results[len(results)-1]
54+
4355
if !result.Success {
4456
if len(force) > 0 && force[0] {
4557
ts := adapter.Repo.SetAndGetBlock(blockNum).Timestamp

0 commit comments

Comments
 (0)