Virtually all petroleum (and shale-oil) deposits were formed in shallow seas, though possibly in lakes or wetlands (though swamps are more associated with coal-bed formation). Oil is largely metamorphosed algae.
J.R. Dyni, "Geology and Resources Of Some World Oil-Shale Deposits" (2003)
Oil shales were deposited in a variety of depositional environments including fresh-water to highly saline lakes, epicontinental marine basins and subtidal shelves, and in limnic and coastal swamps, commonly in association with
deposits of coal.
Virtually all petroleum (and shale-oil) deposits were formed in shallow seas, though possibly in lakes or wetlands (though swamps are more associated with coal-bed formation). Oil is largely metamorphosed algae.
J.R. Dyni, "Geology and Resources Of Some World Oil-Shale Deposits" (2003)
Oil shales were deposited in a variety of depositional environments including fresh-water to highly saline lakes, epicontinental marine basins and subtidal shelves, and in limnic and coastal swamps, commonly in association with deposits of coal.
<https://kirj.ee/public/oilshale/2_dyni_2003_3.pdf> (PDF)