You simply need to keep track of who deposited and how much. It can be as simple as
mapping(address => uint) - remember also that probably a user can make multiple deposits from the same address so you need to increase that value and not overwrite.
You can modify the mapping entries simply with something like this (assuming
mymap is the mapping:
mymap[msg.sender] += msg.value.
Depending on how you are planning to pay the deposits back you maybe need another data structure to store the addresses (an array), if you want to push the deposits. But if users can pull the deposits (call something like
giveMeMyDepositBack) then you don't need a separate data structure and you can simply send back the deposit minus fee.