Main | March 2006 »

February 28, 2006

Payment Systems in Australia - part 1.

Money in australia exists in one of two forms - as cash (coins and banknotes) or in bank accounts, which (shush! don't tell anyone!) are really just records in a computer somewhere. When a payment is made, then either cash changes hands, or else the computer records are updated to debit one account and credit the other.

This is part 1 of a series of posts that give a brief introduction to what those computer systems are that store the bank accounts, and how the records get updated.

The first, and most important, player in payment systems in Australia is the Reserve Bank of Australia. Most people would know the RBA's role in setting interest rates and Money Supply), but it also makes sure that all the banks play nicely with each other, that they don't invent money of their own, that they aren't about to go bust and take your grandmother's life savings with them.

It can do this because the RBA is actually the bank where other banks have to keep their money. Or to put it another way, it's the RBA that tells the other banks how much 'electronic' money they actually have. Each bank has an account at the RBA called an Exchange Settlement Account. These Exchange Settlement Accounts (ESAs) get updated when banks transfer money between each other (in which case on ESA gets credited, the other debited - we'll look at this in more detail in the next post), or when a bank gets issued some bank notes (in which case it's ESA will be debited for the value of the notes issued ) or when a bank hands some soiled notes back to the RBA to be destroyed (in which case it's ESA will be credited for the value of the notes returned).

So the total amount of money that a bank has (i.e. the money it is holding on behalf of it's account holders) should be the sum of

  1. all the notes and coins the bank has in it's vaults, plus
  2. the value of the ESA held for that bank at the RBA, plus
  3. the value of any assets the bank has invested in
For the rest of this discussion, I'm going to ignore any invests the bank has, and assume it keeps all it's money in notes or in the RBA (since these investments don't have any bearing on how the payment systems work).

So lets look at what happens when I go to my local branch of the bank to deposit the winnings from last friday night's poker game.

Before I start, my "savings" account has $614.57 in it, and my cheque account has $12.19. The bank has taken total of $1,000,000,000 in deposits, including my $614.57+$12.19=$626.76. Of this, $200,000,000.00 is stored as notes and coins in bank vaults around the country, hile the remaining $800,000,000.00 exists only as the current balance of the banks ESA.

I go to the bank, and hand over my $8.62, and the teller takes my notes and coins, makes sure they're not fraudulent and puts them in her cash drawer. She then records the deposit, and the bank updates it's record of my savings account balance to be $614.57+$8.62=$623.19. The bank now holds bank accounts totalling $1,000,000,008.62, of which $200,000,008.62 is stored in cash, with the remaining $800,000,000.00 being the current balance of the the banks ESA.

I then decide I will put my winnings towards a new leaf blower that I plan to pay for with a cheque, so while I am in the branch, I transfer $100 from my savings account to my cheque account. The bank updates it's record of my savings account to be $523.19, and my cheque account to be $112.19. However the total of all accounts held at this bank does not change, so there is no change to the totals of the banks cash on hand or it's ESA balance.

But unfortunately, part of my winnings was a $5 note that has been through the wash too many times, and the bank decides to retire that note. The note gets sent back to the RBA, so the bank now has a total of $200,000,003.62 in cash, and the RBA adjusts the bank's ESA balance to be $800,000,005.00

The important thing to notice is that the only thing that affects the total amount of money the bank has is when an individual account holder makes a deposit or withdrawal, but the split between money held as cash and money held in in the ESA  at the RBA can change without affecting any individual's bank balance, and moving  money between accounts held at one bank doesn't affect cash on hand or the bank's ESA.

That's enough of an introduction to the relationship between individual accounts, a bank's cash reserves, and the RBA. Next post, I'll look at how money moves between accounts held at different banks, starting with the system called BECS, which is used to handle 'Direct Deposits' (for paying salary straight into people's bank accounts) and and 'Direct Debits' (for paying for that gym membership that you never use).

February 27, 2006

Question for the day

Russell Beattie - how can I make MONEY off this cool ajaxy social web service thing?

 

February 24, 2006

Time for the 1 O'clock linkfest

Brain death by dull cubicle - "Dull, lifeless work environments cause brain damage."

Things we've learned - "Solve problems you have."

February 23, 2006

Example of connecting to SQL Server via Ruby

I'm porting my MSSQL Schema Explorer app to Ruby

In the process, I discovered there's not much documentation around on how to use the ADO provider in Ruby DBI to connect to a SQL Server. here's a little example that lists the names of all the databases on the server 'localhost'. It wil work on SQL Server 2005 - if you are using SQL Server 2000 you will need to change the text 'Provider=SQLNCLI' to 'Provider=SQLOLEDB'

####

require 'dbi'

class Server
 attr_reader :name
 def initialize(name)
  @server_name=name
  @dbh=DBI.connect("DBI:ADO:Provider=SQLNCLI;Data Source=#{name};Integrated Security=SSPI")
 end
 
 def databases
  db=Array.new
  @dbh.select_all('SELECT name FROM master.sys.databases ORDER BY 1') do | row |
   db.<< Database.new(@dbh,row[0])
  end  
  db
 end
end

class Database
 attr_reader :name
 def initialize(dbh,name)
  @dbh=dbh
  @name=name
 end
end


server=Server.new("localhost")
server.databases.each {|x| p x.name}

 

February 22, 2006

random links

I'm still buzzing over the wedding, haven't quite come back to earth yet so I'll just post some links to random stuff that has caught my eye:

Harry says "Code like Marco Baghdatis"

Jeremy Zawodny on Tom's Future of Web Apps, Translated for Product Managers 

Dare Obasanjo on SQL Databases and Internet-Scale Applications

1

February 12, 2006

links of the day

Since the cricket is looking a tad one sided, here's some reading matter.

 

February 09, 2006

ABN validator in C#

public static bool ABNIsValid(string abn)
//caller is responsible for stripping any spaces before calling
//per http://www.ato.gov.au/businesses/content.asp?doc=/content/13187.htm
// via http://www.clearwater.com.au/?action=code
{

  if (!System.Text.RegularExpressions.Regex.Match(abn,@"^\d{11}$").Success) return false;
  int[] weights = new int[] {10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19};
  int sum = 0;
  for (int i=0;i<11; i++) {
    int digit = int.Parse(abn[i].ToString());
    if (i==0) {digit--;}
    sum += weights[i] * digit;
  }
  return ((sum % 89) == 0);
}