Skip to content

Commit ebe073f

Browse files
committed
filter mre
1 parent e24b989 commit ebe073f

File tree

5 files changed

+44
-11
lines changed

5 files changed

+44
-11
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.23
55
// toolchain go1.23.2
66

77
require (
8-
github.com/Gearbox-protocol/sdk-go v0.0.0-20250827070817-ec3080f40c01
8+
github.com/Gearbox-protocol/sdk-go v0.0.0-20250925130429-e76c7ad9ed0b
99
github.com/ethereum/go-ethereum v1.13.14
1010
github.com/go-playground/validator/v10 v10.4.1
1111
github.com/google/go-cmp v0.6.0
@@ -84,6 +84,6 @@ require (
8484

8585
replace github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.1
8686

87-
replace github.com/Gearbox-protocol/sdk-go v0.0.0-20250823150503-bcf2904cd922 => ../sdk-go
87+
replace github.com/Gearbox-protocol/sdk-go v0.0.0-20250827070817-ec3080f40c01 => ../sdk-go
8888

8989
replace github.com/ethereum/go-ethereum v1.13.14 => github.com/OffchainLabs/go-ethereum v1.13.4-0.20240313010929-e5d8587e7227

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ
66
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
77
github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ=
88
github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
9-
github.com/Gearbox-protocol/sdk-go v0.0.0-20250827070817-ec3080f40c01 h1:yKBpVn2pWYlTLnnWk32TnVBJP3stgRAs+iFiEFjpslk=
10-
github.com/Gearbox-protocol/sdk-go v0.0.0-20250827070817-ec3080f40c01/go.mod h1:MZsiiSAwDdnHY6GEILYtHEqhb9wmbUUE34UBQgNlUyM=
9+
github.com/Gearbox-protocol/sdk-go v0.0.0-20250925130429-e76c7ad9ed0b h1:ETKEWAfZwcswYAtZ/oZa/Li/xvi4jnjlGNYpvU/gA28=
10+
github.com/Gearbox-protocol/sdk-go v0.0.0-20250925130429-e76c7ad9ed0b/go.mod h1:MZsiiSAwDdnHY6GEILYtHEqhb9wmbUUE34UBQgNlUyM=
1111
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
1212
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
1313
github.com/OffchainLabs/go-ethereum v1.13.4-0.20240313010929-e5d8587e7227 h1:+/3TrD+q+BP36jGj2Bycdmrc/joKLNbc5ImePQzKRLM=

models/aggregated_block_feed/base_price_feed/call_and_process.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ func (mdl *BasePriceFeed) GetUnderlyingCalls(blockNum int64) (calls []multicall.
112112
}
113113
if tokenDetails != nil {
114114
pod := mdl.Repo.GetRedStonemgr().GetPodSignWithRedstoneToken(int64(mdl.Repo.SetAndGetBlock(blockNum).Timestamp), *tokenDetails)
115+
log.Info(pod.CallData)
115116
update, err := updateABI.Pack("updatePrice", pod.CallData)
116117
log.CheckFatal(err)
117118
calls = append(calls, multicall.Multicall2Call{

models/aggregated_block_feed/model.go

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,47 @@ func createPriceFeedOnInit(qpf ds.QueryPriceFeedI, client core.ClientI, discover
104104
}
105105
mainPFContract, err := priceFeed.NewPriceFeed(common.HexToAddress(qpf.GetAddress()), client)
106106
log.CheckFatal(err)
107-
data, err := mainPFContract.LatestRoundData(&bind.CallOpts{BlockNumber: big.NewInt(discoveredAt)})
107+
type _xx struct {
108+
RoundId *big.Int
109+
Answer *big.Int
110+
StartedAt *big.Int
111+
UpdatedAt *big.Int
112+
AnsweredInRound *big.Int
113+
}
114+
if qpf.GetAddress() == "0x354D10C2FecC251a85593500FA1942b19C03b4CC" {
115+
return nil
116+
}
117+
// xx := _xx{}
118+
// calls, isQueryable := qpf.GetCalls(discoveredAt)
119+
// if qpf.GetAddress() == "0x354D10C2FecC251a85593500FA1942b19C03b4CC" {
120+
// calls = calls[1:]
121+
// }
122+
// if isQueryable {
123+
// log.Info(len(calls))
124+
// for _, x := range calls {
125+
// log.Info(x.Target)
126+
// }
127+
// results := core.MakeMultiCall(client, discoveredAt, false, calls)
128+
// log.Info(utils.ToJson(results))
129+
// data := qpf.ProcessResult(discoveredAt, results, "", true)
130+
// if data == nil {
131+
// log.Fatal("Price feed init failed using queryadapter redstone resolve too for ", qpf.GetAddress(), " at block: ", discoveredAt)
132+
// }
133+
// xx.RoundId = big.NewInt(data.RoundId)
134+
// xx.Answer = (*big.Int)(data.PriceBI)
135+
// } else {
136+
// xx.RoundId = data.RoundId
137+
// xx.Answer = data.Answer
138+
// }
139+
xx, err := mainPFContract.LatestRoundData(&bind.CallOpts{BlockNumber: big.NewInt(discoveredAt)})
108140
log.CheckFatal(err)
109141
//
110142
return []*schemas.PriceFeed{{
111143
BlockNumber: discoveredAt,
112144
Feed: qpf.GetAddress(),
113-
RoundId: data.RoundId.Int64(),
114-
PriceBI: (*core.BigInt)(data.Answer),
115-
Price: utils.GetFloat64Decimal(data.Answer, version.Decimals()),
145+
RoundId: xx.RoundId.Int64(),
146+
PriceBI: (*core.BigInt)(xx.Answer),
147+
Price: utils.GetFloat64Decimal(xx.Answer, version.Decimals()),
116148
}}
117149
}
118150

models/price_oracle/po_v3/on_log.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,10 @@ func (mdl *PriceOracle) V3PriceFeedType(opts *bind.CallOpts, oracle, token strin
274274
return ds.YearnPF, nil, nil
275275
case core.V3_CHAINLINK_ORACLE:
276276
log.Fatal("Chainlink oracle should be handled in v3") // as already handled by phaseId check
277-
case core.V3_CURVE_USD_ORACLE, core.V3_CURVE_CRYPTO_ORACLE:
278-
return ds.CurvePF, nil, nil
277+
// case :
278+
// return ds.CurvePF, nil, nil
279279
// usd and crypto
280-
case core.V3_CURVE_2LP_ORACLE, core.V3_CURVE_3LP_ORACLE, core.V3_CURVE_4LP_ORACLE: // 2lp,3lp, 4lp
280+
case core.V3_CURVE_USD_ORACLE, core.V3_CURVE_CRYPTO_ORACLE, core.V3_CURVE_2LP_ORACLE, core.V3_CURVE_3LP_ORACLE, core.V3_CURVE_4LP_ORACLE: // 2lp,3lp, 4lp
281281
nCoinBytes, err := core.CallFuncGetSingleValue(mdl.Client, "c21ee162", common.HexToAddress(oracle), 0, nil)
282282
log.CheckFatal(err)
283283
fn := func(n int) string {

0 commit comments

Comments
 (0)