The International Simutrans Forum

 

Author Topic: Credit & Solvency limits  (Read 1567 times)

0 Members and 1 Guest are viewing this topic.

Offline AP

  • Devotee
  • *
  • Posts: 1202
  • Languages: EN
Credit & Solvency limits
« on: February 01, 2014, 12:16:01 AM »
Can anyone explain how the credit limit and solvency limit is calculated please
In the current online game, my company is making a regular monthly profit (granted not every month, due to shipping arrival schedules) and has a reliably positive and growing bank balance. And a credit /solvency limits of around -£150k/-£280k respectively

Another company, losing money every month (although hopefully that will be turned around) and with a negative bank balance, has limits of -£1,300k / -£3,100k.

Why is one 3 orders of magnitude larger than the other?
« Last Edit: February 01, 2014, 01:14:16 AM by AP »

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Credit & Solvency limits
« Reply #1 on: February 01, 2014, 02:21:19 AM »
I'd be curious to know how it is calculated as well.  I know it's based on asset value and recent profitability, but I'm not sure how far back profits are included and how that factors in.  You may be referring to my company (Pacific Transport), which I have borrowed over 100k against my credit limit to fuel expansive growth with the expectation of a 3-6 month payback period.  I'd go further in to my credit line if I knew how the calculations were performed but I was afraid of a drastic recalculation raising my credit limit suddenly and making me bankrupt.

EDIT: It must be taking a trailing 6-12 months earnings or more because the credit limit calculation/curve is quite smooth and doesn't waver too much from month to month.  As long as you have a good amount of assets built up and are fairly profitable over the last half year to year, your borrowing capacity seems quite solid.  This means that I could probably go 500-1,000k or more in to debt to finance growth and be just fine over the long run.
« Last Edit: February 01, 2014, 04:37:24 AM by Sarlock »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18617
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Credit & Solvency limits
« Reply #2 on: February 01, 2014, 11:20:35 AM »
The credit limit calculation function was written by Neroden, and, for reference, I reproduce the code below:

Code: [Select]
void finance_t::calc_credit_limits() {
sint64 hard_limit_by_profits = credit_limit_by_profits();
sint64 hard_limit_by_assets = credit_limit_by_assets();

// The player gets the better of the two credit limits.  Remember that they are negative.
sint64 hard_credit_limit = min(hard_limit_by_profits, hard_limit_by_assets);
assert(hard_credit_limit <= 0);

// Soft credit limit is a percentage of the hard credit limit
// This percentage will be set by settings -- FIXME LATER
uint8 soft_credit_limit_percent = 50;

// Don't worry about exact computations here.
sint64 soft_credit_limit = (hard_credit_limit / 100) * soft_credit_limit_percent;
assert(soft_credit_limit <= 0);

com_month[0][ATC_HARD_CREDIT_LIMIT] = hard_credit_limit;
com_month[0][ATC_SOFT_CREDIT_LIMIT] = soft_credit_limit;

if(world->get_last_month()==0) {
// New year, record new starting credit limit
com_year[0][ATC_HARD_CREDIT_LIMIT] = hard_credit_limit;
com_year[0][ATC_SOFT_CREDIT_LIMIT] = soft_credit_limit;
}
}

Offline AP

  • Devotee
  • *
  • Posts: 1202
  • Languages: EN
Re: Credit & Solvency limits
« Reply #3 on: February 01, 2014, 12:08:22 PM »
So it's a % of assets calculated yearly, do I read that right?

Offline MCollett

  • *
  • Posts: 214
  • Languages: en
Re: Credit & Solvency limits
« Reply #4 on: February 01, 2014, 07:53:35 PM »
The credit limit calculation function was written by Neroden, and, for reference, I reproduce the code below:

The more interesting stuff is down in the routines  credit_limit_by_profits() and credit_limit_by_assets().  The first returns the amount of borrowing that would require all your operational profits over the last 12 months to cover the annual interest; the second just returns the value of your assets.

Best wishes,
Matthew