Just stumbled across this fascinating video. A number of years ago I tried to set up a similar scheme, but Mike Moyer seems to have done a great job of adding risk weighting factors and anticipating all the possible scenarios.
Link: http://slicingpie.com/slicing-pie-at-the-international-startup-festival-in-montreal