Is every trade in a decentralised exchange a new smart contract? How does exchanging work in decentralised exchanges?
Depends on the exchange, but I doubt a trade is a new contract in any dex (decentralized exchange).
A trade is typically a call to a certain function in a contract. That function executes the trade by calling some background contract functionality to calculate ratios and so on.
If you wish to trade token A for token B, the trade looks typically something like this:
You call token A's token contract and add allowance for the dex to withdraw some amount of token A from you
You call the dex to tell that you want to trade A for B
The dex withdraws token A from you (because you have given it allowance to do so) and returns you token B