Idea and pseudo code to fix balance display
The balance per day doesn't work very well - after a payout from the pool it ends up going negative.  I have written some pseudo code which should be a lot more accurate:

```
// Declare variables
currentAmount=0.0  // set value to zero initially
currentAverage=0.0 // set value to zero initially

...

// at the end of each interval do this calculation
if api_return_amount_for_balance < ( currentAmount * 0.5 )
  // balance went down considerably (allow for fluctuations in exchanging coins)
  // pool must have paid out - reset calculation
  // also clears down the average every payout to avoid runaway numbers
  difference = api_return_amount_for_balance
  currentAverage = difference
else
  // balance wasn't reset so calculate
  difference = api_return_amount_for_balance - currentAmount
end if

// now average out the interval amounts to dampen spikes
currentAverage = ( currentAverage + difference ) / 2 

// now calculate based on the interval in seconds multiplied up to a day value
// Use this value to populate BTC per day
BTC_per_day = currentAverage * ( 86400 / interval_in_seconds )

// update currentAmount for next run
currentAmount = api_return_amount_for_balance 

```

Where api_return_amount_for_balance is the value you get from reading the balance from the pool
and interval_in_seconds is the time interval specified in the config for length of time between loops

You could also do a balance check on first run as well and populate currentAmount instead of setting to zero because that will give a false value on the first interval otherwise

Hope this helps!