> For the complete documentation index, see [llms.txt](/llms.txt).

# `pimlico_simulateAssetChanges`

Simulates a user operation to predict the asset changes it will cause. Shows all balance changes and shows all balance changes including native currency, ERC-20, ERC-1155, and ERC-721 tokens. This method uses [4950 credits](/services/get-started/pricing/) from your daily balance.

info

This method does not support v0.6 user operations.

## Parameters[​](#parameters "Direct link to Parameters")

- `userOperation`: (object) - The user operation object with the same format as `eth_estimateUserOperationGas`:

  - `sender`: (string) - The address of the account making the operation.
  - `nonce`: (string) - The account nonce.
  - `callData`: (string) - The data to pass to the sender during the main execution call.
  - `callGasLimit`: (string) [_optional_] - The amount of gas to allocate the main execution call.
  - `verificationGasLimit`: (string) [_optional_] - The amount of gas to allocate for the verification step.
  - `preVerificationGas`: (string) [_optional_] - The amount of gas to pay for to compensate the bundler.
  - `maxFeePerGas`: (string) [_optional_] - Maximum fee per gas, in wei, the sender is willing to pay per gas.
  - `maxPriorityFeePerGas`: (string) [_optional_] - Maximum priority fee per gas above the base fee.
  - `paymasterVerificationGasLimit`: (string) [_optional_] - Gas for paymaster verification step.
  - `paymasterPostOpGasLimit`: (string) [_optional_] - Gas for paymaster post-operation step.
  - `signature`: (string) - Must be a valid dummy signature for simulation.
- `entryPoint`: (string) - The EntryPoint contract address.
- `blockNumber`: (string) [_optional_] - Hex encoded block number to run the simulation at (defaults to `latest`).

## Returns[​](#returns "Direct link to Returns")

An object containing asset changes that would occur from executing the user operation:

`assetChanges`: (array) - Array of asset change objects, each containing:

- `token`: (object) - Token information (varies by token type). Token metadata fields (`name` and `symbol`) are included when available but may be undefined as they are optional in token standards.
- `value`: (object) - Balance change information:  
  - `diff`: (string) - The balance difference.
  - `pre`: (string) - Balance before the operation.
  - `post`: (string) - Balance after the operation.

## Example[​](#example "Direct link to Example")

Replace `<YOUR-API-KEY>` with an API key from your [Infura dashboard](https://app.infura.io/).

### Request[​](#request "Direct link to Request")

- curl

```
curl https://mainnet.infura.io/v3/<YOUR-API-KEY> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "pimlico_simulateAssetChanges",
    "id": 4337,
    "params": [
      {
        "sender": "0x5a6b47F4131bf1feAFA56A05573314BcF44C9149",
        "nonce": "0x1",
        "callData": "0x9faf00f4d9c8df66a69fd6242d468aa8a31a439d14fc6c7af3868a06ed392233bc7e39475df25ad2b52bd5e19e1d438277207a415cb4d4ce8ad192464c55ddf1a9559ff900000000000000000000000073da77f0f2daaa88b908413495d3d0e37458212e00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000039946fd82c9c86c9a61bceed86fbdd284590bdd90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000",
        "callGasLimit": "0x0",
        "verificationGasLimit": "0x0",
        "preVerificationGas": "0x0",
        "maxFeePerGas": "0x7a5cf70d5",
        "maxPriorityFeePerGas": "0x3b9aca00",
        "paymasterVerificationGasLimit": "0x0",
        "paymasterPostOpGasLimit": "0x0",
        "signature": "0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"
      },
      "0x0000000071727De22E5E9d8BAf0edAc6f37da032"
    ]
  }'

```

### Response[​](#response "Direct link to Response")

- Native Currency
- ERC-20
- ERC-721
- ERC-1155
- Multiple Assets

```
{
  "jsonrpc": "2.0",
  "id": 4337,
  "result": {
    "assetChanges": [
      {
        "token": {
          "tokenType": "NATIVE"
        },
        "value": {
          "diff": "-1000000000000000000",
          "pre": "5000000000000000000",
          "post": "4000000000000000000"
        }
      }
    ]
  }
}

```

```
{
  "jsonrpc": "2.0",
  "id": 4337,
  "result": {
    "assetChanges": [
      {
        "token": {
          "tokenType": "ERC-20",
          "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
          "decimals": 6,
          "name": "USD Coin",
          "symbol": "USDC"
        },
        "value": {
          "diff": "-1000000",
          "pre": "100000000",
          "post": "99000000"
        }
      }
    ]
  }
}

```

```
{
  "jsonrpc": "2.0",
  "id": 4337,
  "result": {
    "assetChanges": [
      {
        "token": {
          "tokenType": "ERC-721",
          "address": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
          "tokenId": 1234,
          "name": "Bored Ape Yacht Club",
          "symbol": "BAYC"
        },
        "value": {
          "diff": "1",
          "pre": "0",
          "post": "1"
        }
      }
    ]
  }
}

```

```
{
  "jsonrpc": "2.0",
  "id": 4337,
  "result": {
    "assetChanges": [
      {
        "token": {
          "tokenType": "ERC-1155",
          "address": "0x76BE3b62873462d2142405439777e971754E8E77",
          "tokenId": 5678,
          "name": "OpenSea Shared Storefront",
          "symbol": "OPENSTORE"
        },
        "value": {
          "diff": "10",
          "pre": "5",
          "post": "15"
        }
      }
    ]
  }
}

```

```
{
  "jsonrpc": "2.0",
  "id": 4337,
  "result": {
    "assetChanges": [
      {
        "token": {
          "tokenType": "ERC-20",
          "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
          "decimals": 6,
          "name": "USD Coin",
          "symbol": "USDC"
        },
        "value": {
          "diff": "-1000000",
          "pre": "100000000",
          "post": "99000000"
        }
      },
      {
        "token": {
          "tokenType": "ERC-20",
          "address": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
          "decimals": 8,
          "name": "Wrapped BTC",
          "symbol": "WBTC"
        },
        "value": {
          "diff": "1196",
          "pre": "0",
          "post": "1196"
        }
      },
      {
        "token": {
          "tokenType": "NATIVE"
        },
        "value": {
          "diff": "-1000000000000000000",
          "pre": "5000000000000000000",
          "post": "4000000000000000000"
        }
      }
    ]
  }
}

```

## Errors[​](#errors "Direct link to Errors")

Common error responses when simulation fails:

| Error Code            | Description                                        |
| --------------------- | -------------------------------------------------- |
| AA23                  | User operation reverted during simulation.         |
| UserOperationReverted | User operation execution failed during simulation. |
| SimulateValidation    | Validation failed for the user operation.          |
