> For the complete documentation index, see [llms.txt](https://docs-core.allbridge.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-core.allbridge.io/sdk/guides/utilities/amount-and-fee-calculations.md).

# Amount and fee calculations

To calculate and get info about the receive amount, one has to call [getAmountToBeReceived](https://bridge-core-sdk.web.app/classes/AllbridgeCoreSdk.html#getAmountToBeReceived) method.&#x20;

```typescript
const amountToBeReceived = await sdk.getAmountToBeReceived(amount, sourceToken, destinationToken);
console.log(
  "Send %d %s and %d %s (gas fee) on %s to receive %d %s on %s",
  amount,
  sourceToken.symbol,
  gasFeeOptions.native.int,
  sourceChainMinUnit,
  sourceToken.chainSymbol,
  amountToBeReceived,
  destinationToken.symbol,
  destinationToken.chainSymbol
);
```

If you selected pay with stables:

```typescript
const gasFeeOptions = await sdk.getGasFeeOptions(sourceToken, destinationToken, Messenger.ALLBRIDGE);

const floatGasFeeAmount = gasFeeOptions.stablecoin.float;
console.log(
  "Send %d %s and %d %s (gas fee) on %s to receive %d %s on %s",
  amount,
  sourceToken.symbol,
  floatGasFeeAmount,
  sourceToken.symbol,
  sourceToken.chainSymbol,
  amountToBeReceived,
  destinationToken.symbol,
  destinationToken.chainSymbol
);
```

If you want to calculate how much you need to send to receive a specific amount use a [getAmountToSend](https://bridge-core-sdk.web.app/classes/AllbridgeCoreSdk.html#getAmountToSend) method:

```typescript
const amountToSend = await sdk.getAmountToSend(amount, sourceToken, destinationToken);
console.log(
  "Send %d %s and %d %s (gas fee) on %s to receive %d %s on %s",
  amountToSend,
  sourceToken.symbol,
  gasFeeOptions.native.int,
  sourceChainMinUnit,
  sourceToken.chainSymbol,
  amount,
  destinationToken.symbol,
  destinationToken.chainSymbol
);
```

If you want to receive additional data about fees, select [getAmountToBeReceivedAndGasFeeOptions](https://bridge-core-sdk.web.app/classes/AllbridgeCoreSdk.html#getAmountToBeReceivedAndGasFeeOptions) or [getAmountToSendAndGasFeeOptions](https://bridge-core-sdk.web.app/classes/AllbridgeCoreSdk.html#getAmountToSendAndGasFeeOptions) method instead:

```typescript
const { amountToSendFloat, amountToBeReceivedFloat, gasFeeOptions } = await sdk.getAmountToBeReceivedAndGasFeeOptions(
  amount,
  sourceToken,
  destinationToken,
  Messenger.ALLBRIDGE
);
console.log(
  "Send %d %s and %d %s (gas fee) on %s to receive %d %s on %s",
  amountToSendFloat,
  sourceToken.symbol,
  gasFeeOptions.native.int,
  sourceChainMinUnit,
  sourceToken.chainSymbol,
  amountToBeReceivedFloat,
  destinationToken.symbol,
  destinationToken.chainSymbol
);
```

[Full example](https://github.com/allbridge-io/allbridge-core-js-sdk/blob/main/examples/src/examples/bridge/calculate-amounts.ts)
