  We consider a hypergraph (I,C), with possible multiple (hyper)edges and
loops, in which the vertices $i\in I$ are interpreted as agents, and the edges
$c\in C$ as contracts that can be concluded between agents. The preferences of
each agent i concerning the contracts where i takes part are given by use of a
choice function $f_i$ possessing the so-called path independent property. In
this general setup we introduce the notion of stable network of contracts.
  The paper contains two main results. The first one is that a general problem
on stable systems of contracts for (I,C,f) is reduced to a set of special ones
in which preferences of agents are described by use of so-called weak orders,
or utility functions. However, for a special case of this sort, the stability
may not exist. Trying to overcome this trouble when dealing with such special
cases, we introduce a weaker notion of metastability for systems of contracts.
Our second result is that a metastable system always exists.
