People can swap cryptocurrencies or put up collateral and receive a loan on the exchange. Smart contracts execute these transactions and collect transaction fees. Liquidity providers receive a cut of the transaction fees as a reward for lending their cryptocurrency funds.
Who pays for smart contract?
With every transaction client pays the fee, in gas, and this gas will be used to execute called smart contract function. the one who send the transaction will have to pay the gas cost of executing that particular function in the contract. You may refer this question as well.
Can anyone write a smart contract?
Anyone can write a smart contract and deploy it to the network. You just need to learn how to code in a smart contract language, and have enough ETH to deploy your contract.