Skip to main content

Tokenized collateral and USDC as margin

What it is

Taking tokenized collateral and USDC as margin means accepting tokenized fund units, such as money market fund tokens, and stablecoins that clients post against their positions, then valuing them and calling for more when they fall short; the wider job is collateral monitoring.

Prime brokers, futures commission merchants (FCMs) and exchanges that accept it need balances that stay current around the clock, because collateral in a wallet can move overnight and at weekends as well as in market hours.

Goldsky keeps the latest balance of every margin wallet in your database as collateral moves, while the fund’s NAV, the haircuts, the valuation and the margin call stay with your fund administrator and your margin system.

You can build it two ways: keep every margin wallet’s balance current in your database with Turbo Pipelines, or run a scheduled Compose task that reads balances from the Feeds API and checks them against your margin rule.

Who it’s for

Prime brokers, futures commission merchants, crypto exchanges and clearing members that accept tokenized funds or stablecoins as margin.

How posted tokenized collateral is valued for margin

The diagram follows collateral from the margin wallets you watch to the margin call on a shortfall, with the fund NAV feeding the valuation, and shows who does each step. Your setup may differ.

Your business, step 2: Wallet or custody providerPost collateralFund tokens or stablecoins move in
Goldsky, step 1: TurboWatch margin walletsEach client’s wallets, editable without a redeploy
Your business, step 4: Fund administratorStrike the fund NAVYour fund administrator values each unit
Goldsky, step 3: TurboKeep balances currentLatest balance per wallet, in your database
Your business, step 5: Value the collateralNAV and haircuts applied by your margin system
Your business, step 6: Make the margin callShortfalls go back to the client
  • Goldsky
  • Your provider

Ways to track tokenized collateral and USDC margin

The pipeline rewrites a wallet’s balance row each time collateral moves and leaves valuation to your margin system; the scheduled task reads every wallet on a timer and works out shortfalls in its own code.

Best for
Many margin wallets, valued by your margin system
Products
Turbo
What you run
The destination: your database, queue or bucket, or a Postgres database Goldsky hosts
What you write
Pipeline YAML and SQL; TypeScript transforms when needed
Where your data lives
In your own database or systems
How results reach you
Pushed to you
Best for
A few margin wallets, checked on a timer
Products
ComposeFeeds
What you run
Nothing on Goldsky cloud; single-tenant, VPC and on-premises deployments are enterprise options
What you write
TypeScript tasks
Where your data lives
Hosted by Goldsky
How results reach you
Acts onchain or calls your systems

Option 1: Track tokenized collateral and USDC margin by streaming balances to your database

Goldsky runs a pipeline that watches your clients’ margin wallets and, whenever one moves, reads its new balance of each collateral token and writes it to your database. Your margin system values those balances and calls any shortfall.

When to stream collateral balances to your database

Many clients post collateral to wallets that change often, and your margin system already values positions from a database you run.

What you’ll need

  • Goldsky Turbo
  • A custody provider holding the margin wallets
  • The NAV per unit of each fund token, from its fund administrator
  • A database for the watch list and balances
  • Your margin system, with its haircuts and margin rules
  1. Watch the margin wallets

    Handled by Goldsky Turbo

    You can only track collateral in wallets you know about, so every client’s margin wallet goes on a list.

    Add a wallet when a client is onboarded and remove it when the account closes, without stopping anything. A wallet missing from the list means collateral posted to it never reaches your margin checks.

    With Goldsky, the list can be a Turbo Pipelines dynamic table, which lives in a Postgres database: insert or delete a row and the running pipeline picks it up.

    Learn about dynamic tables (opens in a new tab)
  2. Post collateral

    Clients meet margin by moving fund tokens or stablecoins into the margin wallet held for them.

    Your custody provider holds the wallet under your agreement with the client. Collateral can arrive or leave overnight and at weekends as well as in market hours, so checks that run only in the working day miss moves.

  3. Keep each balance current

    Handled by Goldsky Turbo

    Margin is checked against what each wallet holds now, so the balance has to update every time collateral moves.

    Each time a watched wallet sends or receives a collateral token, its new balance of that token is read at that block and replaces the old one. Adding up transfers yourself drifts if one is missed; reading the balance itself doesn’t.

    A Turbo Pipelines SQL transform can keep transfers that touch a watched wallet, read the wallet’s balanceOf at the transfer’s block with _gs_eth_call, and upsert one row per wallet and token, with reorg corrections applied to the same rows.

    Read contract state with SQL functions (opens in a new tab)
  4. Strike the fund NAV

    A fund token is worth the fund’s net asset value (NAV) per unit, which the fund administrator publishes.

    Take the NAV per unit for each fund token you accept. A stale NAV overvalues collateral after the fund falls, so your rules should say how old a NAV can be before it’s treated as missing.

  5. Value the collateral

    Balances become collateral value once each is multiplied by its NAV or price and cut by a haircut.

    Multiply each balance by its NAV per unit, or by your rule for stablecoins, apply the haircut for that asset and compare the total with the client’s margin requirement. Your margin system does this with the same rules it uses for the client’s other collateral.

  6. Make the margin call

    A client whose collateral falls short of the requirement has to post more or reduce positions.

    Your margin system issues the call under the client agreement and tracks it until it’s met. A new NAV can cause a shortfall without any wallet moving, so the valuation has to rerun when a NAV arrives as well as when balances change.

What to know about streaming collateral balances

  • A balance updates when its wallet moves, so a shortfall caused by a new NAV shows up when your margin system revalues.
  • Adding or removing a client’s wallet is a row in the watch list, with no redeploy.
  • Each row is replaced on the wallet’s next move and corrected after a reorg, so the table holds the latest balance per wallet and token.
  • Valuation and the margin call stay in your margin system.

Option 2: Track tokenized collateral and USDC margin with a scheduled balance check

A TypeScript task that Goldsky hosts runs on a timer. It reads each margin wallet’s balances from the Feeds API, fetches the fund NAV and your margin requirements, works out any shortfall and alerts your team.

When to check margin balances on a schedule

You hold a modest number of collateral wallets and want one scheduled check that values them and raises shortfalls, without keeping balances in a database.

What you’ll need

  • Goldsky Compose
  • Goldsky Feeds
  • A custody provider holding the margin wallets
  • The NAV per unit of each fund token, from its fund administrator, over an API
  • Your margin requirements and haircuts, over an API
  • An alerting endpoint your margin team watches
  1. Post collateral

    Clients meet margin by moving fund tokens or stablecoins into the margin wallet held for them.

    Your custody provider holds the wallet under your agreement with the client. Collateral can arrive or leave overnight and at weekends as well as in market hours, so checks that run only in the working day miss moves.

  2. Run the check on a schedule

    Handled by Goldsky Compose

    A timer makes sure every wallet is checked even when nothing moves.

    Choose an interval that fits how fast your clients’ positions and the NAV change. A long interval leaves a shortfall unseen for longer.

    Goldsky Compose runs the task on a cron trigger, and every call it makes, from the balance reads to the alert, is logged with the run.

    Set up cron triggers (opens in a new tab)
  3. Read each wallet’s balances

    Handled by Goldsky Feeds

    The check starts from what each margin wallet holds now.

    Each wallet’s balance of every collateral token has to come back, including tokens with no market price. If fund tokens drop out, the client’s collateral looks smaller than it is.

    The Feeds balances endpoint returns a wallet’s latest native and ERC-20 balances across chains. Set include_unknown_price=true so fund tokens without a market price still come back.

    Read the balances endpoint reference (opens in a new tab)
  4. Fetch the NAV and margin requirements

    Handled by Goldsky Compose

    Balances only become collateral value once the fund’s NAV and your haircuts are applied.

    The task needs the latest NAV per fund token from your administrator, and each client’s requirement and haircuts from your margin system. If either source is down, the check should fail and say so, so it never values collateral on old numbers.

    With Goldsky, the task calls both sources with fetch, which retries failed reads and records each request and response with the run.

    Make logged HTTP requests (opens in a new tab)
  5. Alert on a shortfall

    Handled by Goldsky Compose

    Someone has to act when a client’s collateral is worth less than their requirement.

    Value each balance, apply the haircut, compare with the requirement and send an alert with the client, the shortfall and the inputs used. An alert without its inputs sends someone back to work it out by hand.

    Compose posts each shortfall to your alerting endpoint, and the run’s log keeps the balances and NAV the decision was based on.

    How Compose logs each call (opens in a new tab)
  6. Make the margin call

    A client whose collateral falls short of the requirement has to post more or reduce positions.

    Your margin system issues the call under the client agreement and tracks it until it’s met. A new NAV can cause a shortfall without any wallet moving, so the valuation has to rerun when a NAV arrives as well as when balances change.

What to know about checking margin on a schedule

  • Balances are as fresh as the last run, so collateral that leaves between runs shows up at the next one.
  • Every run revalues every wallet, so a new NAV is caught on the next run even if no wallet moved.
  • The API returns latest balances only, so past positions come from your own records.
  • Fund tokens often have no market price, so the task values them at the NAV it fetches.

What you control

Your team
  • Value the collateral
  • Make the margin call
Your providers
  • Wallet or custody provider
  • Fund administrator

Questions and answers

What is tokenized collateral?

Tokenized collateral is an asset held as a token on a blockchain, such as a money market fund unit or a stablecoin, that is pledged against a trading position or a loan. Because the token moves between wallets at any hour, it can be posted, topped up or returned outside market hours. The firm taking it still values it by its own rules, usually at the fund’s NAV per unit with a haircut, and calls for more when it falls short.

Security and deployment

  • SOC 2 Type IIIndependently audited security controls.
  • Dedicated infrastructureSingle-tenant options for production workloads.
  • Data residencyCloud, on-premises or co-located.

Track tokenized collateral and USDC posted as margin with Goldsky

We’ll map it to your systems and show you what Goldsky runs, so your team builds the product, not the pipelines underneath it.

© Endless Sky Inc. All rights reserved.

PrivacyTermsSecurity

System status