“It will be the single most important result of the night, by far”: I have now heard several close allies of David Cameron refer in such terms to the seat they cite as the bellwether, the one that symbolises all else. In 1992, it was Basildon, held by the Tories, that signalled John Major’s national victory; five years later, Michael Portillo’s defeat in Enfield Southgate dramatised the spectacular end of a long Conservative era. This time, strangely, it will be the fate of a Lib Dem that has most to tell the Tories about their immediate prospects.

Let us assume, as every pollster does, that the Tories are not going to win 323 or more seats. If Nick Clegg holds on to Sheffield Hallam, the constituency he has represented since 2005, Cameron will still have a Lib Dem partner with whom he can do business. If he is ousted by Labour’s Oliver Coppard, the deputy prime minister will be the most senior cabinet member to have suffered electoral defeat in modern times. Ramsay MacDonald lost his Seaham seat in November 1935, but had left No 10 in June, and was by then only lord president of the council – one of the lesser posts now held by Clegg, coincidentally.

But it will not be Clegg’s formal seniority that concerns his former Tory partners. Their (justified) anxiety will concern the identity of his successor, which depends in turn upon the number of leadership contenders who survive the night. It is a measure of the extent to which Cameron needs Clegg to survive that his next best hope is Ed Davey, the Lib Dem energy secretary, who has said that he finds it “incredibly difficult” to envisage another pact between his own party and the Tories. When you are pinning your hopes on the gap between “incredibly difficult” and “totally bloody impossible”, you know your strategy is perilous.

It is a measure of the extent to which Cameron needs Clegg to survive that his next best hope is Ed Davey

If Clegg remains in the game, and the latest Guardian/ICM poll indicates he will, he and Cameron can get to work. But the talks they must launch on Friday are not with each other: those negotiations have been going on in mused asides, broad hints and more forthright assertions ever since the first coalition was agreed.

The six red lines named by Clegg are his public response to Cameron’s demand for a referendum on EU membership. In fact, the deputy prime minister has always been much more relaxed about this than you might think. As he told me in December 2013: “I feel that the Liberal Democrat position on a referendum on the European issue is already far more forward-thinking than people give us credit for.”

The price tag would be an £8bn increase in the NHS budget; £2.5bn extra for education; guaranteed public sector pay rises; the elimination of the structural deficit by 2017-18; the rejection of the £12bn welfare cuts. Of these, one (the NHS pledge) has already figured prominently in the Tory campaign, and the others, with a single exception (welfare), are negotiable.

On welfare there is, and has long been, real tension between Clegg and George Osborne, who the Lib Dem leader recently told GQ magazine was “a very dangerous man with a very dangerous plan”. As far back as the spending review of 2013, Clegg has fought with the chancellor over the limits of benefit cuts. This is a serious divide. Yet the basis of a general agreement is already clear.

If the Tories win most seats, and the Lib Dems cling on to a decent number including Sheffield Hallam, what counts will not be the talks between Cameron and Clegg but the talks that each of them holds with his respective party. The Lib Dem tribe will almost certainly be traumatised by a night of losses directly attributable to its decision to prop up the Conservative party in 2010. Its parliamentary strength may have dwindled to a level between its showing in the 1992 election (20 seats) and 1997 (46). Will it be in any mood to persist with the Tory contaminant and to court extinction?

As for the Conservatives, much will depend upon a brutal aesthetic. Five years ago, Cameron failed to win a majority but won more new seats than any postwar Tory leader. He had formidable momentum and bankable political credibility. On Friday, barring a sensational upset, he will be explaining why he has lost seats at a time of economic recovery, facing a Labour opponent whose personal ratings have been mind-bogglingly low for most of his leadership. I think the party will tolerate the net loss of 20 or so seats, especially if Labour does not improve much on the 256 it held when parliament was dissolved.

Within these parameters, Cameron can declare that the result is a clear public instruction to finish the job, an expression of electoral impatience rather than an outright sacking. A bit of statesmanlike humility in Downing Street – and then a frantic campaign to persuade his own party, the Lib Dems and perhaps a third partner such as the DUP that, at the very least, a parliamentary pact can be made to work, if not a full-blown coalition, before the Queen’s speech on 27 May.

Prowling at the edges of this arithmetic quagmire is Boris Johnson, not yet returned to the Commons and in no rush to run for the leadership. As one Cameron ally puts it: “Boris still has an entourage rather than a real team.” He has, I am told, lit upon David Willetts as a policy guru: a good choice. But he still has much preparatory work to do. The mayor is getting to know his future colleagues in the house and is all too aware that talk of a “Boris coronation” makes his eventual succession to the leadership that much harder. This weekend he will be back in parliament, seven years after he resigned as MP for Henley, taking the pulse of the (probably) somewhat shrunken parliamentary party. He will not want to launch a leadership campaign even as he finds his new office.

In politics, of course, you do not choose your defining hour. A week from now, the new MP for Uxbridge and South Ruislip may be facing his. But he would really rather not – not yet, anyway. Not for the first time, the interests of the prime minister and the mayor converge more than might be suspected. They both need Cameron’s knack for governing without a majority to work a little longer.

• Matthew d’Ancona’s film on David Cameron will be shown on Newsnight on Wednesday at 10:30pm on BBC2