Creating a Bench

Benches are created through the Bench Registry, either from the myth.finance/bench frontend ("Create Bench") or with the TypeScript SDK.

Parameters

ParameterDescription
Asset for saleALGO or an ASA you hold. Must pass the eligibility checks.
Purchase assetALGO or the ASA buyers will pay with. Must pass the eligibility checks, and differ from the asset for sale.
Amount for saleTransferred into the bench escrow at creation.
PricePurchase asset per unit of the asset for sale. Stored on-chain as purchase_price_per_100m (see Pricing).
Start time (optional)Purchases are rejected before it. Leave empty to open immediately.
End time (optional)Purchases are rejected after it. Leave empty for no end time: the bench stays open until it sells out or is ended by the owner. Must be in the future, and after the start time.
Purchase limit per account (optional)Maximum cumulative spend per buyer account, in the purchase asset. See Buying.
Beneficiary (optional)The bench owner: receives all proceeds and manages the bench. Defaults to the creator.
Terms & Conditions URL (optional)Shown to buyers. See Metadata.
Restricted countries (optional)Enforced by the frontend only. See Metadata.

Setting a beneficiary other than yourself is irreversible. The creator keeps no control over the bench and cannot access its proceeds. Only the beneficiary (owner) and the Myth Finance fee admin can manage the bench, and proceeds only ever go to the owner.

Except for the metadata (Terms & Conditions, restricted countries), all parameters are immutable once the bench is created. Timing can only be shortened, by ending the bench early.

Costs

Creating a bench costs, in ALGO:

ItemAmountNotes
Setup feeRegistry setting setup_fee, currently 20 ALGO on mainnetPlatform fee, non-refundable
Escrow seed0.2 ALGO if one side is ALGO, 0.3 ALGO for two ASAsMinimum balance of the bench account and its asset opt-ins. Refunded to the owner when the bench is closed
Metadata storage0.0025 ALGO + 0.0004 ALGO per byteOnly when Terms & Conditions or restricted countries are set
Network fees~0.02 ALGOCovers the inner transactions the registry sends to deploy and configure the bench

When selling ALGO, the amount for sale is added to the same payment.

The platform fee on sales is locked into the bench at creation from the registry's default_fee_bps (currently 15 bps, 0.15%). Later changes to the registry default do not affect existing benches.

What happens on-chain

Creation is one atomic transaction group sent to the registry:

  1. Payment of the setup fee + escrow seed (+ amount for sale, when selling ALGO) to the registry
  2. When selling an ASA: a registry optin(asset) call, followed by an asset transfer of the amount for sale to the registry
  3. The registry create(...) call

The registry then, through inner transactions:

  • Verifies both assets against the allow and ban lists
  • Deploys a new bench contract and opts it into the asset(s)
  • Seeds the bench with ALGO and transfers the tokens for sale into it (the registry does not keep any of your tokens: it closes its temporary holding out to the bench)
  • Assigns the next bench ID, emits a Created(uint64,uint64) event with the bench ID and app ID, and calls setup on the bench with the owner, fee settings and sale parameters
  • Records the bench in its directory (see Storage)

The create method returns (bench_id, app_id).