Skip to content

Elysium testnet. Tokens have no value.

DanakeDanake
Protocol

Fares

A Fare is a voluntary offer on a dead token: the payer deposits a budget, commits a Roll, and sets the rules under which holders who burn their bags are paid.

Parameters#

ParameterMeaning
targetThe dead token holders burn. Must be dead per the oracle when the Fare opens.
payoutTokenWhat holders are paid in: any ERC-20, or WHYPE. Cannot be the target.
budgetGross budget, fee included. Pulled from the payer at opening.
snapshotBlockThe Elysium block of the Roll.
snapshotTimeThe timestamp of snapshotBlock. Must be in the past. The Roll check compares it with the real block timestamp.
maxRateAt most this many payout units per 1e18 wei (1 HYPE) of loss.
maxLossPerWalletCap on the loss counted for one wallet, in wei.
windowHow long holders can cross, after the dispute period.
vestingHow long each payout is streamed after settlement.
stayEnables the Stay clause.
rollURIHow to rebuild the Roll, for example danake:roll:v1:minAge=0.
rollRootThe Merkle root of the Roll, passed next to the parameters. Must not be zero.

Contract time is measured with block.timestamp only. On Elysium, block.number inside Solidity returns the parent chain's block, not the Elysium block, so it is never used for logic.

Paying in HYPE#

A payer can fund a WHYPE Fare in native HYPE: send budget as the transaction value with payoutToken set to WHYPE, and the market wraps it. Any other payout token is pulled with transferFrom after an approval. Tokens that take a fee on transfer are refused, because the market must receive exactly the budget.

Fee#

FEE_BPS = 300: 3% of the budget goes to the FeeVault at opening. The rest is the net budget, the amount shared between holders. The vault has no owner and no withdrawal function. On testnet the fees stay there; they are meant to buy $DANAKE once it exists (see $DANAKE token). The fee only leaves the vault if the payer cancels during the dispute period, in which case it returns to the payer.

Lifecycle#

StatusWhenWhat can happen
PendingFrom opening until the dispute period endsAnyone checks the Roll. The payer may cancel() and get the whole budget back, fee included.
OpenDuring the windowHolders cross().
EndedAfter the window, before settlementAnyone may settle().
SettledFrom settlement until the end of vestingHolders claim(). The payer withdraws surplus.
ClosedAfter vestingEverything has vested. Claims and withdrawals still work.
CancelledAfter a cancel during PendingNothing. The budget is back with the payer.

Durations#

DurationMainnet targetTestnet value
Dead after (no trade, or 95% below ATH)7d10m 0s
Dispute period (Pending)1d2m 0s
Minimum window (Open)3d10m 0s
Maximum window30d30d
Minimum vestingSet per deployment5m 0s

The testnet values are shortened so the whole loop fits in under an hour. They are constructor parameters of the deployed contracts, so mainnet uses its own values without code changes.

Settlement math#

Settlement is callable by anyone once the window is over.

netBudget = budget − floor(budget × 300 / 10,000)
rate      = min(maxRate, floor(netBudget × 1e18 / totalCountedLoss))
allocated = floor(totalCountedLoss × rate / 1e18)
surplus   = netBudget − allocated
payout_i  = floor(countedLoss_i × rate / 1e18)

The rate is the same for every wallet. Each wallet's payout is its counted loss times the rate. Because each payout is floored, the sum of payouts can be a few units below allocated; that dust stays in the market, at most one unit per wallet.

Two cases:

  • Budget-limited. If the budget is small compared with the losses, netBudget × 1e18 / totalCountedLoss is below maxRate, so the whole net budget is shared pro rata.
  • Rate-limited. If the budget is large, the rate stops at maxRate. Each wallet gets maxRate per HYPE lost and the rest of the budget is surplus.

Example: budget 1,000,000 $LIVE, so the net budget is 970,000. Max rate 5,000 $LIVE per HYPE.

  • If holders cross with 300 HYPE of counted loss: 970,000 / 300 ≈ 3,233.33 is below 5,000, so the rate is about 3,233.33 and nearly all of the 970,000 is allocated.
  • If holders cross with 150 HYPE: 970,000 / 150 ≈ 6,466.67 is above 5,000, so the rate is 5,000, 750,000 is allocated and 220,000 is surplus.

If nobody crossed, the rate is 0 and the whole net budget is surplus.

Surplus#

The surplus, plus any stream forfeited under the Stay clause, returns to the payer through withdrawSurplus(). Only the payer can call it, as often as new forfeits arrive.

Cancellation#

During Pending, and only then, the payer can cancel(). The net budget and the fee both return to the payer. Nobody can cross a Pending Fare, so nobody has burned anything yet. This is how a payer withdraws an offer whose Roll was challenged.

Estimating a payout before crossing#

previewRate(fareId, extraLoss) returns the rate the Fare would settle at now, if extraLoss more counted loss were added. The app uses it to show "estimated payout". It changes until settlement, as more holders cross.