Skip to content

buyNight

buyNight(usdmIn, decl, mid, spreadBps): bigint

Buy side: the user gives usdmIn (fees included, taken from it); NIGHT out at the mid less spreadBps, rounded down.

Parameter Type
usdmIn bigint
decl Pick<FeeDecl, "protocolBps" | "appBps">
mid Mid
spreadBps number

bigint