*** NEW: I wrote a book: Read Write Own *** NEW: I wrote a book: Read Write Own ***

function my_exit_payout(…)

/* aggregate_options_strike_price = your options strike price per share * number of shares you own
company sale price is 1) if private transaction: amount paid by acquirer plus any funds in startup returned to investors, 2) if IPO = market capitalization.
note: if you assume all financings were 1x preferred, investor preferences == total amount of money the company has raised
to do: add condition for participating preferred, graph various scenarios
*/

function my_exit_payout(company_sale_price, your_percent_ownership, your_aggregate_options_strike_price, investor_preferences, investors_ownership_percent)
{
  if (investors_ownership_percent * company_sale_price < investor_preferences) investor_converts=FALSE;
  else investor_converts=TRUE;

  if (investor_converts) return your_percent_ownership * company_sale_price - your_aggregate_options_strike_price;
  else {
    common_stock_proceeds = company_sale_price - investors_preferences.
    your_percent_common = your_percent_ownership / ( 1 - investor_ownership_percent );
    return common_stock_proceeds * your_percent_common - your_aggregate_options_strike_price;
  }
}