Skip to main content

submit

Submit your side of a bilateral settlement. If a counterparty has already submitted with the same trade_reference, the system auto-matches and creates a settlement.
const instruction = await client.instructions.submit({
  templateSlug: "dvp-bilateral",
  role: "seller",
  party: {
    externalReference: "KSFI-II-4401",
    name: "Securitize Fund I",
    walletAddress: "0x1234567890abcdef1234567890abcdef12345678",
    chainId: 11155111,
  },
  legs: [{
    instrumentId: "US09311A1007",
    quantity: "12000000",
    direction: "deliver",
  }],
  timeoutAt: new Date(Date.now() + 86400000).toISOString(),
  idempotencyKey: client.generateIdempotencyKey(),
});

console.log(instruction.tradeReference); // "KS-abc12345"
console.log(instruction.status);         // "pending_match" or "matched"
console.log(instruction.settlementId);   // UUID if matched, null if pending

Parameters

FieldTypeRequiredDescription
templateSlugstringYesSettlement template to use
rolestringYesYour role ("seller" or "buyer")
partyInstructionPartyInputYesYour party details
legsInstructionLegInput[]YesWhat you’re delivering
timeoutAtstringYesISO 8601 settlement timeout
idempotencyKeystringYesUnique key for safe retries
tradeReferencestringNoExisting reference to match against
settlementCategorystringNo"repo_open" for repo lifecycle
maturityAtstringNoRepo maturity date
repoRatestringNoRepo interest rate
repaymentAmountstringNoRepo closing leg cash amount

InstructionPartyInput

FieldTypeRequiredDescription
externalReferencestringYesYour internal account or entity ID
walletAddressstringYesOn-chain wallet address (needed for compliance screening)
namestringNoDisplay name for the party
chainIdnumberNoBlockchain network for the wallet

InstructionLegInput

FieldTypeRequiredDescription
instrumentIdstringYesToken address, ISIN, or currency code
quantitystringYesAmount to deliver (string for precision)
direction"deliver" | "receive"YesWhat you’re doing with this instrument
legTypestringNoDefault: "asset_delivery"
chainIdnumberNoBlockchain network for this leg
tokenStandardstringNoe.g., "ERC-20", "ERC-3643"

Return type: InstructionRead

FieldTypeDescription
idstringInstruction UUID
tradeReferencestringTrade reference (generated if not provided)
statusInstructionStatus"pending_match", "matched", "cancelled", "expired"
settlementIdstring | nullSettlement UUID if matched, null if pending
templateSlugstringTemplate used
rolestringThe role you submitted as
partyobjectYour party details
legsobject[]Your leg details
timeoutAtstringSettlement timeout
expiresAtstringWhen this instruction expires if unmatched
createdAtstringCreation timestamp

get

Fetch a single instruction by ID.
const instruction = await client.instructions.get("instruction-uuid");

list

List instructions with optional status filter.
const { items, total } = await client.instructions.list({
  status: "pending_match",
  limit: 20,
  offset: 0,
});

for (const instr of items) {
  console.log(`${instr.tradeReference}: ${instr.status}`);
}

Parameters

FieldTypeDefaultDescription
statusInstructionStatus-Filter by status
limitnumber50Max items per page
offsetnumber0Items to skip

cancel

Cancel a pending instruction. Only works for instructions with pending_match status.
const cancelled = await client.instructions.cancel("instruction-uuid");
console.log(cancelled.status); // "cancelled"

Bilateral matching flow

The first instruction gets pending_match and a trade reference. The second instruction with the same trade reference triggers matching and creates a settlement.