> ## Documentation Index
> Fetch the complete documentation index at: https://docs.renesis.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Tool reference

> Every Constance tool, grouped by topic, with its parameters and what it returns

# Tool reference

Constance serves the tools below over MCP and uses the same ones behind the terminal chat and Telegram. Every tool is read-only except the three marked **write** under [Alerts](#alerts).

## Scope

Two ids drive almost everything:

| Id | Comes from | Looks like |
| - | - | - |
| `exchange_account_id` | `list_accounts` | `exchange_mighty_purple_condor` |
| `portfolio_id` | `list_portfolios` | `665f1c2ab3d94e0012ab34cd` |

In the tables, **scope** says which of the two a tool takes:

* **account**: `exchange_account_id` only
* **portfolio**: `portfolio_id` only
* **either**: pass one of the two; the account slug for one account, the portfolio id for the whole book
* **none**: no user scope, market data or your plan

Dates are ISO (`2026-08-01`) unless a parameter says epoch milliseconds. `page` counts from 0. Trailing windows default to 12 months. Series are downsampled to at most 60 points.

## Accounts and NAV

| Tool | Scope | What it returns | Parameters |
| - | - | - | - |
| `list_accounts` | none | Every exchange account and wallet you can access: slug, name, exchange, wallet address and chain, ledger status. Start here. | |
| `list_portfolios` | none | Your portfolios: id, name, parent. | |
| `get_account_summary` | either | NAV, realized and unrealized PnL, fees, funding and rebates. | |
| `get_all_account_summaries` | none | One row per account with NAV and PnL, plus a summed total. Use it for anything spanning more than one account. | |
| `get_account_assets` | either | Holdings: per-asset amounts and cost basis, with USD values from the reconciled ledger. | |
| `get_live_balances` | account | What the exchange or chain shows right now, split into spot, futures, portfolio-margin and staking wallets. Native units, no USD. Slower. | |
| `get_balances_as_of` | either | Per-asset balances on a past date from the daily snapshots. Says which snapshot day it used, and says so if the date predates history. | `date` (required, `YYYY-MM-DD`) |
| `get_user_quota` | none | Plan limits and usage: trades, transfers, accounts and DeFi transactions imported vs allowed. | |

## PnL and history

| Tool | Scope | What it returns | Parameters |
| - | - | - | - |
| `get_account_pnl` | either | PnL broken down by asset and market type, realized and unrealized. | |
| `get_nav_history` | either | Daily USD NAV as `[date, value]` points. | `months` |
| `get_chart_series` | either | One history series in a chosen currency: NAV raw, NAV gross, cumulative realized PnL or unrealized PnL. The way to get NAV in BTC, ETH or EUR terms. | `chart_type` (required: `nav_raw_history_1d`, `nav_gross_history_1d`, `realized_pnl_history`, `unrealized_pnl_history`), `vs_currency` (`usd`, `eur`, `jpy`, `chf`, `gbp`, `cad`, `aud`, `nzd`, `inr`, `aed`, `btc`, `eth`, `sol`, `bnb`, `xrp`, `hype`), `months` |
| `get_breakdown_chart` | either | How the DeFi category split (balances, staking, lending, LP, vault) developed over time, as value or as PnL. | `chart_type` (`nav`, `pnl`), `category` (comma-separated subset of `total,balances,staking,lending,lp,vault`), `months` |

## Risk

| Tool | Scope | What it returns | Parameters |
| - | - | - | - |
| `get_risk_metrics` | either | Volatility, max drawdown, Sharpe, Sortino, VaR 95, Calmar, Omega and period returns. | `metric_type` (`current` snapshot, `daily` inception-to-date expanding, `monthly` or `quarterly` per-period) |
| `get_risk_report` | either | How risk developed: the current battery over the window, a monthly series of trailing 90-day volatility, Sharpe and drawdown, the top drawdown episodes with dates and depths, and data-sufficiency notes. | `months` |
| `get_benchmark_summary` | either | Alpha, beta and capture ratios against a benchmark. | `benchmark_id` (required, e.g. `SP500`, `BTC_100`) |
| `get_benchmark_series` | none | A benchmark index over time, normalised to 100 at series start. Pair with `get_nav_history`. | `benchmark_id` (required: `BTC_100`, `ETH_100`, `SOL_100`, `BTC50_ETH50`, `BTC50_ETH30_SOL20`, `SP500`, `NASDAQ`, `DJIA`, `BCI25 / MVDA25`), `months` |

## Positions

| Tool | Scope | What it returns | Parameters |
| - | - | - | - |
| `get_open_positions` | account | Open derivative positions (perps and futures): symbol, side, size, entry price. Spot holdings are not positions; those are `get_account_assets`. An empty list means no open derivatives. | `page`, `size` (default 50) |

## DeFi

| Tool | Scope | What it returns | Parameters |
| - | - | - | - |
| `get_defi_attribution` | portfolio | Where DeFi value and PnL sit. `protocol`: inflow, outflow, receipt-token value and gas per protocol. `strategy`: staking, restaking, lending, DEX trading, yield vaults, bridges, liquidity provision with net PnL each. `position`: every position by chain and contract with value, units and per-account split. The reliable source for portfolio-wide DeFi value. | `by` (required: `protocol`, `strategy`, `position`) |
| `get_defi_summary` | either | LP, vault, staking and lending positions with the realized PnL of each activity, plus NFT holdings. Reads the per-account DeFi ledger, which can be empty for a wallet that holds DeFi value through receipt tokens. | |
| `get_defi_activity_pnl` | either | DeFi PnL by activity type (staking, lending, LP, vault) and within each by protocol, inception to date. | |
| `get_defi_protocol_history` | portfolio | Daily USD value per DeFi protocol over time, for the top protocols. | `months`, `top` (default 4, max 6) |
| `get_defi_position_value_history` | portfolio | USD value of individual on-chain positions (per token contract) over time. | `months`, `top` (default 4, max 6), `symbol` |
| `get_vault_yield_curves` | portfolio | Per vault share token: protocol, underlying, latest price-per-share, your NAV, and the price-per-share series. | `months` |
| `get_staking_positions` | portfolio | Current staking positions: staked amount, protocol, yield. | |
| `get_staking_yield_curve` | portfolio | Cumulative staking yield in USD over time per account and asset. | `months` |
| `get_liquidity_positions` | portfolio | Current DEX LP positions: pool, tokens supplied, present value. | |
| `get_impermanent_loss_curve` | portfolio | Impermanent loss in USD over time per DEX pair. | `months` |
| `get_defi_transactions` | either | On-chain transactions, newest first: swaps, transfers, airdrops, liquidity actions, staking, lending, bridges, yield vaults, NFTs, governance. Each with assets, amounts, protocol and hash. | `category` (comma-separated subset of `swaps,transfers,airdrops,liquidity_actions,staking,lending,bridges,yield_vaults,nfts,governance,uncategorized`), `from_timestamp`, `to_timestamp` (epoch **milliseconds**), `no_spam` (default true), `page`, `size` (default 25) |
| `get_defi_transaction_stats` | either | Transaction counts per category, optionally in a window. One call instead of paging. | `from_timestamp`, `to_timestamp` (epoch milliseconds) |

<Note>
  The per-account DeFi ledger and the on-chain transaction index can both come back empty for a wallet whose DeFi value still shows in `get_defi_attribution`. An empty result from `get_defi_summary` or a zero from `get_defi_transactions` is not proof of no DeFi activity. For portfolio-wide DeFi value and PnL, `get_defi_attribution` is the source to trust.
</Note>

## Perps and funding

Your own payments and PnL:

| Tool | Scope | What it returns | Parameters |
| - | - | - | - |
| `get_perps_summary` | either | Funding paid and received plus realized PnL, totalled and by market and symbol. | `start_ts`, `end_ts` (epoch milliseconds) |
| `get_funding_payments` | either | Funding payment history, optionally per market, raw or aggregated daily or monthly, with a running cumulative total. | `market` (e.g. `ETH/USDT:USDT`), `start_ts`, `end_ts`, `aggregation` (`raw`, `daily`, `monthly`), `cumulative`, `page`, `size` (default 50, max 500) |
| `get_perps_pnl` | either | Realized PnL from closed perpetual positions, same shape and options as funding payments. | `market`, `start_ts`, `end_ts`, `aggregation`, `cumulative`, `page`, `size` |
| `get_rebates` | either | Trading rebates and rewards, newest first, with a per-currency summary. | `currency`, `start_ts`, `end_ts`, `page`, `size` (default 50, max 500) |

Market rates, no user scope:

| Tool | What it returns | Parameters |
| - | - | - |
| `get_funding_rate_for_pair` | Latest funding rate for one perpetual pair on every tracked exchange, with mark and index price. | `pair` (required, ccxt swap symbol like `BTC/USDT:USDT`) |
| `get_funding_snapshot` | Latest funding for every perpetual market on one exchange, sorted by the most extreme 8h-normalised rate. | `exchange` (required, ccxt id), `top` (default 20) |
| `get_funding_rate_history` | Historical funding for one pair on one exchange, oldest first, with sum and mean. Live exchange call, slower. | `exchange`, `symbol` (both required), `limit` (default 30, max 100) |
| `get_arb_opportunities` | Best spot-perp funding carry right now: APR, net APR after fees, funding rate, interval, break-even hours. | `exchange` (omit for all), `top` (default 15), `include_outliers` |

## Attribution and strategies

| Tool | Scope | What it returns | Parameters |
| - | - | - | - |
| `get_attribution_analytics` | either | Category exposure of categorisable spot holdings: value and weight, realized and unrealized PnL, cost basis and top assets per category. Its `total_nav` is the categorised-spot total, not account NAV: derivatives collateral and on-chain DeFi are excluded. | `categories` (comma-separated ids), `time_range` (`7d`, `30d`, `90d`, `1y`, `ytd`, `all`) |
| `list_attribution_categories` | none | Available categories (predefined like `layer_1`, `stablecoin`, `defi`, `meme`, plus your custom ones) with ids and descriptions. | |
| `get_category_assets` | either | Every asset inside one category with balance, value, cost basis, PnL and return. | `category_id` (required), `sort_by` (`value_usd`, `realized_pnl`, `total_return_pct`, `total_pnl`), `sort_order`, `limit` (default 20, max 25) |
| `get_strategy_groups` | portfolio | Your strategies (position groups): combined value, cost basis, PnL and return each, plus the ungrouped remainder. | |
| `get_strategy_legs` | portfolio | Every position leg with account, chain, symbol, value, cost, PnL and its strategy. The only way to see ungrouped positions. | `ungrouped_only`, `limit` (default 12, max 15) |
| `get_venue_distribution` | portfolio | Order counts per venue (CEX orders plus DEX swaps per protocol) and the CEX vs DEX totals, all time. | |

## Activity

| Tool | Scope | What it returns | Parameters |
| - | - | - | - |
| `get_journal` | either | A chronological record of everything in a date range: trades, deposits and withdrawals, rewards, rebates, funding, DeFi interactions and fees, each with timestamp, amount, asset, venue and realized PnL. 50 per page, newest first. | `from`, `to` (ISO dates, `to` inclusive), `kinds` (comma-separated subset of `trade,transfer_in,transfer_out,reward,rebate,funding,protocol_interaction,fee`), `page` |
| `get_trades` | either | Orders and fills, newest first: market, side, type, size, average fill price, fees, execution time, fill count. Account scope takes a status filter; portfolio scope is filled orders only. | `status` (account only: `closed` default, `open`, `canceled`, `rejected`, `partially_filled`, `abandoned`, `scheduled`), `page`, `size` (max 12) |
| `get_transfers` | either | Deposits and withdrawals, newest first, paged. For sums or filters prefer `run_aggregation` on `transfers`. | `page`, `size` (default 50) |

## Market data

No user scope.

| Tool | What it returns | Parameters |
| - | - | - |
| `get_fx_rates` | Current fiat FX rates relative to USD. | |
| `get_ticker` | Spot price for one pair on one exchange. | `market` (required, e.g. `BTC/USDT`), `exchange` (required, e.g. `binance`) |
| `get_tickers` | Price, 24h change, market cap and volume for up to 15 coins in one call. | `coin_ids` (required, comma-separated CoinGecko ids like `bitcoin,ethereum`), `vs_currency` |
| `get_price_history` | Daily price history for one coin. | `coin_id` (required, CoinGecko id), `vs_currency`, `days` (default 365) |
| `list_markets` | Which spot markets an exchange lists, optionally filtered. | `exchange` (required, ccxt id), `filter` (substring), `limit` (default 100) |
| `get_stablecoin_grades` | Bluechip safety grades for stablecoins, with issuer. | `symbol` (omit for all) |

## Custom queries

| Tool | What it does | Parameters |
| - | - | - |
| `run_aggregation` | Runs a read-only MongoDB aggregation pipeline over your own data for anything the fixed tools do not cover: custom groupings, sums, filters, time buckets. The server adds the tenant filter itself; do not add one. | `collection` (required: `ledgers`, `transfers`, `meta_positions`, `meta_orders`, `meta_trades`), `pipeline` (required, array of stages) |

Allowed stages: `$match`, `$group`, `$sort`, `$project`, `$limit`, `$skip`, `$unwind`, `$addFields`, `$count`, `$bucket`, `$facet`, `$sample`. The `ledgers` collection holds one document per account with `nav_raw`, `gross_nav`, `total_pnl_realized`, `total_pnl_unrealized`, `total_fees` and `exchange_account_id`.

```json theme={null}
{
  "collection": "ledgers",
  "pipeline": [{ "$group": { "_id": null, "total_nav": { "$sum": "$nav_raw" } } }]
}
```

## Internet

| Tool | What it does | Parameters |
| - | - | - |
| `web_search` | A short sourced answer from the public internet, for things outside your data: a protocol's mechanics, a token's news, what a vault does. | `query` (required) |
| `fetch_url` | The readable text of one public web page. | `url` (required, http or https) |

Neither tool is for your own balances, NAV, PnL or positions. Only the portfolio tools answer those correctly, and your figures should not go into a search query.

## Alerts

Alerts run server-side, 24/7, on your own data. They notify in the chat that created them: a web alert reaches the bell in the terminal, a Telegram alert goes back to that chat. Alerts created over MCP use the `in_app` channel by default and show up in the terminal's bell.

| Tool | Access | What it does | Parameters |
| - | - | - | - |
| `create_alert` | **write** | Creates a rule. See the three kinds below. | `kind`, `scope`, `scope_id` (all required), `scope_name`, kind-specific fields, `cooldown_minutes` (default 60), `channel` (`in_app` default, `email`) |
| `list_alerts` | read | Your active rules, id plus a plain-language description. | |
| `preview_alert` | read | Renders a scheduled report now, exactly as the next send will look. | `alert_id` (required) |
| `update_alert` | **write** | Changes a scheduled report in place: fields, currency, time, days, timezone, once. Threshold and transfer rules cannot be updated; delete and recreate those. | `alert_id` (required), then any of the digest fields |
| `delete_alert` | **write** | Deletes one rule. | `alert_id` (required) |

### Threshold

Fires when a metric on an account or portfolio goes `ABOVE` or `BELOW` a number, once per crossing. It re-arms when the condition clears, and `cooldown_minutes` suppresses a quick re-crossing.

Parameters: `kind: "threshold"`, `metric`, `operator`, `threshold`, `asset` (for `asset_balance`).

| Metric | Unit | Notes |
| - | - | - |
| `nav`, `pnl_total`, `unrealized_pnl` | USD, PnL signed | |
| `drawdown` | fraction, negative | "drawdown over 10%" is `BELOW -0.10` |
| `volatility` | fraction | "vol above 5%" is `ABOVE 0.05` |
| `asset_balance` | units of `asset` | |
| `recon_stale_hours` | hours since last reconcile | `ABOVE`, around 6 for CEX and 24 on-chain. The best answer to "tell me if reconciliation breaks". |
| `recon_error_count` | count | `ABOVE 0` |
| `unreconciled_token_count` | count | `ABOVE 0`, exchange account only |
| `health_factor_min` | ratio | Riskiest on-chain lending position. 1.0 is liquidation; `BELOW 1.05` to `1.2` as an early warning. On-chain lending only. |
| `lp_out_of_range_count` | count | Out-of-range Uniswap v3 LPs, `ABOVE 0`, portfolio only |
| `recon_trust_score_min` | 0 to 1 | Data quality of the worst EVM account, `BELOW 0.8`, portfolio only |
| `position_unit_price` | USD per unit of `asset` | Only for vault or receipt tokens Renesis prices itself (Enzyme, MetaMorpho). Not for market-priced assets. |

### Transfer

Fires when a deposit or withdrawal lands on an exchange account, optionally for one asset.

Parameters: `kind: "transfer"`, `scope: "exchange_account"`, `direction` (`deposit` default, `withdrawal`), `asset`.

### Digest

Sends the current values of chosen fields on a clock, rather than when something crosses a value.

Parameters: `kind: "digest"`, `fields` (default `["nav"]`; also `pnl_total`, `unrealized_pnl`, `drawdown`, `volatility`), `currency` (a second column converted from USD: `EUR`, `CHF`, `JPY`, `BTC`, `ETH`), `style` (`date` ymd, dmy or mdy; `clock` 24h or 12h; `money` code or symbol).

Timing, pick one:

| Want | Pass |
| - | - |
| Once, in N minutes | `in_minutes: N` |
| Once, at a time | `at: "HH:MM"`, `tz`, `once: true` |
| Every day at a time | `at: "HH:MM"`, `tz` |
| Some weekdays at a time | `at`, `tz`, `days` (0 = Monday to 6 = Sunday) |
| Round the clock | `every_minutes: N` |

`at` is local wall-clock time in `tz`, an IANA zone like `Europe/Vienna`. It survives daylight-saving changes. Default `UTC`.

<Note>
  Over MCP, digests report the standard `fields`. The saved-layout and watch recipes that the terminal and Telegram chats support need a chat with a connected identity and are not available from an MCP client.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.