Skip to content

Instantly share code, notes, and snippets.

@archiewood
Created July 23, 2024 01:36
Show Gist options
  • Save archiewood/57250c41ee4694910bc3b74b63d2e6d8 to your computer and use it in GitHub Desktop.
Save archiewood/57250c41ee4694910bc3b74b63d2e6d8 to your computer and use it in GitHub Desktop.
Win Probability for the US election in SQL
select
date,
contractname as candidate,
substring(closeshareprice,2,10)::double as implied_probability
from read_csv('https://www.predictit.org/Resource/DownloadMarketChartData?marketid=7456')
order by date desc, implied_probability desc
limit 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment