How can I measure outstanding debt? How much "stored value" is in Ripple at any given moment? Is there any way to measure how much stored value is in Ripple at any given moment?

I read that that people who are risk averse won't store cash in Ripple for long periods of time, and will redeem their IOUs right away.  Since the nature of transactions is for someone to "pay later" that makes me think there will always be stored value in the system.  Based on that:


How many IOUs (outstanding debt) has been issued at a given time? (stored value)
What is the average duration of a transaction (network wide, per gateway, etc)


How can I query for this data in raw format (or graphically)?
You can issue the account_lines command to a Ripple server to find out what credit lines have been extended by or to an account.

For example, you can use this websocket test page to issue websocket queries. Set the location to wss://s1.ripple.com:51233, click use secure, and then connect.

Then paste this in the Message window:
{ "command" : "account_lines", "account" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" }

This pulls the credit lines that Bitstamp has. You'll see entries like this:

     {
        "account" : "rrpNnNLKrartuEqfJGpqyDwPj1AFPg9vn1",
        "balance" : "-501.64408854616",
        "currency" : "BTC",
        "limit" : "0",
        "limit_peer" : "10000",
        "quality_in" : 0,
        "quality_out" : 0
     },


This means that Bitstamp owes rrpNnNLKrartuEqfJGpqyDwPj1AFPg9vn1 501.64 BTC (Bitcoins) and that user has extended them a credit limit of 10,000 Bitcoins.