Banks developed circuitous ways to participate in stock boom, warn analysts