HOOK use-min-shares

useMinShares

Computes the minimum order size for a prediction market coin. Fetches mark price from spotMetaAndAssetCtxs, applies formula: ceil(10/max(min(markPx,1-markPx),0.01)). Returns { minShares: number, markPx: number|null, isLoading, error }. Pass minShares to TradeForm.

Install

$ npx shadcn@latest add https://ui.purrdict.xyz/r/use-min-shares.json

Signature

useMinShares(client?: HIP4Client, coin: string)

Returns

{ minShares, markPrice, isLoading }
Usage
const { minShares } = useMinShares(
  client,
  market.yesCoin
)

Dependencies