Derbyshire 135 for 5 (Dal 40*) trail Glamorgan 550 for 5 dec (Lloyd 313*, Root 79) by 415 runs
Glamorgan captain David Lloyd got the highest-ever first-class score by a Welshman of 313 not out to put his side in control against Derbyshire.
They declared on a massive 550 for 5, and Lloyd's day got even better as New Zealand spinner Ajaz Patel and the Welsh County bowlers reduced Derbyshire to 135 for 5 at the close, still 415 behind.
The records kept falling for Glamorgan and Lloyd. The second highest score by a Glamorgan player, behind Sam Northeast's 410 against Leicestershire earlier this season, making it the first time that two players at the same county had registered quadruple and triple centuries in the same season.
It was also the highest score for a Glamorgan captain, while things went from bad to worse for opposite number Ben Godleman. He followed up the decision to insert Glamorgan with a duck opening the batting to set the tone for his side.
North Wales-born Lloyd started the day with a double century to his name, but plenty of landmarks ahead of him. He lost overnight partner Billy Root and Chris Cooke relatively early, but then found a solid associate in Andrew Salter.
First the 30-year-old went past the 233 scored by Hugh Morris, now the county's chief executive, as captain. He was dropped by substitute Nafis Shaikh from a top-edged sweep, a simple enough chance, when on 258 off the bowling of Alex Thomson.
Next up was Mike Powell's 299, the highest first class score by a Welsh-born player. A six off Thomson took him past that and the 300 mark. Then Steve James' 309, the highest Glamorgan score until this season, was in his sights.
When he reached 313 not out, off 398 balls, equalling the highest individual score at Sophia Gardens, scored by South African Jimmy Cook, Lloyd decided to call it a day and declared.
Salter finished unbeaten on 45, his highest score of the season on being recalled to the team, their unbeaten partnership worth 151, Lloyd also enjoying a double-century partnership with Root and a century partnership with Tom Bevan.
Derbyshire's bowling figures were not pretty, for instance Thomson conceding 174 runs off his 41.2 overs.
Derbyshire started batting knowing they required more than 400 to save the follow-on with Godleman in poor form and not lasting long before edging Michael Hogan to Patel at third slip.
Brooke Guest flourished briefly before becoming Patel's first victim bowling, while Wayne Madsen went next ball - meaning his number of career ducks for Derbyshire, 35, edged past the number of career centuries, 34.
Leus du Plooy edged behind off Timm van der Gugten, while at the other end Luis Reece seemed to be playing a different set of bowlers reaching his half century out of the first 63 runs scored.
However the introduction of Salter, turning the ball away from the left hander, did for Reece, caught behind for 56 as Derbyshire slumped to 75 for 5 just after tea.
Harry Came, 21 not out, and Anuj Dal, 40 not out, steadied the ship and saw out the rest of the session, but their side still have a tough task over the two remaining days if they are to save the game.