Treasury and risk

Guides

Treasury, positions and refuel

The treasury operator product of Path Global, exercised in the sandbox — positions and the treasury view, policies, transfers under dual control, expected fundings, the allowlist, reconciliation, inbound items, refuel cycles and ledger reads.

Needs: a test key with treasury. A second test key, of another person, with risk and treasury_approve to decide approvals.

Treasury is an operator product. It acts on the positions of the whole deployment, not on the caller's own objects, and every change that moves value out or loosens a control waits for a second person. This guide exercises it in the sandbox, where the positions, balances and policies are sandbox values. In live mode treasury is available to a key whose agreement includes operator access, and every request carries the signature of a registered operator (Going live).

One double-entry ledger carries every balance. Client funds are held on segregated safeguarding accounts, apart from Path Global's own.

Positions

A position is the balance of one physical account on the ledger, with what is reserved, pending and in transit.

const positions = await pg.treasury.positions({ purpose: 'liquidity', asset: 'USD' });
// GET /treasury/positions?purpose=liquidity&asset=USD

const p = positions[0]!;
console.log(p.account);   // "nostro:-:<physical account>:USD"
console.log(p.balance, p.reserved, p.pending_in, p.pending_out, p.in_transit_to, p.available);
console.log(p.band);      // { min, target, max }, when the account has a policy
console.log(p.status);    // "open", "no_debit", "frozen" or "closed"
Filter
network, asset, partnerAs named
purposesafeguarding, liquidity, settlement, collateral, gas
tierhot, warm, cold

account is the ledger reference of the physical account, nostro:-:<physical account>:<asset>. URL-encode it in a path: GET /treasury/positions/:account.

Read
GET /treasury/viewThe treasury view, per asset and per network, with the journal head { seq, hash } it was read at
GET /treasury/fxThe open position per asset, with its reference value
GET /treasury/safeguardingPer asset: the safeguarding gap and its policy
GET /treasury/accountsThe physical accounts, each shown by its mask

Policies

A physical account has a policy: its band (min, target, max), the bounds of its target, the buffer kept, whether a refuel may convert, the cost a transfer into it may bear, and the minimum level of a pool it draws on. An asset has a safeguard policy.

const policy = await pg.treasury.policy(p.account); // GET /treasury/policies/:account
FieldNotes
band{ min, target, max }, decimal strings
min_ceiling, target_floor, target_ceilingBounds of the computed minimum and target
buffer_bps, max_cost_bps, pool_min_level_bpsBasis points
closure_cover, allow_convertBooleans
daily_charge_allowanceOptional
ruleOptional: the approval rule its refuels go to

PUT /treasury/policies/:account and PUT /treasury/safeguarding/:asset write a policy under an approval policy_change. The first call answers 202 with { approval }. Once a second person approves it, the same request again writes the policy: the approval applies to exactly that content, on the version it replaces. Sent while the approval waits, the request answers 409 pathglobal.risk.approval_pending.

{
  "band": { "min": "<amount>", "target": "<amount>", "max": "<amount>" },
  "min_ceiling": "<amount>",
  "target_floor": "<amount>",
  "target_ceiling": "<amount>",
  "buffer_bps": "<bps>",
  "closure_cover": true,
  "allow_convert": false,
  "max_cost_bps": "<bps>",
  "pool_min_level_bps": "<bps>"
}

The <bps> fields are numbers.

Transfers

A transfer moves value from a position to another own position, or out to an allowlisted destination.

type is rebalance, refuel, sweep, funding, defunding, conversion, fees or gas. funding and defunding name an allowlist entry as their outside end.

const [from, to] = (await pg.treasury.positions({ purpose: 'liquidity', asset: 'USD' }))
  .filter((p) => p.tier === 'hot' && p.status === 'open');

const transfer = await pg.treasury.proposeTransfer({
  type: 'rebalance',
  from: from!.account,
  to: to!.account,
  amount: { value: '25000.00', asset: 'USD' },
  reason: 'rebalance before cut-off',
});
console.log(transfer.state);    // "pending_approval"
console.log(transfer.approval); // "apr_…"

POST /treasury/transfers answers 202 with the transfer, which names the approval it waits for (treasury_transfer). A second person approves it, and the transfer then executes with no further call:

const checker = new PathGlobal({ apiKey: checkerTestKey }); // another person's key
await checker.risk.approve(transfer.approval!); // POST /risk/approvals/:id/approve
proposed → pending_approval → approved | scheduled → executing → in_transit → settled
                                                    ↘ in_doubt → blocked → settled | failed
and rejected, cancelled, failed
state
pending_approvalWaits for its approval
approved, scheduledApproved, waiting to be ordered
executing, in_transitOrdered; the value is on its way
in_doubt, blockedThe arrival is not observed; a blocked transfer waits for a decision
settledArrived
rejected, cancelled, failedEnded without arriving

POST /treasury/transfers/:id/cancel cancels a transfer that has not left. POST /treasury/transfers/:id/resolve ends a blocked transfer: it needs treasury_approve and an approval instruction_resolve, with { approval, resolution }, where resolution is { decision: "arrived" | "returned", rail_reference } or { decision: "written_off" }.

ErrorWhen
403 pathglobal.treasury.destination_not_allowedThe destination is not on the allowlist
422 pathglobal.treasury.out_of_policyThe transfer is outside the policy of an account
409 pathglobal.ledger.account_frozenAn account is frozen or closed

A treasury transfer under dual control runs the whole flow, with its variants.

Expected fundings

A funding that arrives from outside is declared first, so that its credit is recognised:

const funding = await pg.treasury.expectFunding({
  account: '<physical account>',
  amount: { value: '<amount>', asset: 'USD' },
  reference: 'wire-2026-11-19-01',
  credit_to: { house: true },
});

credit_to is { house: true }, { pool, owner } or { collateral }. The declaration is made under an approval funding_expect, as a policy is: 202 with { approval }, then the same request once it is approved. A reference already declared answers 409 pathglobal.core.reference_taken. A funding is expected, matched, expired or cancelled (GET /treasury/fundings).

The allowlist

Value leaves only to a destination on the allowlist: an own ledger account, or an external account named by { network, identifier, holder? }.

const { approval, entry } = await pg.treasury.allow({ network: 'sepa-inst', identifier: 'DE89370400440532013000', holder: 'Example Treasury Ltd' });

POST /treasury/allowlist answers 202 with { approval } (allowlist_add); the same request once it is approved answers { approval, entry }. An external entry is shown by its mask, and it counts from its not_before. GET /treasury/allowlist lists the entries. In the sandbox every own account is on the allowlist.

Reconciliation

A reconciliation compares the ledger of a physical account with its statement.

Route
POST /treasury/reconciliations/runReconciles one physical account ({ account }), or all of them
GET /treasury/reconciliationsBy account and state
POST /treasury/reconciliations/:id/resolveResolves a break, with { approval }: needs treasury_approve and an approval break_resolve

state is matched, break or resolved. A break is resolved by a person under an approval.

Inbound items

An inbound item is a credit that no expected funding and no instruction claims. It is unmatched, claimed, returning, returned or escalated.

Route
GET /treasury/inboundThe items
POST /treasury/inbound/:id/returnReturns the credit to its sender
POST /treasury/inbound/:id/escalateNeeds treasury_approve, with { approval }

A deposit to a client's endpoint is credited to its holding through the endpoint, not through this route: see Credit a deposit to its holder.

Refuel cycles

A refuel cycle brings positions back within their bands. A cycle is named rf_YYYYMMDD, or rf_YYYYMMDD_nn for a further cycle of the day.

const current = await pg.treasury.currentRefuelCycle(); // GET /treasury/refuel/cycles/current
const report = await pg.treasury.refuelReport(current.id); // once the cycle has ended
state
openWaits for the cut-offs of its networks
cut, reconciledMeasured, then reconciled
planned, executingIts transfers are planned, then running
settled, partially_settledEnded; what was short is in shortfalls and carried

The signed report of an ended cycle gives each position before and after, the transfers, their costs, the breaks, and the journal head { seq, hash }. GET /treasury/refuel/cycles lists the cycles, the latest first.

Ledger reads

Route
GET /treasury/ledger/accounts/:idOne account of the ledger, by its reference, URL-encoded
GET /treasury/ledger/entriesEntries by account, reference, rail_reference or instruction (one is required), 200 at a time; after_seq reads on
GET /treasury/ledger/headThe sealed head of the journal: { seq, hash }

An entry is a set of lines that sum to zero per asset. A line never changes; a correction is a new entry. The signed reports of Path Global carry the journal head they were made at.

Fund and defund a position (test mode)

POST /treasury/positions/:account/fund and /defund, with { amount, reference? }, add value to a position or take it out, against the sandbox. The same reference funds once.

await pg.treasury.fund(p.account, { value: '100000.00', asset: 'USD' }, 'topup-1');
await pg.treasury.defund(p.account, { value: '5000.00', asset: 'USD' }, 'drain-1');

On a live key both routes answer 404 pathglobal.core.not_found.

On this page