Purses
Creating, funding and withdrawing from a Purse, and what happens when it runs dry.
Creating a Purse
A Purse is created through the PurseFactory with four settings: the HyperCore spot market, the Spec (max spread, min depth, band), and the Shift length (12 h, 24 h, 48 h). You can fund it in the same transaction.
One market can have more than one Purse. Each runs its own auction and its own Shifts, and each pays only its own market maker.
Funding
Anyone can fund any Purse by sending HYPE to its fund() function: the team, holders, the community. Funding is a plain transfer. It gives no claim on the Purse and cannot be withdrawn by the funder. Only the creator can withdraw unused funds.
Withdrawing unused funds
When a Shift starts, the Purse reserves what that Shift can cost at most: the winning Wage times the Shift length. The reserve is locked until the Shift ends. Everything above the reserve is available, and the creator can withdraw it at any time with withdraw(amount).
When the Shift ends, whatever was not streamed (hours where the Spec failed) goes back to the available balance. The creator also receives the 50% share of any slashed Bond, in $MSTH, and can withdraw it.
When a Purse runs dry
- If the available balance can't cover a full Shift at the winning Wage, the Shift is shortened to the hours the balance covers.
- If the balance is zero, no Shift starts. Bids are refunded and the auction reopens; the Purse waits for funding.
- A Shift in progress is never cut short by withdrawals: its reserve is locked.
Can the team move Purse funds?
The creator can withdraw funds that are not reserved for the current Shift. Nobody else can move a Purse's HYPE except the auction contract, which can only reserve funds for a Shift and pay the winning market maker for passing checks. There is no admin key that can drain a Purse.