> For the complete documentation index, see [llms.txt](https://yupana-finance.gitbook.io/yupana-document-portal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yupana-finance.gitbook.io/yupana-document-portal/developer-space/ytoken-contract-methods/admin-methods/manage-entrypoints/withdrawreserve.md).

# withdrawReserve

Withdraw protocol reserves from protocol.

### Usage

{% tabs %}
{% tab title="🌮 Taquito" %}

```typescript
const tokenId = 0; // or new BigNumber(0) or "0"
const amount = 10_000_000; // or new BigNumber(10_000_000) or "10000000"
const yupana = await tezos.contract.at(yTokenAddress);
const operation = await yupana.methods.withdrawReserve(tokenId, amount).send();
await operation.confirmation();
```

{% endtab %}

{% tab title="🐍   Pytezos" %}

```python
token_id = 0
amount = 10_000_000
yupana = ContractInterface.from_michelson(code) # or client.contract(contract_address)...
call = yupana.withdrawReserve(token_id, amount)
opg = call.inject()
```

{% endtab %}
{% endtabs %}

### Errors

* `yToken/not-admin` - `sender` is not contract admin.
* `underflow/totalReservesF` - when `token.totalReserves` < `amount`
* `token/cant-get-contract-token` - FA12 token contract address does not contain `transfer` entrypoint from FA12 interface.
* `token/cant-get-contract-fa2-token` - FA2 token contract address does not contain `transfer` entrypoint from FA2 interface.
