# create-crowdloan (/docs/tx/create-crowdloan)

Locks `deposit_tao` from the creator (it counts toward the raise and
comes back when the loan is dissolved) and opens the loan for
contributions until `end`. Provide exactly one of `target_ss58` (the
address that receives the raised funds on finalize) or `call` (an inner
intent, `{"op": ..., ...args}`, dispatched with the creator's origin on
finalize) — supplying both or neither is rejected. If the cap is reached
the creator finalizes with `finalize_crowdloan`. Passing `end` only
stops new contributions — nothing is refunded automatically: the creator
returns contributions with `refund_crowdloan` (contributors may also
`withdraw_crowdloan` themselves) and then `dissolve_crowdloan` to
recover the deposit.

| Signer    | Pallet    | Wraps              |
| --------- | --------- | ------------------ |
| `coldkey` | Crowdloan | `Crowdloan.create` |

## Parameters [#parameters]

| Parameter              | Type              | Required | Description                                                                                                                                                    |
| ---------------------- | ----------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `deposit_tao`          | number \| `"all"` | yes      | Creator's initial deposit, locked when the crowdloan opens. It counts toward the raise and is returned when the crowdloan is dissolved.                        |
| `min_contribution_tao` | number \| `"all"` | yes      | Smallest contribution the crowdloan will accept from a contributor.                                                                                            |
| `cap_tao`              | number \| `"all"` | yes      | Maximum total to raise. Reaching the cap lets the creator finalize.                                                                                            |
| `end`                  | integer           | yes      | Block number at which the crowdloan stops accepting contributions. Passing it refunds nothing by itself; refunds happen via explicit refund or withdraw calls. |
| `target_ss58`          | string            | no       | Account that receives the raised funds on finalize. Provide exactly one of this or call.                                                                       |
| `call`                 | object            | no       | Inner intent dispatched with the creator's origin on finalize, as a JSON object \{"op": \<name>, ...args}. Provide exactly one of this or target\_ss58.        |

Address parameters (`--hotkey`, `--coldkey`, `--dest`, ...) accept a raw ss58
address, an address-book or proxy-book name, or a local wallet/hotkey name.

## CLI [#cli]

Preview with `--dry-run` (shows fee, effects, and policy result without
submitting), then submit:

```bash
btcli tx create-crowdloan \
  --deposit-tao <amount|all> \
  --min-contribution-tao <amount|all> \
  --cap-tao <amount|all> \
  --end <int> --dry-run
btcli tx create-crowdloan \
  --deposit-tao <amount|all> \
  --min-contribution-tao <amount|all> \
  --cap-tao <amount|all> \
  --end <int> -w my_coldkey
```

## Python [#python]

```python
import bittensor as sub
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = sub.CreateCrowdloan(deposit_tao=1.0, min_contribution_tao=1.0, cap_tao=1.0, end=0)

async with sub.Client("finney") as client:
    plan = await client.plan(intent, wallet)   # fee, effects, policy — no submission
    result = await client.execute(intent, wallet)
    if not result.success:
        print(result.error.code, result.error.remediation)
```

Or build it by op name, as an agent would:

```python
await client.execute_tool("create_crowdloan", {...}, wallet)
```
