# Using the full ERC20 or Native balance in a call

The Squid Multicall can update the value of a param on-chain before or after the Swap or bridge has occurred. This lets you do the following:

* Send the remainder of tokens to the user's address, after minting or buying something at a fixed price
* Stake the full amount received from a swap
* Unstake, then swap the full amount across chains

This is designated by using `callType`

```typescript
export enum SquidCallType {
  DEFAULT = 0,
  FULL_TOKEN_BALANCE = 1,
  FULL_NATIVE_BALANCE = 2,
  COLLECT_TOKEN_BALANCE = 3, // unused in hooks
}
```

{% tabs %}
{% tab title="FULL\_ERC20\_BALANCE" %}

```typescript
const sendRemainderToUserCall = {
        callType: SquidCallType.FULL_TOKEN_BALANCE, // transfer any remaining MAGIC to the user's account
        target: magicToken,
        value: "0",
        callData: transferMagicEncodeData,
        payload: {
          tokenAddress: magicToken,
          inputPos: 1,
        },
        estimatedGas: "50000",
},
```

{% endtab %}

{% tab title="FULL\_NATIVE\_BALANCE" %}

```typescript
const mintLoanWithFullNativeBalanceCall = {
        callType: SquidCallType.FULL_NATIVE_BALANCE,
        target: moonwellGlmrAddress,
        value: "0", // this will be replaced by the full native balance of the multicall after the swap
        callData: mintEncodeData,
        payload: {
          tokenAddress: "0x", // unused in callType 2, dummy value
          inputPos: 1, // unused
        },
        estimatedGas: "250000",
},
```

{% endtab %}

{% tab title="DEFAULT" %}

```typescript
const repayLoanCall = {		
	callType: SquidCallType.DEFAULT, 0
	target: aavePoolAddress,
	value: '0',
	callData: repayEncodedData,
	estimatedGas: '50000',
	payload: {
		tokenAddress: "", // unused in callType 0, dummy value
		inputPos: 0, // unused in callType 0, dummy value
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.squidrouter.com/old-v2-documentation-deprecated/key-concepts/hooks/using-the-full-erc20-or-native-balance-in-a-call.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
