Managing a Bench

The bench owner manages a bench from its page on myth.finance/bench ("Manage"), or with the TypeScript SDK. Unless noted otherwise, each action below can be performed by the owner or by the Myth Finance fee admin (see Roles). Proceeds always go to the owner, regardless of who calls.

Withdrawing proceeds

withdraw(amount) sends amount of the purchase asset from the bench to the owner. Available at any time, including while the sale is running. The withdrawable amount is the bench's purchase asset balance minus the platform fees accrued so far.

Editing metadata

Owner only. Terms & Conditions and restricted countries can be changed or removed at any time. See Metadata.

Ending a bench

end() stops the sale immediately. No more purchases are accepted; unsold tokens and proceeds stay in the bench until it is closed.

Benches also end by themselves when they sell out, or when their end time passes. See How it Works.

Deleting purchase-tracking boxes

Only relevant for benches with a purchase limit, which hold one box per buyer. After the bench has ended, and before it can be closed, these boxes must be deleted with delete_boxes(box_names). The frontend does this for you ("Delete boxes"). Deleting the boxes releases their minimum balance to the bench, which is paid out to the owner on close.

Closing a bench

close() is available once the bench has ended. It:

  1. sends the accrued platform fees to the fee admin,
  2. sends the entire remaining purchase asset balance (the proceeds) to the owner and opts the bench out of the purchase asset,
  3. sends the unsold tokens to the owner and opts the bench out of the asset for sale,
  4. closes the bench's ALGO balance (escrow seed and any released box minimum balances) to the owner.

The owner must be opted in to both assets for close to succeed. After closing, the bench contract is empty. It remains on-chain (bench contracts are not deletable) and is removed from the registry directory by the registry admin.

Withdrawing platform fees

Fee admin only. withdraw_fees(amount) sends up to the accrued fee amount to the fee admin. Fees not withdrawn during the sale are paid out on close.

Lowering the fee

Fee admin only. lower_fee(new_fee_bps) can lower, and only lower, the platform fee of an individual bench.