> ## Documentation Index
> Fetch the complete documentation index at: https://docs.primev.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing Your Bidder Deposit

**To check your deposit for a specific provider**

```shell theme={null}
> curl -s "http://localhost:13523/v1/bidder/get_deposit?provider=0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" | jq
{
  "amount": "0",
  "provider": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"
}
```

**To check deposits for all providers and get bidder EOA balance**

```shell theme={null}
> curl -s "http://localhost:13523/v1/bidder/get_all_deposits" | jq
{
  "deposits": [
    {
      "provider": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
      "amount": "3000000000000000000"
    }
  ],
  "bidderBalance": "9996999791340641239011"
}
```

**Funding your node account**

First, retrieve the Ethereum account address of your node:

```shell theme={null}
> curl localhost:13523/v1/debug/topology | jq
{
  "self": {
    "Addresses": [
      "/ip4/127.0.0.1/tcp/13522",
      "/ip4/172.29.0.4/tcp/13522"
    ],
    "Ethereum Address": "0xB9286CB4782E43A202BfD426AbB72c8cb34f886c",
    "Peer Type": "bidder",
    "Underlay": "16Uiu2HAmDWZb4DxZQkS9yseXNukBFe6MhZdimSKuZcHFeJrF3jC9"
  },
  "connected_peers": {
    "providers": [
      "0x48ddc642514370bdafad81c91e23759b0302c915",
      "0x972eb4fc3c457da4c957306be7fa1976bb8f39a6",
      "0xa1e8fdb3bb6a0db7aa5db49a3512b01671686dcb"
    ]
  },
  "blocked_peers": null
}
```

To add funds to your bidder EOA on the mev-commit chain, you may use the [bridge](/v1.2.x/get-started/bridge).

**Automate depositing - The easy way**

It's recommended that bidders leverage the *deposit manager* to deposit, and automate ongoing re-deposits to specific providers.

The deposit manager is an on-chain contract that a bidder account can enable by "setting their code" to the implementation using EIP-7702. After enabling the deposit manager, a bidder's deposits are automatically replenished from the bidder's EOA balance during the preconf settlement process, according to *target deposit* amounts configured by the bidder.

The easiest way to enable the deposit manager is by setting two flags/environment variables upon starting your bidder node:

```shell theme={null}
> ./mev-commit --enable-deposit-manager=true --target-deposit-amount=<amount>
```

Where the target deposit amount will be set for all valid providers that're currently a part of the network. Alternatively you can use the `MEV_COMMIT_ENABLE_DEPOSIT_MANAGER` and `MEV_COMMIT_TARGET_DEPOSIT_AMOUNT` environment variables.

**Automate depositing - Through API**

To enable the deposit manager through API, use the following command:

```shell theme={null}
> curl -s -X POST http://localhost:13523/v1/bidder/enable_deposit_manager | jq
{
  "success": true
}
```

Then to set target deposits customized to each provider:

```shell theme={null}
> curl -s -X POST http://localhost:13523/v1/bidder/set_target_deposits -H 'Content-Type: application/json' -d '{"target_deposits":[{"provider":"0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC","target_deposit":"3000000000000000000"}]}' | jq
{
  "successfullySetDeposits": [
    {
      "provider": "3c44cdddb6a900fa2b585dd299e03d12fa4293bc",
      "targetDeposit": "3000000000000000000"
    }
  ],
  "successfullyToppedUpProviders": [
    "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"
  ]
}
```

**Manually adding to your deposit**

If you'd like to manually increase the deposit for a provider, use the following command, specifying the desired amount:

```shell theme={null}
> curl -s -X POST "http://localhost:13523/v1/bidder/deposit/1000000000000000000?provider=0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" | jq
{
  "amount": "1000000000000000000",
  "provider": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"
}
```

To manually deposit evenly to multiple providers, use the following command:

```shell theme={null}
> curl -s -X POST "http://localhost:13523/v1/bidder/deposit_evenly?total_amount=2000000000000000000&providers=0x8F644015Aa59984BF849259375d9135A89a940e7&providers=0x353ff5537cc2fe78C8632c41Bb848735C2982c45" | jq
{
  "providers": [
    "8f644015aa59984bf849259375d9135a89a940e7",
    "353ff5537cc2fe78c8632c41bb848735c2982c45"
  ],
  "amounts": [
    "1000000000000000000",
    "1000000000000000000"
  ]
}
```

After successfully depositing, you are ready to send bids and receive preconfirmations on the network.

**Withdrawing from your deposit**

To withdraw funds from your deposit to a specific provider, use the following command:

```shell theme={null}
> curl -s -X POST http://localhost:13523/v1/bidder/request_withdrawals \
  -H 'Content-Type: application/json' \
  -d '{
    "providers": [
      "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"
    ]
  }' | jq
{
  "providers": [
    "3c44cdddb6a900fa2b585dd299e03d12fa4293bc"
  ],
  "amounts": [
    "3000000000000000000"
  ]
}
```

Then you must wait the withdrawal period to elapse, currently \~10 minutes. Then finally call:

```shell theme={null}
curl -s -X POST http://localhost:13523/v1/bidder/withdraw \
  -H 'Content-Type: application/json' \
  -d '{
    "providers": [
      "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"
    ]
  }' | jq
{
  "providers": [
    "3c44cdddb6a900fa2b585dd299e03d12fa4293bc"
  ],
  "amounts": [
    "3000000000000000000"
  ]
}
```

### Outcome of preconfirmed bids

When a bid is preconfirmed by a provider, there are several possible outcomes:

| Outcome Matrix               | Provider Wins Slot Auction            | Provider Loses Slot Auction |
| ---------------------------- | ------------------------------------- | --------------------------- |
| **Transaction in block**     | Reward Provider                       | Refund Bid to Bidder        |
| **Transaction not in block** | Slash Provider & Refund Bid To Bidder | Refund Bid to Bidder        |
