@@ -213,12 +213,19 @@ export class GeminiNormalizer implements IExchangeNormalizer<GeminiRawEvent, Gem
213213 // Extract prices
214214 const bestBid = contract . prices ?. bestBid ? parseFloat ( contract . prices . bestBid ) : 0.5 ;
215215 const bestAsk = contract . prices ?. bestAsk ? parseFloat ( contract . prices . bestAsk ) : 0.5 ;
216+ const buyYes = contract . prices ?. buy ?. yes ? parseFloat ( contract . prices . buy . yes ) : undefined ;
217+ const sellYes = contract . prices ?. sell ?. yes ? parseFloat ( contract . prices . sell . yes ) : undefined ;
218+ const buyNo = contract . prices ?. buy ?. no ? parseFloat ( contract . prices . buy . no ) : undefined ;
219+ const sellNo = contract . prices ?. sell ?. no ? parseFloat ( contract . prices . sell . no ) : undefined ;
216220 const lastPrice = contract . prices ?. lastTradePrice
217221 ? parseFloat ( contract . prices . lastTradePrice )
218222 : ( bestBid + bestAsk ) / 2 ;
219223
220- const yesPrice = roundPrice ( Math . max ( 0 , Math . min ( 1 , lastPrice ) ) ) ;
221- const noPrice = roundPrice ( Math . max ( 0 , Math . min ( 1 , 1 - yesPrice ) ) ) ;
224+ const yesPriceSource = buyYes ?? sellYes ?? lastPrice ;
225+ const noPriceSource = buyNo ?? sellNo ?? ( 1 - yesPriceSource ) ;
226+
227+ const yesPrice = roundPrice ( Math . max ( 0 , Math . min ( 1 , yesPriceSource ) ) ) ;
228+ const noPrice = roundPrice ( Math . max ( 0 , Math . min ( 1 , noPriceSource ) ) ) ;
222229
223230 const outcomes : MarketOutcome [ ] = [
224231 {
@@ -258,7 +265,7 @@ export class GeminiNormalizer implements IExchangeNormalizer<GeminiRawEvent, Gem
258265 outcomes,
259266 resolutionDate,
260267 volume24h : 0 ,
261- liquidity : event . liquidity ? parseFloat ( event . liquidity ) : 0 ,
268+ liquidity : event . liquidity ? parseFloat ( event . liquidity ) : ( event . volume24h ? parseFloat ( event . volume24h ) : ( event . volume ? parseFloat ( event . volume ) : 0 ) ) ,
262269 url : buildExchangeUrl ( event . ticker ) ,
263270 category : event . category ,
264271 tags,
0 commit comments