owned this note changed 4 years ago
Linked with GitHub

Fundraising

price_TEC = reserveXDAI.balance() / (tec.totalSupply() * reserveRatio)

\[ price_{token} = \frac{balance_{collateral}}{supply_{token} * CW} \]

Bancor Math Slides:
https://docs.google.com/presentation/d/1RJ9mNjPyl6pZ4UC9NmP3s7uhPNw1IboQo3sJ47sBVQU/edit#slide=id.gd4f8222c96_0_70

Link to the repo for modelling:
https://github.com/CommonsBuild/FundraisingModel

We have:

Smart contracts:

Formulas

  • Article 1
  • Article 2
  • buyAmt = tokenSupply * ((1 + amtPaid / collateral)^CW — 1)
  • sellAmt = collateral * ((1 + tokensSold / totalSupply)^(1/CW) — 1)

Previous inputs:

  • totalRaised: 1000000
  • hatchTribute: 5% (funding pool)
  • hatchPrice: 1 (for each wxdai you recieve 1 TECH)

Bonding curve inputs:

  • Initial price: 2
  • Expected growth: 10
  • Reserve Ratio: 10%
  • Entry tribute
  • Exit tribute

Outputs:

  • Virtual Supply
  • Virtual Balance
  • Reserve Ratio

reserveRatio = 0.1
xRate = 1 / hatchPrice
pctOffered = 1

sSupply = totalRaised * xRate
sBalance = totalRaised * (1 - params.hatchTribute)
sPrice = params.initialPrice
sMarketCap = sSupply * sPrice

[sSupply * sqrt(growth)] * [sPrice * sqrt(growth)] = eSupply * ePrice

eMarketCap = sMarketCap * growth
ePrice = sPrice * sqrt(growth)

const ppSupply = ePrice.
div(eMarketCap.pow(one.minus(reserveRatio)).times(sPrice.pow(reserveRatio)))
.pow(one.div(reserveRatio.minus(one)))

ppSupply = (ePrice / (eMarketCap ** (1 - reserveRatio) * (sPrice ** reserveRatio))) ** (1 / (reserveRatio - 1))

\[ n =\ N\frac{v}{V}\]

\[ ppSupply\ =\frac{ePrice}{eMarketcap^{1-R} *\ \ sPrice^{R} \ ^{\frac{1}{R-1}}} \]
vSupply = ppSupply - sSupply

ppBalance = sPrice * ppSupply * reserveRatio
vBalance = ppBalance - sBalance

f() is a transformation on the initial balance and initial supply based on your preference on initial price and expected market capitalization growth.

\[ f(b_0, s_0, p_0, g) \rightarrow (b_v, s_v) \]

\[ b_v = b_{pp} - b_0 \]

\[ s_v = s_{pp} - s_0 \]

\[ b_{pp} = p_0 * s_{pp} * r \]

\[ s_{pp} = \left(\frac{p_e}{(p_e s_e)^{1-r}*p_0^r}\right)^{\frac{1}{r-1}} \]

\[ p_e = p_0 * \sqrt{g} \]

Expected market capitalization (expected price times expected supply):

\[ p_e s_e = p_0 s_0 g \]

const Decimal = require('decimal.js')

const one = BN(1)
const oneDAI = BN(10).pow(BN(18))
function BN(value) {
  return new Decimal(value)
}

const fundraising = {
  presalePrice: 1,
  targetGoal: 1000000,
  expectedGrowth: 200,
  tokensOffered: 100,
  projectFunding: 5,
  initialPricePerToken: 2
}

const cwDAI = BN(0.1)
const xRate = one.div(BN(fundraising.presalePrice))
const goal = BN(fundraising.targetGoal).times(oneDAI)
const growth = BN(fundraising.expectedGrowth)
const pctOffered = BN(fundraising.tokensOffered).div(BN(100))
const pctBeneficiary = BN(fundraising.projectFunding).div(BN(100))

const sSupply = goal.times(xRate).div(pctOffered)
const sBalance = goal.times(one.minus(pctBeneficiary))
const sPrice = BN(fundraising.initialPricePerToken)
const sMarketCap = sSupply.times(sPrice)

const eMarketCap = sMarketCap.times(growth)
const ePrice = sPrice.times(growth.squareRoot())

const ppSupplyDAI = ePrice
  .div(eMarketCap.pow(one.minus(cwDAI)).times(sPrice.pow(cwDAI)))
  .pow(one.div(cwDAI.minus(one)))
const vSupplyDAI = ppSupplyDAI.minus(sSupply)

const ppBalanceDAI = sPrice.times(ppSupplyDAI).times(cwDAI)
const vBalanceDAI = ppBalanceDAI.minus(sBalance)

console.log(vBalanceDAI, vSupplyDAI)

Here is how it looks like:

  • We redefine Presale Goal as hatch.totalRaised().
  • The Presale Price is hatch.exchangeRate().
  • Presale period is hatch period.
  • Initial tokens offered is defined as 100%
  • Project funding is redefined as hatch tribute.

We will keep the vesting during the hatch period. We redefine the vesting on the commons upgrade.

We won't use tap in gardens / commons template.

Batching was removed in the 1hive fork of aragon black fundraising.

Select a repo