Skip to content
CertadocsGet a sandbox key

Guides

Weekend and intraday locks

FX venues close for the weekend; stablecoin payments do not. A lock can run from 1 hour to 365 days, so it can cover the hours between Friday's close and Monday's open, or a few hours of one trading day.

Mainnet: weekend locks need a 24/7 hedge venue on Arc before mainnet (decision of 2026-12-02). In the sandbox they work today, on Arc testnet.

1. Show the terms, not just the rate

Every quote carries the fee, the deposit and the maturity. Show them, and the counterparty, beside the rate:

// Show the rate only with the fee, deposit, date and counterparty beside it.
const terms = (q: Quote) =>
  `${q.usdcNotional} USDC for ${q.receiveAmount} EURC at ${q.rate} on ${q.maturity}; ` +
  `fee ${q.fee}, deposit ${q.deposit} (minor units); counterparty Certa (testnet). ` +
  `Firm until ${q.expiresAt}.`;

2. Friday's close to Monday's open

From 17:00 UTC on Friday to 08:00 UTC on Monday is 63 hours. Send the length as tenorSeconds, or the date as maturity: one or the other, not both.

// From Friday's close (17:00 UTC) to Monday's open (08:00 UTC): 63 hours. Quoting on the
// Friday, you can send the date instead: maturity: "2026-12-07T08:00:00Z".
const weekend = await certa.quotes.create({
  pair: "USDC/EURC",
  side: "sell_base", // the customer delivers USDC, receives EURC
  usdcNotional: "50000000000", // 50,000 USDC in minor units
  tenorSeconds: 63 * 3600,
  customerId,
});
console.log(terms(weekend));

3. An intraday lock

// The shortest lock: one hour from now.
const intraday = await certa.quotes.create({
  pair: "USDC/EURC",
  side: "sell_base",
  usdcNotional: "10000000000", // 10,000 USDC
  tenorSeconds: 3600,
  customerId,
});
console.log(terms(intraday));

Under 1 hour, or over 365 days, the quote is refused with TENOR_OUT_OF_RANGE, whose message gives the allowed range:

try {
  await certa.quotes.create({
    pair: "USDC/EURC",
    side: "sell_base",
    usdcNotional: "10000000000",
    tenorSeconds: 30 * 60, // 30 minutes: under the minimum
    customerId,
  });
} catch (e) {
  if (!(e instanceof CertaError && e.code === "TENOR_OUT_OF_RANGE")) throw e;
  console.log(e.message); // gives the allowed range
}
LocktenorSeconds
The shortest: 1 hour3600
Friday 17:00 UTC to Monday 08:00 UTC (63 hours)226800
A long weekend (72 hours)259200
The longest: 365 days31536000

4. Lock within 30 seconds

// Lock before the quote expires. "managed" signs with the customer's sandbox wallet; in live
// mode use "unsigned" and send lock.transactions from the customer's wallet.
const lock = await certa.locks.create({ quoteId: weekend.id, execution: "managed" });
const active = await certa.locks.waitFor(lock.id, ["active", "expired"]);
if (active.status === "expired") {
  console.log(
    "The lock's transactions did not land before the quote expired. Nothing was taken: quote again.",
  );
}

A short lock is a lock like any other: the deposit (5%) and fee (0.3%) are taken when it is created, at most $100,000 per lock, and it settles from maturity. Without delivery 48 hours after maturity it defaults, so a lock maturing at 08:00 UTC on Monday can default from 08:00 UTC on Wednesday. Listen for lock.maturing and lock.settled as usual (see Handle webhooks safely).