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

Moves the amount from the signer into the crowdloan's pot. The contribution
must meet the loan's minimum (and per-contributor maximum, if set) and the
loan must still be open — contributing after `end` or past the cap fails.
Contributions are not refunded automatically if the loan fails: they come
back when the creator calls `refund_crowdloan`, or the contributor can
`withdraw_crowdloan` themselves any time before finalization. On
success, the funds go to the loan's target or fund its inner call.

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

## Parameters [#parameters]

| Parameter      | Type              | Required | Description                                                                                                               |
| -------------- | ----------------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
| `crowdloan_id` | integer           | yes      | Identifier of the crowdloan, assigned when it was created.                                                                |
| `amount_tao`   | number \| `"all"` | yes      | Amount to contribute; moved into the crowdloan's pot. Recoverable via refund or withdraw while the loan is not finalized. |

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 contribute-crowdloan \
  --crowdloan-id <int> \
  --amount-tao <amount|all> --dry-run
btcli tx contribute-crowdloan \
  --crowdloan-id <int> \
  --amount-tao <amount|all> -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.ContributeCrowdloan(crowdloan_id=0, amount_tao=1.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("contribute_crowdloan", {...}, wallet)
```
