code: def _funds_remaining(self) -> int:
          
          if self.funds > 0:
              token = self.raiden.chain.token(self.token_address)
              token_balance = token.balance_of(self.raiden.address)
              sum_deposits = views.get_our_capacity_for_token_network(
                  views.state_from_raiden(self.raiden),
                  self.registry_address,
                  self.token_address,
              )
  
              return min(self.funds - sum_deposits, token_balance)
  
          return 0
docs: The remaining funds after subtracting the already deposited amounts.
  
          Note:
              - This attribute must be accessed with the lock held.