The Programming Language of the Fabric
AmiScript
One coherent model for working across data, logic, workflows and presentation, inside the same runtime.
Function inside the fabric
One language across data, logic and presentation
AmiScript is the native programming language of the Application Fabric. Rather than using one language to query data, another to implement business rules and a third to format the result for an application, developers can express these concerns within the same runtime.
The language combines familiar concepts from Java, Python, SQL and string templates, while adding functions and data types intended for financial systems. It can query governed data, process real-time events, perform domain-specific calculations, generate formatted output and invoke application behavior.
Because the language operates throughout the fabric, logic does not need to be rewritten as it moves between layers. A calculation can begin in the data model, be reused within a workflow and appear directly in a user interface or report. The same logic can also be called by an external application or an AI agent through an authorized interface.
Capabilities
The language at work
Defining structured data using Python-style syntax
AmiScript adopts Python-inspired syntax for defining maps, lists and nested structures. Market data snapshots, pricing ladders, risk buckets and configuration objects can be represented directly in the script, without verbose class definitions or external schemas.
Because these structures are first-class citizens in the language, they can be passed directly into calculations, visual components or persistence layers without transformation. The same structure can feed pricing logic, populate a table or drive a chart.
Map pricingSummary = {
"ZXZZT": {
"Open": 489.10,
"prices": [492.10, 492.10]
}
};
Encapsulating reusable business logic as functions
Functions are strongly typed, can be overloaded, and are defined once then reused across scripts, queries, models and visuals. Concepts such as notional value, exposure, margin or PnL must be calculated identically across risk, trading, reporting and compliance workflows, and centralizing them as named functions avoids duplicated or slightly diverging logic across teams.
Because the language executes within the platform's governed runtime, these functions are also observable, auditable and subject to the same controls as the rest of the system.
double NOTIONAL_VALUE(
Number quantity,
Number price,
Number fx
) {
quantity * price * fx
};
Accessing data using SQL-like execution
AmiScript integrates tightly with AMI SQL for direct, governed access to live and historical data sources. Parameterized queries run against named data sources using familiar SQL constructs, while remaining fully inside the platform's entitlement, auditing and lineage framework.
Here a table is created dynamically from the current user context: the placeholder is resolved at runtime, so the same script adapts to different users or sessions without hard-coding identifiers.
create table mycopy AS use DS="ACCOUNT_DATA" execute
Select * from Accounts
where Account=="${USERACCOUNT}";
Computing and formatting results for presentation
A previously defined business function is reused inside an aggregate query, and the computed result is injected into a formatted message using built-in templating. Computed values can be embedded directly into tables, charts, tooltips, dashboards and reports.
Formatting logic lives alongside computation, so what users see is derived from governed, traceable logic rather than post-processed in a separate UI layer.
double totalNotional =
select sum(NOTIONAL_VALUE(
qty, px, fxrate))
from mycopy;
Session.alert(
"Total value for account ${USERACCOUNT}
is ${totalNotional}"
);
Over 1,500 functions organized by libraries
The built-in library is organized into domain-specific modules covering data access, aggregation, time-series analysis, financial calculations, formatting, entitlements, session control and system interaction, so common primitives do not have to be re-implemented. Each entry links to its reference documentation.
clrGetAlpha(color)Generating risk heatmap color scales by PnL magnitude or exposure leveldatePart(unixEpochMillis, part, timezone)Settlement date calculations and market-hours filtering across time zonesdecodeDouble64(value)Decoding binary price fields from low-latency tick and FIX protocol feedsjsonExtract(json, xpath)Extracting fields from pricing API responses and reference data payloadslogWarn(message)Audit-trail logging for compliance-sensitive workflow steps and threshold breachesparseXlsx(data, firstLineIsHeader)Ingesting trade blotters, fund NAV reports, and static data files from ExcelroundNearest(value, bucketSize)Snapping prices to minimum tick sizes and quantities to lot size constraintssignDataMac(data, key, algorithm)Signing outbound order messages and authenticating exchange API requestsstrAfter(text, toFind, origIfNotFound)Parsing instrument codes, extracting ISIN or ticker from composite identifiersurlDecode(url)Constructing and decoding REST calls to market data and reference data APIsavgGauss(value, variance)Weighted average pricing, VWAP, and noise-smoothed position aggregationbeta(value1, value2)Portfolio beta vs benchmark, factor sensitivity, and hedging ratio calculationcatUniqueLimit(value, delim, limit)Aggregating unique counterparty or venue lists per trade or order bucketpercentileDisc(value, percent)Value at Risk at defined confidence intervals across a position populationkmeansCluster(nClusters, seed, values)Segmenting portfolios by risk profile, sector exposure, or client behaviorresample(x, y, xq, linearOrSpline)Normalizing tick data to uniform OHLC bars for charting and backtestingAI in the language
Calling AI from AmiScript
A model call is a function call. session.promptAi hands an instruction and a slice of live data to the institution's configured provider, from inside the callback, timer or trigger that produced the data, and returns the answer as a string. Classify rows, summarize a filtered result set, or extract structured fields without leaving the logic that built them.
It is a single, blocking completion rather than a conversation: one instruction, one answer, no tools and no agentic loop. The credential never appears in the script. The provider and its key are resolved server-side from the deployment's own configuration, and every call is written to the audit log alongside chatbot activity, so scripted AI is governed by the same controls and visible in the same place.
When AI is switched off or a provider cannot be reached, the call returns null rather than failing the script, so an application keeps working whether or not AI is available.
// 'alerts' is a table or result available in this scope
Map options = {"system": "You are a trading-risk analyst. Be concise.", "max_tokens": 500};
List data = [alerts];
String summary = session.promptAi("anthropic", "claude-opus-4-8", options, data,
"Summarize the top risks in the attached alert rows in three bullet points.");
if (summary != null) {
session.log(summary);
}
Where it matters
Development in existing IDEs
Developers write AmiScript where they already work, alongside the source code, repositories, testing tools and review processes their teams use, rather than in a separate environment.
- In the editor: the VS Code extension brings completion, diagnostics and step-debugging, backed by the platform's own parser
- In the AI coding tool: the 3forge Plugin gives Claude Code, Codex and GitHub Copilot the skills and agents to write, review and debug AmiScript
- Grounded in the live deployment: through the MCP server, both see the schemas, procedures and runtime objects actually deployed
- One governed interface: the same tools and permissions apply whether a change is written by hand or suggested by an assistant, and every call is authenticated and audited
Keep reading
AmiScript runs inside the fabric. Python reaches it from outside.
A programmatic interface for research, automation and production services.