In an action to recover a debt due upon a written agreement, plaintiff appeals from an order of the Supreme Court, Richmond County, dated October 20, 1980, which denied his motion to strike the defendant’s demand for a jury trial and to restore the action to the Nonjury Calendar. Order reversed, *910with $50 costs and disbursements, and motion granted. The character of a defense and counterclaim is controlled by the substance of the facts alleged, and not solely by its prayer for relief (Wainwright & Page v Burr & McAuley, 272 NY 130; Auerbach v Chase Nat. Bank of City ofN. Y., 251 App Div 543). Plaintiff, Carlo Seneca, held 30 shares of stock as security for repayment of a $32,500 debt owed by defendant, Joseph No varo. The security was entrusted to Seneca in a fiduciary capacity (see Morris v Windsor Trust Co., 213 NY 27, 31; Kono v Roeth, 237 App Div 252). The basis for an equitable action for an accounting is the existence of a fiduciary or trust relation respecting the subject matter of the controversy (Darlagiannis v Darlagiannis, 48 AD2d 875). In the instant case, the gravamen of Novaro’s defense and counterclaim, from the facts alleged, is a breach of Seneca’s fiduciary duty. Novaro contends that the security was prematurely sold, and for a fraction of its fair market value. Determination of the security’s true worth so as to ascertain the reasonability of the sale and the extent of Novaro’s loss necessitates an accounting. Breach of a fiduciary duty and an accounting sound in equity. Novaro’s defense and counterclaim is therefore equitable in nature, and not triable by a jury (see CPLR 4101). Where a plaintiff brings a claim triable by jury and the defendant interposes a related counterclaim not triable by jury, the defendant is held to have waived a jury trial even on the main claim (Compact Plectra Corp. v Connell, 46 AD2d 649). Damiani, J. P., Gibbons, Hargett and O’Connor, JJ., concur.