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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
usdmIn |
bigint |
decl |
Pick<FeeDecl, "protocolBps" | "appBps"> |
mid |
Mid |
spreadBps |
number |
Returns
Section titled “Returns”bigint