Skip to content

EarnShares.toAmountUp

Converts venue shares to a vault share amount at the anchor rate, rounding up.

Mirrors the adapter's ceiling conversion used by exact-asset exits.

Imports

Named
import { EarnShares } from 'ox/tempo'

Examples

import { EarnShares } from 'ox/tempo'
 
const shareAmount = EarnShares.toAmountUp(
  { engineShares: 3n, shareSupply: 2n },
  7n,
)
5n

Definition

function toAmountUp(
  anchor: Anchor,
  venueShareAmount: bigint,
): bigint

Source: src/tempo/EarnShares.ts

Parameters

anchor

The conversion anchor.

anchor.engineShares

  • Type: bigint

Venue shares held by the engine at the anchor point.

anchor.shareSupply

  • Type: bigint

Vault share supply at the anchor point.

venueShareAmount

  • Type: bigint

Venue share amount, base units.

Return Type

Vault share amount, rounded up.

bigint