diff --git a/README.md b/README.md index cbf173c..3224cef 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,8 @@ composer require muvon/bitclout-creator-coin ```php use Muvon\Bitclout\CreatorCoin; $Coin = CreatorCoin::create(0); // pass reward basis points - $Coin->init(1000, 1000); // locked and supply in nanos + // Watermark is optional + $Coin->init(1000, 1000, 0); // locked, supply and watermark in nanos ``` ### Emulate buys diff --git a/src/CreatorCoin.php b/src/CreatorCoin.php index 9cbc82d..358602c 100644 --- a/src/CreatorCoin.php +++ b/src/CreatorCoin.php @@ -48,15 +48,17 @@ public static function create(int $reward): static { * Locked amount in nanos * @param int $supply * Total supply in $creator coins in nanos + * @param int $watermark + * Optional watermark in case we use same strategy * @return static */ - public function init(int $locked, int $supply): static { + public function init(int $locked, int $supply, int $watermark = 0): static { if ($this->supply > 0) { throw new Exception('Creator coin was inited already'); } $this->locked = $locked; $this->supply = $supply; - $this->watermark = $supply; + $this->watermark = max($supply, $watermark); $this->recalculateRate(); return $this; }