File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
src/mapping/proxy-price-provider Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -143,19 +143,18 @@ export function priceFeedUpdated(
143143
144144 // Type simple means that the source is chainlink source
145145 if ( priceOracleAsset . type == PRICE_ORACLE_ASSET_TYPE_SIMPLE ) {
146+ let aggregatorAddress = assetOracleAddress ;
147+
146148 // get underlying aggregator from proxy (assetOracleAddress) address
147149 let chainlinkProxyInstance = EACAggregatorProxy . bind ( assetOracleAddress ) ;
148150 let aggregatorAddressCall = chainlinkProxyInstance . try_aggregator ( ) ;
149- // If we can't get the aggregator, it means that the source address is not a chainlink proxy
150- // so it has been registered badly.
151- if ( aggregatorAddressCall . reverted ) {
152- log . error (
153- `PROXY: Simple Type must be a chainlink proxy. || asset: {} | assetOracleAddress: {}` ,
154- [ sAssetAddress , assetOracleAddress . toHexString ( ) ]
155- ) ;
156- return ;
151+
152+ // If aggregator() call succeeds, it's a proxy - use the underlying aggregator
153+ // If it fails, the source address itself is the direct aggregator (e.g., PT tokens)
154+ if ( ! aggregatorAddressCall . reverted ) {
155+ aggregatorAddress = aggregatorAddressCall . value ;
157156 }
158- let aggregatorAddress = aggregatorAddressCall . value ;
157+
159158 priceOracleAsset . priceSource = aggregatorAddress ;
160159 // create ChainLink aggregator template entity
161160 ChainlinkAggregatorContract . create ( aggregatorAddress ) ;
You can’t perform that action at this time.
0 commit comments