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
Previous inputs:
Bonding curve inputs:
Outputs:
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:
hatch.totalRaised()
.hatch.exchangeRate()
.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.
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing