# Cash and FX Position - Bank Balances, FX Exposure, Liquidity (`bloom-consulting/cash-fx-position`) Actor

Turn bank balances, time deposits, funds and FX debts into one cash and FX position: total and available cash, 30-day liquidity coverage, net FX position per currency, FX sensitivity, maturity calendar and warnings. No investment advice. HTML, PDF, Excel, JSON.

- **URL**: https://apify.com/bloom-consulting/cash-fx-position.md
- **Developed by:** [Bloom Consulting](https://apify.com/bloom-consulting) (community)
- **Categories:** Business, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Cash and FX Position - Bank Balances, FX Exposure, Liquidity

Put every bank account, time deposit, fund and FX debt in one place and see **how much cash the company really has, how much it can use in the next 30 days, and where it is exposed to exchange rates**.

No API keys, no LLM calls, no investment advice. The arithmetic is deterministic: the same inputs always produce the same report. Your data is not sent anywhere; the only outside call is optional, to read the Central Bank of the Republic of Turkey (CBRT) FX rates.

### What it does

Finance teams usually keep cash in four or five banks, in two or three currencies, part of it in deposits and funds, part of it pledged as collateral. The Actor turns that into one position:

| Section | What it answers |
| --- | --- |
| Summary | Total cash in TRY, available cash, blocked amounts, FX share |
| Liquidity tiers | What is usable today, within 7, 30 and 90 days, later, and what is blocked |
| 30-day coverage | Cash usable within 30 days against declared 30-day payments |
| FX position | Per currency: assets, receivables, liabilities and the net position, in units and in TRY |
| FX sensitivity | Effect of rate moves (default -10%, +10%, +20%, +30%) on the net position |
| Banks | Total and share per bank; concentration above the threshold is flagged |
| Maturity calendar | Deposit maturities, fund settlement, FX payments and receipts by date |
| Warnings | FX payment gaps, coverage below 1.0x, bank concentration, near maturities, idle cash share, blocked share, stale rates or fund prices |

**Facts, not advice.** The report states balances, calculations, dates and control questions. It never says "buy FX", "sell", "move to a fund" and never forecasts a rate or an interest rate.

**Week over week.** Pass the `data.json` of an earlier run as the previous run and the change in total cash is split into **FX effect** (rates moved) and **balance effect** (money moved).

### What you get

| File | What it is |
| --- | --- |
| `report.html` | The full report in one file, opens offline |
| `position-card.md` | One-screen summary: totals, coverage, net FX position, first warning |
| `report.pdf` | The report on A4 |
| `table.xlsx` | Accounts, rates, FX position, maturity calendar and warnings; TRY values are formulas |
| `data.json` | Every figure the report was built from |
| `input.json` | The exact input the engine used |

The dataset row carries the totals, liquidity tiers, banks, FX position, sensitivity and warnings, so you can chain it into a sheet, a dashboard or a weekly workflow.

### Input

Tick **Run with sample data** first to see a full report.

Otherwise fill **Treasury data**. Field names can be English or Turkish.

```json
{
  "company": "Example Food Distribution Ltd.",
  "reportDate": "2026-10-07",
  "rates": { "source": "CBRT FX buying", "date": "2026-10-06", "USD": 49.0918, "EUR": 55.1853 },
  "accounts": [
    { "bank": "Bank A", "account": "TRY current", "type": "current", "currency": "TRY", "balance": 3850000 },
    { "bank": "Bank A", "account": "USD current", "type": "current", "currency": "USD", "balance": 48000 },
    { "bank": "Bank B", "account": "32-day deposit", "type": "deposit", "currency": "TRY", "balance": 9000000,
      "startDate": "2026-09-10", "maturity": "2026-10-12", "interestRate": 39.5 },
    { "bank": "Bank C", "account": "Money market fund", "type": "fund", "currency": "TRY",
      "units": 2400000, "unitPrice": 2.6815, "priceDate": "2026-10-06", "settlementDays": 1 },
    { "bank": "Bank D", "account": "Guarantee collateral", "type": "deposit", "currency": "TRY",
      "balance": 2000000, "maturity": "2027-01-15", "blocked": true }
  ],
  "fxLiabilities": [ { "item": "Import supplier invoice", "currency": "USD", "amount": 85000, "due": "2026-10-27" } ],
  "fxReceivables": [ { "item": "Export receivable", "currency": "EUR", "amount": 45000, "due": "2026-11-10" } ],
  "paymentsNext30Days": 11500000
}
```

Notes:

- **`balance`** is the closing balance on the statement. Do not sum transactions.
- **`type`**: `current`, `deposit`, `fund`, `cash`, `gold` or `other`. One currency per account.
- **`blocked: true`** for pledged, collateral or otherwise restricted amounts; they are kept out of available cash.
- **`rates`** are the TRY value of one unit. Tick **Fetch CBRT rates** to use today's CBRT FX buying rates instead.
- **`paymentsNext30Days`** is the total TRY outflow you expect in the next 30 days (payroll, suppliers, taxes, loan instalments). Without it the coverage ratio is not calculated.
- **`thresholds`** (optional): `bankConcentrationPct` 40, `maturityWarningDays` 7, `liquidityCoverage` 1.0, `idleCashPct` 30, `blockedPct` 20, `rateMaxAgeDays` 3, `priceMaxAgeDays` 3.
- Instead of the JSON field you can pass **Input file URL**: a public link to a JSON file with the same data.

### Report language

`language: "en"` or `"tr"`. Every output is produced in the chosen language.

### Typical uses

- **CFOs and finance managers**: a weekly cash and FX position for the CEO in one file.
- **Importers and exporters**: see FX payment gaps and the net position per currency before the due date.
- **Holding and group finance teams**: run every company through the same checks.
- **Advisors and accountants**: produce a client-facing cash position from the bank screens you already have.

### Cost

The Actor is free to use; you pay only Apify platform usage for the run. A run takes roughly 10-30 seconds, most of it PDF rendering. Turn **Generate PDF** off for the cheapest run.

### Limits

- For information only. Not investment, tax or legal advice. Figures are as declared by you.
- The engine does not connect to your banks. It records what you give it and says what is missing.
- FX sensitivity shows arithmetic effects of rate moves; it is not a rate forecast.

### About

Built by **Bloom Consulting**, an AI consulting company that builds finance agents for startups and SMEs. On [Bloom Platform](https://platform.bloomconsulting.com.tr/?utm_source=apify\&utm_medium=store\&utm_campaign=hazine\&utm_content=readme-platform) you can upload your bank screens and statements as they are and get the same report without filling any field. The [desktop edition](https://bloomconsulting.com.tr/paketler?utm_source=apify\&utm_medium=store\&utm_campaign=hazine\&utm_content=readme-paid#hazine) runs fully offline and adds a Claude Code agent that writes the treasury note.

- Web: [bloomconsulting.com.tr](https://bloomconsulting.com.tr/?utm_source=apify\&utm_medium=store\&utm_campaign=hazine\&utm_content=readme-footer)
- Contact: iletisim@bloomconsulting.com.tr

Found a bug or want a check added? Open an issue on the Actor page.

# Changelog

This Actor's version history is a separate document: https://apify.com/bloom-consulting/cash-fx-position/changelog.md

# Actor input Schema

## `useSampleData` (type: `boolean`):

Ignore the fields below and run on a built-in example company (food distributor, 5 banks, TRY/USD/EUR, a fund, a blocked deposit, FX debts). Use this first to see the report. Output produced this way is stamped DEMO.

## `treasuryInput` (type: `object`):

accounts: one row per account with bank, account, type (current | deposit | fund | cash | gold | other), currency (TRY, USD, EUR...), balance (the closing balance on the statement, not a sum of transactions). Deposits: maturity, interestRate (annual %), startDate. Funds: fundCode, units, unitPrice, priceDate, settlementDays. Set blocked: true for pledged or collateral amounts. rates: TRY value of 1 unit of each currency, with source and date (or tick Fetch CBRT rates). fxLiabilities and fxReceivables: item, currency, amount, due. paymentsNext30Days: total TRY outflows expected in the next 30 days. reportDate defaults to today. English and Turkish field names are both accepted.

## `inputFileUrl` (type: `string`):

Alternative to the field above: a public http(s) URL of a JSON file with the same data. Used only when "Treasury data" is empty.

## `fetchCbrtRates` (type: `boolean`):

Read today's Central Bank of the Republic of Turkey FX buying rates (today.xml) and use them for the currencies in your data. Only the rates are read; none of your data is sent anywhere.

## `previousDataUrl` (type: `string`):

The data.json record of an earlier run (its key-value store URL). The report then splits the change in total cash into FX effect and balance effect.

## `companyName` (type: `string`):

Overrides the company name inside the data. Leave empty to keep it.

## `language` (type: `string`):

Language of the position card, report, PDF and spreadsheet.

## `generatePdf` (type: `boolean`):

Print the report to an A4 PDF with headless Chromium. Turn off for a faster, cheaper run.

## Actor input object example

```json
{
  "useSampleData": false,
  "treasuryInput": {
    "company": "Example Food Distribution Ltd.",
    "reportDate": "2026-10-07",
    "rates": {
      "source": "CBRT FX buying",
      "date": "2026-10-06",
      "USD": 49.0918,
      "EUR": 55.1853
    },
    "accounts": [
      {
        "bank": "Bank A",
        "account": "TRY current",
        "type": "current",
        "currency": "TRY",
        "balance": 3850000
      },
      {
        "bank": "Bank A",
        "account": "USD current",
        "type": "current",
        "currency": "USD",
        "balance": 48000
      },
      {
        "bank": "Bank B",
        "account": "32-day TRY deposit",
        "type": "deposit",
        "currency": "TRY",
        "balance": 9000000,
        "startDate": "2026-09-10",
        "maturity": "2026-10-12",
        "interestRate": 39.5
      },
      {
        "bank": "Bank C",
        "account": "Money market fund",
        "type": "fund",
        "currency": "TRY",
        "fundCode": "ABC",
        "units": 2400000,
        "unitPrice": 2.6815,
        "priceDate": "2026-10-06",
        "settlementDays": 1
      },
      {
        "bank": "Bank D",
        "account": "Guarantee collateral",
        "type": "deposit",
        "currency": "TRY",
        "balance": 2000000,
        "maturity": "2027-01-15",
        "blocked": true
      }
    ],
    "fxLiabilities": [
      {
        "item": "Import supplier invoice",
        "type": "supplier",
        "currency": "USD",
        "amount": 85000,
        "due": "2026-10-27"
      }
    ],
    "fxReceivables": [
      {
        "item": "Export receivable",
        "currency": "EUR",
        "amount": 45000,
        "due": "2026-11-10"
      }
    ],
    "paymentsNext30Days": 11500000,
    "fxScenarios": [
      -10,
      10,
      20,
      30
    ]
  },
  "fetchCbrtRates": false,
  "language": "en",
  "generatePdf": true
}
```

# Actor output Schema

## `results` (type: `string`):

Total and available cash, 30-day coverage, net FX position, FX sensitivity, banks, liquidity tiers and warnings.

## `report` (type: `string`):

The full cash and FX position report in one file.

## `positionCard` (type: `string`):

One-screen summary: totals, coverage, net FX position and the first warning.

## `reportPdf` (type: `string`):

The report on A4.

## `workbook` (type: `string`):

Accounts, rates, FX position, maturity calendar and warnings, with formulas.

## `data` (type: `string`):

Every figure the report was built from; pass its URL as the previous run next time.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "treasuryInput": {
        "company": "Example Food Distribution Ltd.",
        "reportDate": "2026-10-07",
        "rates": {
            "source": "CBRT FX buying",
            "date": "2026-10-06",
            "USD": 49.0918,
            "EUR": 55.1853
        },
        "accounts": [
            {
                "bank": "Bank A",
                "account": "TRY current",
                "type": "current",
                "currency": "TRY",
                "balance": 3850000
            },
            {
                "bank": "Bank A",
                "account": "USD current",
                "type": "current",
                "currency": "USD",
                "balance": 48000
            },
            {
                "bank": "Bank B",
                "account": "32-day TRY deposit",
                "type": "deposit",
                "currency": "TRY",
                "balance": 9000000,
                "startDate": "2026-09-10",
                "maturity": "2026-10-12",
                "interestRate": 39.5
            },
            {
                "bank": "Bank C",
                "account": "Money market fund",
                "type": "fund",
                "currency": "TRY",
                "fundCode": "ABC",
                "units": 2400000,
                "unitPrice": 2.6815,
                "priceDate": "2026-10-06",
                "settlementDays": 1
            },
            {
                "bank": "Bank D",
                "account": "Guarantee collateral",
                "type": "deposit",
                "currency": "TRY",
                "balance": 2000000,
                "maturity": "2027-01-15",
                "blocked": true
            }
        ],
        "fxLiabilities": [
            {
                "item": "Import supplier invoice",
                "type": "supplier",
                "currency": "USD",
                "amount": 85000,
                "due": "2026-10-27"
            }
        ],
        "fxReceivables": [
            {
                "item": "Export receivable",
                "currency": "EUR",
                "amount": 45000,
                "due": "2026-11-10"
            }
        ],
        "paymentsNext30Days": 11500000,
        "fxScenarios": [
            -10,
            10,
            20,
            30
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("bloom-consulting/cash-fx-position").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "treasuryInput": {
        "company": "Example Food Distribution Ltd.",
        "reportDate": "2026-10-07",
        "rates": {
            "source": "CBRT FX buying",
            "date": "2026-10-06",
            "USD": 49.0918,
            "EUR": 55.1853,
        },
        "accounts": [
            {
                "bank": "Bank A",
                "account": "TRY current",
                "type": "current",
                "currency": "TRY",
                "balance": 3850000,
            },
            {
                "bank": "Bank A",
                "account": "USD current",
                "type": "current",
                "currency": "USD",
                "balance": 48000,
            },
            {
                "bank": "Bank B",
                "account": "32-day TRY deposit",
                "type": "deposit",
                "currency": "TRY",
                "balance": 9000000,
                "startDate": "2026-09-10",
                "maturity": "2026-10-12",
                "interestRate": 39.5,
            },
            {
                "bank": "Bank C",
                "account": "Money market fund",
                "type": "fund",
                "currency": "TRY",
                "fundCode": "ABC",
                "units": 2400000,
                "unitPrice": 2.6815,
                "priceDate": "2026-10-06",
                "settlementDays": 1,
            },
            {
                "bank": "Bank D",
                "account": "Guarantee collateral",
                "type": "deposit",
                "currency": "TRY",
                "balance": 2000000,
                "maturity": "2027-01-15",
                "blocked": True,
            },
        ],
        "fxLiabilities": [{
                "item": "Import supplier invoice",
                "type": "supplier",
                "currency": "USD",
                "amount": 85000,
                "due": "2026-10-27",
            }],
        "fxReceivables": [{
                "item": "Export receivable",
                "currency": "EUR",
                "amount": 45000,
                "due": "2026-11-10",
            }],
        "paymentsNext30Days": 11500000,
        "fxScenarios": [
            -10,
            10,
            20,
            30,
        ],
    } }

# Run the Actor and wait for it to finish
run = client.actor("bloom-consulting/cash-fx-position").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "treasuryInput": {
    "company": "Example Food Distribution Ltd.",
    "reportDate": "2026-10-07",
    "rates": {
      "source": "CBRT FX buying",
      "date": "2026-10-06",
      "USD": 49.0918,
      "EUR": 55.1853
    },
    "accounts": [
      {
        "bank": "Bank A",
        "account": "TRY current",
        "type": "current",
        "currency": "TRY",
        "balance": 3850000
      },
      {
        "bank": "Bank A",
        "account": "USD current",
        "type": "current",
        "currency": "USD",
        "balance": 48000
      },
      {
        "bank": "Bank B",
        "account": "32-day TRY deposit",
        "type": "deposit",
        "currency": "TRY",
        "balance": 9000000,
        "startDate": "2026-09-10",
        "maturity": "2026-10-12",
        "interestRate": 39.5
      },
      {
        "bank": "Bank C",
        "account": "Money market fund",
        "type": "fund",
        "currency": "TRY",
        "fundCode": "ABC",
        "units": 2400000,
        "unitPrice": 2.6815,
        "priceDate": "2026-10-06",
        "settlementDays": 1
      },
      {
        "bank": "Bank D",
        "account": "Guarantee collateral",
        "type": "deposit",
        "currency": "TRY",
        "balance": 2000000,
        "maturity": "2027-01-15",
        "blocked": true
      }
    ],
    "fxLiabilities": [
      {
        "item": "Import supplier invoice",
        "type": "supplier",
        "currency": "USD",
        "amount": 85000,
        "due": "2026-10-27"
      }
    ],
    "fxReceivables": [
      {
        "item": "Export receivable",
        "currency": "EUR",
        "amount": 45000,
        "due": "2026-11-10"
      }
    ],
    "paymentsNext30Days": 11500000,
    "fxScenarios": [
      -10,
      10,
      20,
      30
    ]
  }
}' |
apify call bloom-consulting/cash-fx-position --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bloom-consulting/cash-fx-position"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/1jazN86hqoKDJFL45/builds/lqqsYWf8GVbTCtoVo/openapi.json
