How Haggle works
One contract holds every offer on the desk. This page is the whole of what it does with the coins and HYPE locked in it.
An offer
An offer has a maker, a coin (any ERC-20 on Elysium), a size in coins and a price in HYPE for the whole size. It is one of two kinds:
- Sell: the maker locks the coins in the contract and asks the HYPE price for them.
- Buy: the maker locks the HYPE and bids it for the coins.
Optional: a taker wallet (only that wallet can fill), part fills (on or off), and an end time.
Filling
A fill of x coins pays price × x ÷ size HYPE. On a Sell, the taker sends that HYPE and receives the coins; on a Buy, the taker's coins go straight to the maker and the taker receives the HYPE. Both sides move in the same transaction, or neither does.
Part fills round in the maker's favour, by at most one wei of HYPE per fill. When a Buy is completely filled, any HYPE left from rounding goes back to the maker.
Cancelling and expiry
The maker can call cancel(id) at any time. Unfilled coins (Sell) or the unspent HYPE (Buy) go back to the maker in the same transaction.
After its end time an offer can't be filled. Its rest stays in the contract until the maker cancels it, which works after expiry too.
Prices on the site
"Against the market" compares the offer's price per coin with the coin's last price on its main pool, from the Place index. "As market cap" is the price per coin times the coin's total supply. Both are guides: the contract only knows the price the maker set.
Fees
| Filling an offer | 0.5% of the HYPE side, taken from the HYPE, to the treasury |
| Posting, cancelling | 0, only gas |
Coins that tax transfers are counted by what actually arrives in the contract when a Sell is posted, and the price is scaled to that amount.
Safeguards
- No owner, no upgrade, no pause. The treasury address is fixed at deployment and only receives fees.
- Funds move two ways only: to a taker in a fill at the posted rate, or back to the maker on a cancel.
- Tested, including random part fills and cancels that must leave the contract holding exactly what open offers need. Not audited.
Contract
| Haggle desk | Published at launch |
| Treasury | - |
Elysium, chain id 99901.