BondingCurveParams

Class: BondingCurveParams

Properties overview

  • curveK: UInt64 = UInt64;
  • fee: UInt32 = UInt32;
  • mintingIsAllowed: Bool = Bool;
  • startPrice: UInt64 = UInt64;

Methods overview

Defined in: packages/token/src/BondingCurveAdmin.ts:50

Default bonding curve:
Initial price: 1 MINA per 100,000 tokens (0.00001 MINA per token), or 10_000 / 10 9
Curve K: 1 MINA per 100,000 tokens (0.00001 MINA per token), or 10_000 / 10
9 MINA
Owner fee: 10% in 0.001 % units(10 1000 = 10_000)
Price formula: price = startPrice + curveK
totalSupply
Example:
If supply is 200,000 tokens, price = 1 MINA + 1 MINA 200_000 / 100_000 = 3 MINA per 100,000 tokens
or per token in MINA/1e9
10000 + 10000
200_000 / 100_000 = 30000 per token,
or 30_000 * 100_000 = 3_000_000_000, or 3 MINA per 100,000 tokens

To calculate the max supply for the given price for 100,000 tokens:
price = startPrice + curveK totalSupply
price - startPrice = curveK
totalSupply
(price - startPrice) / curveK = totalSupply
(3 MINA - 1 MINA) / 1 MINA = 2 100_000 = 200_000 tokens
(30_000 - 10_000) / 10_000 = 2
100_000 = 200_000 tokens
or, in 1e9 units:
(30_000 - 10_000) 1e9 100_000 / 10_000 = 200_000_000_000_000, or to avoid overflow,
(30_000 - 10_000) 1e9 / 10_000 100_000 = 200_000_000_000_000

Extends

  • {
    curveK: UInt64;
    fee: UInt32;
    mintingIsAllowed: Bool;
    startPrice: UInt64;
    }

Constructors

new BondingCurveParams()

new BondingCurveParams(value: {
  curveK: UInt64;
  fee: UInt32;
  mintingIsAllowed: Bool;
  startPrice: UInt64;
 }): BondingCurveParams

Defined in: node_modules/o1js/dist/node/lib/provable/types/struct.d.ts:103

Parameters

value
curveK

UInt64 = UInt64

fee

UInt32 = UInt32

mintingIsAllowed

Bool = Bool

startPrice

UInt64 = UInt64

Returns

BondingCurveParams

Inherited from

Struct({
  startPrice: UInt64,
  curveK: UInt64,
  fee: UInt32, // 1000 = 1%
  mintingIsAllowed: Bool,
}).constructor

Properties

curveK

curveK: UInt64 = UInt64;

Defined in: packages/token/src/BondingCurveAdmin.ts:52

Inherited from

Struct({
  startPrice: UInt64,
  curveK: UInt64,
  fee: UInt32, // 1000 = 1%
  mintingIsAllowed: Bool,
}).curveK

fee

fee: UInt32 = UInt32;

Defined in: packages/token/src/BondingCurveAdmin.ts:53

Inherited from

Struct({
  startPrice: UInt64,
  curveK: UInt64,
  fee: UInt32, // 1000 = 1%
  mintingIsAllowed: Bool,
}).fee

mintingIsAllowed

mintingIsAllowed: Bool = Bool;

Defined in: packages/token/src/BondingCurveAdmin.ts:54

Inherited from

Struct({
  startPrice: UInt64,
  curveK: UInt64,
  fee: UInt32, // 1000 = 1%
  mintingIsAllowed: Bool,
}).mintingIsAllowed

startPrice

startPrice: UInt64 = UInt64;

Defined in: packages/token/src/BondingCurveAdmin.ts:51

Inherited from

Struct({
  startPrice: UInt64,
  curveK: UInt64,
  fee: UInt32, // 1000 = 1%
  mintingIsAllowed: Bool,
}).startPrice

Methods

pack()

pack(): Field

Defined in: packages/token/src/BondingCurveAdmin.ts:56

Returns

Field


unpack()

static unpack(field: Field): BondingCurveParams

Defined in: packages/token/src/BondingCurveAdmin.ts:64

Parameters

field

Field

Returns

BondingCurveParams