Skip to content

EarnShares.feeShares

Computes the dilution-correct vault shares minted for an asset-denominated fee.

Mirrors FeeMath: feeShares = floor(fee * shareSupply / (activeAssets - fee)), zero when the fee is zero or not smaller than the active assets. Minting this amount to the fee ledger prices the fee at post-mint value per share.

Imports

Named
import { EarnShares } from 'ox/tempo'

Examples

import { EarnShares } from 'ox/tempo'
 
const shares = EarnShares.feeShares({
  activeAssets: 1_100n,
  shareSupply: 1_000n,
  totalFeeAssets: 100n,
})
100n

Definition

function feeShares(
  options: feeShares.Options,
): bigint

Source: src/tempo/EarnShares.ts

Parameters

options

  • Type: feeShares.Options

Fee accrual inputs.

options.activeAssets

  • Type: bigint

Assets backing the active (non-queued) supply, base units.

options.shareSupply

  • Type: bigint

Active vault share supply, base units.

options.totalFeeAssets

  • Type: bigint

Total fee liability in asset units.

Return Type

Vault shares to mint for the fee, rounded down.

bigint