# Bonding Markets (/bonding)



Use `mlab curve` to open a **two-way linear bonding market** on [Elysium](/providers-execution/elysium). Commit tokens you already hold; buyers pay native HYPE, and holders can sell tokens back to the contract.

Unlike a [pool](/pools), you do not supply a second token or seed HYPE liquidity. Purchases build the HYPE reserve that backs sell-backs. Tokens are transferred, not minted or burned.

## Create a Market [#create-a-market]

You need a standard ERC-20 token on Elysium testnet, enough tokens for the allocation, and native HYPE for gas. Tokens with transfer taxes or rebasing are not supported. Need a token to try it? See [Create a test token](/pools#create-a-test-token).

This example allocates **500,000 GURT**, an 18-decimal token, starting at **0.0001 HYPE** per token and ending at **0.0003 HYPE** when sold out. Replace the example token and wallet addresses with yours.

```bash
mlab curve create \
  --factory 0x43bD454E79f7fD63101377817CbD34111fE4A66A \
  --token 0x1171daed16376968bdd3d865318a9a4f3687f328 \
  --account 0x0361c685F6bA3Cd66e9e8fE6095C91Ab0b4e5b8E \
  --allocation 500000000000000000000000 \
  --start-price 100000000000000 --end-price 300000000000000 \
  --fee-bps 30 --min-fee-bps 5 --max-fee-bps 100 \
  --output json
```

* `--allocation` uses token base units. Check your token's decimals; supported tokens have at most 18.
* Prices use HYPE wei **per whole token**. The price rises linearly as tokens are bought and falls as they are sold back. The end price must be at least the starting price.
* The starting fee is &#x2A;*0.30%**, bounded between &#x2A;*0.05% and 1%**. Allocation, price endpoints and fee bounds are fixed at creation.

**Creation prepares unsigned transactions.** [Sign and submit](/pools#sign-and-submit) each returned `transactions[].transaction` in order: token approval, then creation. Wait for successful receipts. Your allocation moves into the new contract, and your wallet becomes its manager.

Find the new market address in the receipt's `MarketCreated` event, or list markets and match your token and manager:

```bash
mlab curve list --factory 0x43bD454E79f7fD63101377817CbD34111fE4A66A --output json
```

The factory above is Market Lab's deployed testnet factory. Supply `--factory` for every on-chain command; only markets registered with that factory are supported. `--rpc-url` selects another Elysium endpoint.

## Inspect, Buy or Sell [#inspect-buy-or-sell]

The commands below use an existing GURT market. Replace its address with your own market when testing your deployment, and use your own wallet for `--account`.

```bash
mlab curve inspect 0x59675174f1700677e608f86016f1cea764e1abfa \
  --factory 0x43bD454E79f7fD63101377817CbD34111fE4A66A --output json

mlab curve quote 0x59675174f1700677e608f86016f1cea764e1abfa \
  --factory 0x43bD454E79f7fD63101377817CbD34111fE4A66A \
  --side buy --amount 1000000000000000 --output json
```

Inspection shows the price, allocation, net tokens sold, sell-back reserve, accrued fees and manager. The quote above budgets **0.001 HYPE**. Quotes show the trading fee in HYPE: included in the buy payment, deducted from sell proceeds. Gas is separate.

Prepare a **0.001 HYPE buy**, or sell **10 tokens** with 18 decimals:

```bash
mlab curve buy 0x59675174f1700677e608f86016f1cea764e1abfa \
  --factory 0x43bD454E79f7fD63101377817CbD34111fE4A66A \
  --account 0x0361c685F6bA3Cd66e9e8fE6095C91Ab0b4e5b8E \
  --amount 1000000000000000 --output json

mlab curve sell 0x59675174f1700677e608f86016f1cea764e1abfa \
  --factory 0x43bD454E79f7fD63101377817CbD34111fE4A66A \
  --account 0x0361c685F6bA3Cd66e9e8fE6095C91Ab0b4e5b8E \
  --amount 10000000000000000000 --output json
```

Buy amounts are **maximum HYPE spend in wei**; unused HYPE is refunded. Sell amounts are **token base units**. To quote a sale, use `quote --side sell` with the same token amount.

Both commands prepare unsigned transactions; sign them with your wallet. Sells include token approval when needed. Default slippage is &#x2A;*0.50%** (`--slippage-bps 50`), and plans expire after 20 minutes. No WHYPE is needed.

You cannot sell more than the market's **net tokens sold**, even if your wallet holds more. Retained or externally minted tokens do not add HYPE backing. There is no automatic pool migration or withdrawal of unsold allocation in this version.

## Automatic Fees [#automatic-fees]

Creation starts trading at the initial fee; it **does not start automatic fee updates**.

Use `mlab curve operator create` and `mlab curve operator address` to create or inspect the dedicated fee operator. It is shared with pool fee jobs. Replace `OPERATOR_ADDRESS` below with the printed address:

```bash
mlab curve authorize 0x59675174f1700677e608f86016f1cea764e1abfa \
  --factory 0x43bD454E79f7fD63101377817CbD34111fE4A66A \
  --account 0x0361c685F6bA3Cd66e9e8fE6095C91Ab0b4e5b8E \
  --operator OPERATOR_ADDRESS --output json
```

Use **your market and its manager wallet**. Sign the authorization, then fund the operator with native HYPE for fee-update gas. The operator can adjust fees, not claim creator fees or withdraw seller backing.

Preview the policy, then remove `--dry-run` to start the job after confirmation:

```bash
mlab curve run 0x59675174f1700677e608f86016f1cea764e1abfa \
  --factory 0x43bD454E79f7fD63101377817CbD34111fE4A66A \
  --base-fee-bps 30 --dry-run

mlab curve jobs
mlab curve logs JOB_ID --limit 20
mlab curve stop JOB_ID
```

The daemon measures movement in the curve's on-chain price and adjusts fees within the fixed bounds. It uses the same [fee policy and defaults as pools](/pools#how-the-fee-changes). Keep `mlabd` running. Stopping the job leaves trading active at the last applied fee; an already-signed update may still settle.

## Claim Creator Fees [#claim-creator-fees]

Fees accrue on **both buys and sells**. The manager can prepare a withdrawal of accrued fees in native HYPE:

```bash
mlab curve claim-fees 0x59675174f1700677e608f86016f1cea764e1abfa \
  --factory 0x43bD454E79f7fD63101377817CbD34111fE4A66A \
  --account 0x0361c685F6bA3Cd66e9e8fE6095C91Ab0b4e5b8E --output json
```

Use your market and manager wallet, then sign the returned transaction. Claiming fees does not withdraw the HYPE reserved for sell-backs.
