Less Technical
Implementation
Old Stuff
Older Stuff
Oldest Stuff |
Main /
CreditRelationshipExampleThere is a basic explanation of the Credit Relationship concept at Definitions. In this extended example, we look at the accounting for a credit relationship as it evolves over time. Ryan and Thomas represent two neighbor nodes that have a credit relationship with each other that has been registered with some ripple server. Ryan has a 500 USD (U.S. Dollars) line of credit with Thomas, and Thomas has a 1,000 USD line of credit with Ryan. Ryan wants to limit himself to going no more than $1,000 in debt with Thomas, and Thomas wants to limit himself to going no more than $5,000 in debt with Ryan. So, for practical purposes, Ryan starts with $500 available credit from Thomas, and Thomas has $1,000 available credit with Ryan. Initially, neither node has used any of its line of credit Ryan-Thomas USD Credit Relationship
Ryan (values that Ryan can change)
Thomas's Credit Limit: 1,000
Ryan's Issuance Limit: 1,000 (could be set to, eg, 1 billion, if Ryan wants no issuance limit)
Thomas (values that Thomas can change)
Ryan's Credit Limit: 500
Thomas's Issuance Limit: 5000
Result:
Balance of Payments: 0
Ryan's Available Credit with Thomas: 500 (smaller of 500 and 1,000)
Thomas's Available Credit with Ryan: 1,000 (smaller of 1,000 and 5,000)
Time passes, and thomas uses $200 of his available credit with Ryan to purchase a guitar -- which means the same thing as "Thomas makes a $200 ripple payment to Ryan." The credit relationship now is as follows: Credit/Issuance Limits unchanged.
Balance of Payments:
-$200 (from thomas's point of view)
+$200 (from ryan's point of view)
Ryan's available credit with Thomas: 700 (smaller of (500+200) and 1,000)
Thomas's available credit with Ryan: 800 (smaller of (1000-200) and 5,000)
More time passes, and Thomas buys a bed from Ryan with a $700 ripple payment. The credit relationship now is as follows Credit/Issuance Limits unchanged Balance of Payments: -900 (from Thomas's point of view) +900 (from Ryan's point of view) Ryan's available credit with Thomas: 1,000 (smaller of (500+900) and 1,000) Thomas's available credit with Ryan: 100 (smaller of 1,000-900) and 5,000) Ryan would now like to buy a laptop from Thomas, that Thomas is selling for $1,200. Initially he can't do this because he set his own issuance limit at $1,000. So, Ryan adjusts his issuance payment upward to $1,300 in order to make the payment. We now have Ryan's available credit with Thomas: 1,300 (smaller of (500+900) and 1,300, the new issuance limit) He then purchases the laptop for $1200, and we have Result:
Balance of Payments:
+300 (from thomas's point of view)
-300 (from ryan's point of view)
Ryan's Available Credit with Thomas: 200 (smaller of 500-300 and 1,300)
Thomas's Available Credit with Ryan: 1,300 (smaller of 1,000 + 300 and 5,000)
|