EarnShares
Tempo Earn VaultAdapter share math: raw vault-share and venue-share conversions
at the anchor rate, the dilution-correct fee-share formula, and the
minimumOutput slippage floor.
Conversions are fee-blind mirrors of the adapter's anchor arithmetic; use the
adapter's previewRedeem for user-facing value.
Examples
import { EarnShares } from 'ox/tempo'
const shareAmount = EarnShares.toAmount(
{ engineShares: 3n, shareSupply: 2n },
7n,
)
4nFunctions
| Name | Description |
|---|---|
EarnShares.feeShares | Computes the dilution-correct vault shares minted for an asset-denominated fee. |
EarnShares.minimumOutput | Lowers an expected output by a basis-point slippage tolerance, flooring to 1n. |
EarnShares.toAmount | Converts venue shares to a vault share amount at the anchor rate, rounding down. |
EarnShares.toAmountUp | Converts venue shares to a vault share amount at the anchor rate, rounding up. |
EarnShares.toVenueAmount | Converts a vault share amount to venue shares at the anchor rate, rounding down. |
Errors
| Name | Description |
|---|---|
EarnShares.InvalidExpectedOutputError | Error thrown when an expected output is not positive. |
EarnShares.InvalidSlippageError | Error thrown when a slippage tolerance is not an integer from 0 through 9_999. |
Types
| Name | Description |
|---|---|
EarnShares.Anchor | Tempo Earn VaultAdapter conversion anchor. |

