ElyraElyraOpen the app

Docs

Points

How points grow

$ELYRA put into ElyraStake earns points: amount times seconds held. One $ELYRA held for one day is one point in the app (on chain a point is one token wei held for one second). There is no lock, no minimum and no schedule: enter(amount) starts the count on that amount from the block it lands in, and exit(amount) returns tokens at any time. Points already earned stay with the wallet after it takes tokens out, and stay cashable.

The pots

The protocol share of every fill reaches ElyraStake through ElyraFees: HYPE as a plain transfer (WHYPE arrives unwrapped) into the HYPE pot, USDC through notifyUSDC(amount), which pulls it into the USDC pot. Anyone may add to either pot. Income only piles up; nothing is paid out until someone cashes.

Cashing

cashPoints() pays the caller potHYPE x its points / all uncashed points, and the same slice of the USDC pot, then retires those points: they leave the wallet and the total together, so every other wallet's slice of what remains is unchanged. A wallet that holds longer, or holds more, owns more of the pots; a wallet that arrives just before a payment owns a sliver of it. Cash when you like: points do not expire, and the count restarts from zero on what you still hold.

Calls

CallWhat it does
enter(amount)pulls $ELYRA after an approval; points grow on it from now
exit(amount)returns $ELYRA; earned points stay
cashPoints()pays HYPE and USDC for the caller's points and retires them
quote(holder)what cashPoints would pay now (HYPE, USDC)
pointsOf(holder)points not cashed yet, counted to this second
totalPoints()all uncashed points across holders
holdingOf(holder)$ELYRA the holder has in
potHype(), potUsdc(), held()the two pots and the $ELYRA held

Events: Entered(holder, amount, holding), Exited(holder, amount, holding), PointsCashed(holder, points, hype, usdc), IncomeIn(asset, from, amount) (asset 0x0 = HYPE).

Edge cases

A payout is rounded down, so the pots never pay more than arrived; the last points cashed take what rounding left. A cash that would pay nothing (empty pots, or a dust holding against a large total) reverts and keeps the points. Income that arrives while no points exist waits in the pots and is shared by the points that follow. A wallet whose contract refuses HYPE cannot cash until it can receive it. The owner key can only recover assets sent outside the income paths (recoverExcess); it cannot move a holding, a point or a pot. The contract has not had an external audit.