Treasury and risk

Guides

Risk, limits and approvals

The refusals a payment can meet, the risk operator product — corridors, limits, exposures, breakers, identities, cases and the audit log — and the maker-checker flow every loosening change goes through.

Needs: to read the refusals, nothing more than the product you call. For /risk, a test key with risk; to decide an approval, a second test key of another person with risk and the approver scope of the action.

Every payment is admitted by risk before any value moves. Risk is also an operator product: corridors, limits and breakers act on the whole deployment, and every change that loosens a control waits for a second person. In live mode /risk is available to a key whose agreement includes operator access, and every request carries the signature of a registered operator (Going live).

What a payment is refused with

CodeStatusWhen
pathglobal.risk.corridor_closed422No open corridor carries the pair
pathglobal.risk.exposure_exceeded422The amount is outside what one payment or one day of the corridor carries, or a limit is reached
pathglobal.risk.velocity_exceeded429A rate of the client or of the destination is reached
pathglobal.risk.corridor_throttled429The corridor is throttled and its rate is reached
pathglobal.risk.breaker_open503A breaker on the path of the payment is open, or admits only a probe amount
pathglobal.risk.identity_restricted403The identity of the payer is restricted, blocked or not verified
pathglobal.risk.verdict_invalid422The payment carries no valid Proof verdict for its subject
pathglobal.proof.failed422The Proof verdict is fail
pathglobal.proof.review409The Proof verdict is in review
pathglobal.risk.halted503New work is paused. Send it again later

On a route these codes come as the error of the call, or as the failure.code of a route that ends failed (Route a payment). A 429 or a 503 can succeed when sent again later.

Corridors

A corridor carries payments from one asset on a network to another, ASSET@network>ASSET@network, for instance USD@fednow>MXN@spei. It states the bounds of one payment and of a day, a throttle, how pay-ins that can still be recalled are treated, and the fields and Proof checks a payment must carry. Its state is open, throttled or closed.

Route
GET /risk/corridors · /corridors/:idRead
PUT /risk/corridors/:idWrites a corridor, under an approval corridor_open
POST /risk/corridors/:id/closeCloses it at once, { reason? }
POST /risk/corridors/:id/throttle{ throttle: { per_minute, amount_per_hour }, approval?, reason? }: a tighter throttle applies at once, a looser one under corridor_open
POST /risk/corridors/:id/openOpens it, under corridor_open

In the sandbox, a pair with no corridor gets one on first use; it advances pay-ins that can still be recalled up to a limit, so such a payment is bounded_exposure. In live mode, Path Global opens the corridors of a client's pairs on request.

Limits, exposures and breakers

A limit bounds a measure of one subject. Its id is <scope>:<subject>:<measure>[:<window>].

PartValues
scopepartner, network, corridor, asset, issuer, client, participant, provider, system
measureexposure, outflow, count, open_position, unwind, in_doubt, prepaid
windowminute, hour, day, or none

PUT /risk/limits/:id with { limit, approval? }: a lower limit applies at once, a higher one under an approval limit_raise. GET /risk/exposures answers, per limit, the current value, the limit_value and utilisation_bps.

A breaker stops what passes through one subject. Its id is <scope>:<subject>, with scope corridor, partner, network, asset, account, client, provider or system. Its state is closed, half_open or open.

Route
GET /risk/breakersRead
POST /risk/breakers/:id/tripOpens it at once, { cause }
POST /risk/breakers/:id/resetUnder an approval breaker_reset: to half_open with a probe amount first, then to closed

Changes that wait for a second person

A change that loosens a control or moves value out waits for a second person: another credential, and another operator, than the one that asked for it. Tightening applies at once.

  1. The maker sends the change. The API answers 202 with { approval }, state requested.
  2. A checker reads it (GET /risk/approvals/:id) and approves or rejects it.
  3. The change is applied by the call that carries the approval:
    • on /risk, /intelligence and the pool routes of /liquidity, the same call with approval in its body;
    • on /treasury policies, safeguard policies, fundings and the allowlist, the same request sent again;
    • a treasury transfer executes once approved, with no second call.
const limit = { value: '<amount>', asset: 'USD' };

// maker
const first = await pg.risk.setLimit('client:acme:outflow:day', limit);
if (!('approval' in first)) throw new Error('a lower limit applies at once');
// 202 { approval: { id: "apr_…", state: "requested", … } }

// checker, with another person's key
await checker.risk.approve(first.approval.id);

// maker: the same change, carrying the approval
await pg.risk.setLimit('client:acme:outflow:day', limit, first.approval.id);

An approval applies once, to the change it names, at the version of the target it names. It carries action, subject, target_version, maker, checker once decided, and expires_at, and it is signed.

state
requestedWaits for a decision
approvedDecided; the change can be applied once
rejectedDecided against
consumedThe change was applied
expiredPast expires_at without being used
ErrorStatusWhen
pathglobal.risk.self_approval403The checker is the maker's credential or operator
pathglobal.risk.approval_pending409The change is sent again while its approval waits
pathglobal.risk.approval_invalid409The approval is absent, not approved, expired, already used, or for another change
pathglobal.auth.scope_missing403The checker's key lacks the approver scope of the action

GET /risk/approvals lists them by state, action and subject.

Who decides what

The checker's key carries risk and the approver scope of the action.

Approver scopeActions
treasury_approvetreasury_transfer, allowlist_add, policy_change, funding_expect, break_resolve, rule_change, collateral_withdraw, pool_resume
risk_approvecorridor_open, limit_raise, breaker_reset, operator_register, identity_restore, case_decide, bounds_change, instruction_resolve, participant_onboard, cap_raise

The decision in live mode

In live mode the checker also signs the decision. The body of POST /risk/approvals/:id/approve (or /reject) is { "signature": "<128 hex characters>" }: the checker operator's Ed25519 signature over the text of

hex(sha256(canonical({ approval, payload_digest, decision })))

where approval is the id of the approval, payload_digest is read from the approval, decision is approve or reject, and canonical is JSON with sorted keys and no whitespace. The request itself carries the operator headers. In test mode the body is empty.

import { ed25519 } from '@noble/curves/ed25519';
import { sha256 } from '@noble/hashes/sha256';
import { bytesToHex } from '@noble/hashes/utils';
// `canonical` as in the verification example of Route a payment

const a = await checker.risk.approval(id);
const digest = bytesToHex(sha256(new TextEncoder().encode(canonical({ approval: a.id, payload_digest: a.payload_digest, decision: 'approve' }))));
await checker.risk.approve(a.id, bytesToHex(ed25519.sign(new TextEncoder().encode(digest), checkerPrivateKey)));

Rules

A rule decides some treasury transfers within the bounds it states, in place of a person. Rules are read with GET /risk/rules/:id and written with PUT /risk/rules/:id under an approval rule_change.

Operators

GET /risk/operators lists the registered operators: each with its public_key, its scopes and its status. POST /risk/operators registers one under an approval operator_register; POST /risk/operators/:id/revoke revokes one at once.

Identities and cases

An identity is a client, a participant, a supplier, a provider or a partner, with a status: pending, verified, restricted or blocked.

Route
GET /risk/identities/:subjectRead
POST /risk/identities/:subject/restrict · /blockAt once, { reason }
POST /risk/identities/:subject/restoreUnder an approval identity_restore

A case is opened when a payment needs a person, for instance a Proof verdict in review. It is open, assigned or decided. POST /risk/cases/:id/assign takes it; POST /risk/cases/:id/decide with { decision: "pass" | "fail" | "file", approval? } decides it under an approval case_decide. GET /risk/cases lists them by state and subject.

The audit log

GET /risk/audit?from=&to= answers the decisions recorded between two instants: admissions, verdicts used, approvals, cases, identities, limits, corridors, operators and rules, each with its actor, digest and instant. Pages take after and limit.

What intelligence and the MCP server never do

Intelligence reads positions, forecasts and corridors. It only tightens a control or proposes a change: it never loosens a control, approves a change or moves value, and what it proposes goes through the same approvals as a person's change. No tool of the Path Global MCP server approves, halts or resumes, opens, closes or throttles a corridor or a circuit, adds to the allowlist, registers, or changes a limit. Its treasury transfer tool proposes a transfer that waits for a person.

On this page