A counterparty is the other party to a financial contract, trade or transaction. In a loan the borrower is the lender's counterparty; in a foreign exchange deal or an OTC derivatives contract each side is the other's counterparty, and each depends on the other to perform what was agreed.
The main concern is counterparty risk, the chance that the other side defaults before or during settlement. Firms manage it by assessing creditworthiness, setting a counterparty credit limit, taking collateral, netting exposures under master agreements and, in many markets, clearing trades through a central counterparty (CCP), which steps in between the original parties and becomes the counterparty to each. Before trading, financial institutions also carry out due diligence on a new counterparty, similar to the KYC checks applied to customers, to confirm its identity, ownership and sanctions status.