# Can you tell me where is this compare is returning error

**URL:** <https://community.fireblocks.com/t/can-you-tell-me-where-is-this-compare-is-returning-error/811>\
**Category:** Developer Discussion\
**Created:** [March 18, 2024, 6:48pm UTC](https://community.fireblocks.com/t/can-you-tell-me-where-is-this-compare-is-returning-error/811 "2024-03-18T18:48:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shahid](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@Shahid](https://community.fireblocks.com/u/Shahid)\
**Post date:** [March 18, 2024, 6:48pm UTC](https://community.fireblocks.com/t/can-you-tell-me-where-is-this-compare-is-returning-error/811/1 "2024-03-18T18:48:53Z")

</div>

```auto
router.post(
  "/balance-check",
  body("assetId").notEmpty(),
  body("vaultId").notEmpty(),
  body("amount").notEmpty(),
  async (req, res) => {
    try {
      const { vaultId, assetId, amount } = req.body;

      // Retrieve asset balance from Fireblocks
      const assetBalance = await fireblocks.getVaultAccountAsset(
        vaultId,
        assetId,
      );

      // Check if the asset balance is greater than or equal to the required amount
      if (assetBalance.available < amount) {
        return res.status(400).json({
          status: "Error",
          error: "Your balance has been updated. Please redo the transcation. ",
          data: assetBalance,
          messages: [],
        });
      }

      // Return success response
      return res.status(200).json({
        status: "Success",
        data: assetBalance,
        messages: [],
      });
    } catch (error) {
      console.error(error);
      return res.status(500).json({
        id: null,
        error: error.message,
        messages: "Something went wrong!!",
      });
    }
  },
);

```

This is my response from the API  
with this parameter  
{

```
"vaultId": "437",
"assetId": "USDT_BSC",
"amount": "11609"

```

}

{  
“status”: “Success”,  
“data”: {  
“id”: “USDT\_BSC”,  
“total”: “11609.70291”,  
“balance”: “11609.70291”,  
“lockedAmount”: “0”,  
“available”: “11609.70291”,  
“pending”: “0”,  
“frozen”: “0”,  
“staked”: “0”,  
“blockHeight”: “36988178”,  
“blockHash”: “0x930e2d5bdb3037cebbb409f9033f882eb2d17bb5a10518a9f9789530169cbaef”  
},  
“messages”:   
}

if i call my endpoint more than 1000 it throws error please redo the transaction

why this is happening?

---

<div class="post-metadata">

**Author:** ![SlavaSereb](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@SlavaSereb](https://community.fireblocks.com/u/SlavaSereb)\
**Post date:** [March 21, 2024, 8:36am UTC](https://community.fireblocks.com/t/can-you-tell-me-where-is-this-compare-is-returning-error/811/2 "2024-03-21T08:36:18Z")

</div>

Hey @Shahid what is the error you get from Fireblocks?

Can you log the response from:

```auto
const assetBalance = await fireblocks.getVaultAccountAsset(
        vaultId,
        assetId,
      );

```

I suspect that you are hitting the rate limit if these 1000 calls are processed within a short time frame.
