Buying

Buying from a bench is a single transaction group: a payment to the bench, followed by a buy application call. The bench delivers the tokens within the same group, so purchases are atomic: either you receive the tokens at the fixed price, or nothing happens.

Benches can be browsed and bought from at myth.finance/bench, or programmatically with the SDK.

Requirements

  • If the bench sells an ASA, you must be opted in to it. The frontend and the SDK add the opt-in to the group automatically when needed.
  • You pay with an asset transfer if the bench is priced in an ASA, or with a payment if it is priced in ALGO.
  • The bench must be open: past its start time (if any) and before its end time (if any).
  • Your purchase may not exceed the remaining amount. Benches do not partially fill: a purchase for more than what is left is rejected.

What you receive

You choose how much of the purchase asset to spend; the bench sends back

tokens = spend × 100,000,000 / purchase_price_per_100m

rounded down to the smallest unit of the token being sold (see Pricing). Purchases that would round down to zero tokens are rejected.

Buyers pay no platform fee: the platform fee is deducted from the seller's proceeds. Buyers pay their own network transaction fees, including the fee of the inner transaction that delivers the tokens (0.001 ALGO extra on the buy call).

Purchase limits

A bench may enforce a maximum spend per account, denominated in the purchase asset. The limit is cumulative over the whole sale: once an account has spent up to the limit, further purchases from that account are rejected.

To keep track of each buyer's spend, the bench stores a small box (40 bytes) per buyer account. On your first purchase from such a bench, your transaction group includes a one-off payment of 0.0185 ALGO to the bench, covering the box's minimum balance requirement. This amount is not refunded to buyers; it is released to the bench owner when the bench is closed.

The frontend shows your remaining allowance on the bench page; the SDK exposes it as userMaxSpend.

Terms & Conditions and restricted countries

Sellers can attach a Terms & Conditions link and a list of restricted countries to a bench (see Metadata). The myth.finance frontend displays the Terms & Conditions link prominently, and hides the bench from visitors located in restricted countries.

Country restrictions are enforced by the frontend only, based on browser-side IP geolocation. They are not enforced by the smart contract.

Transaction group

#TransactionNotes
1Asset opt-inOnly if you are not yet opted in to the token being sold
2Payment of 0.0185 ALGO to the benchOnly for benches with a purchase limit, on your first purchase
3Payment or asset transfer to the benchThe amount you spend
4buy() application callExtra fee of 0.001 ALGO to cover the inner token transfer

The buy call must be immediately preceded by the payment (3), which in turn must be immediately preceded by the box payment (2) when one is required.