@@ -8,7 +8,7 @@ use substreams::errors::Error;
88use substreams:: scalar:: { BigDecimal , BigInt } ;
99use substreams:: store:: StoreNew ;
1010use substreams:: store:: { StoreGet , StoreGetProto , StoreSetIfNotExistsProto } ;
11- use substreams:: store:: { StoreSet , StoreSetBigInt , StoreSetIfNotExists } ;
11+ use substreams:: store:: { StoreSet , StoreSetBigDecimal , StoreSetIfNotExists } ;
1212use substreams:: Hex ;
1313use substreams_entity_change:: pb:: entity:: EntityChanges ;
1414use substreams_entity_change:: tables:: Tables ;
@@ -123,7 +123,7 @@ fn get_chainlink_answers(
123123}
124124
125125#[ substreams:: handlers:: store]
126- fn chainlink_price_store ( events : Prices , output : StoreSetBigInt ) {
126+ fn chainlink_price_store ( events : Prices , output : StoreSetBigDecimal ) {
127127 for price in events. items {
128128 let asset_description = price. clone ( ) . asset_pair . unwrap ( ) ;
129129
@@ -156,7 +156,7 @@ fn chainlink_price_store(events: Prices, output: StoreSetBigInt) {
156156 . unwrap( )
157157 . address
158158 ) ,
159- & BigInt :: from_str ( & price. raw_price ) . unwrap ( ) ,
159+ & BigDecimal :: from_str ( & price. price ) . unwrap ( ) ,
160160 ) ;
161161 }
162162 }
@@ -167,13 +167,13 @@ fn chainlink_price_store(events: Prices, output: StoreSetBigInt) {
167167 "price_by_aggregator:{}" ,
168168 price. clone( ) . asset_pair. unwrap( ) . aggregator_address
169169 ) ,
170- & BigInt :: from_str ( & price. raw_price ) . unwrap ( ) ,
170+ & BigDecimal :: from_str ( & price. price ) . unwrap ( ) ,
171171 ) ;
172172
173173 output. set (
174174 0 ,
175175 format ! ( "price_by_symbol:{}" , split_description. join( ":" ) ) ,
176- & BigInt :: from_str ( & price. raw_price ) . unwrap ( ) ,
176+ & BigDecimal :: from_str ( & price. price ) . unwrap ( ) ,
177177 ) ;
178178 }
179179}
0 commit comments