Funding Channel

Real-time funding payment notifications when funding settles on your positions.

Channel: funding
Authentication: Required

Overview

Funding is settled on your position whenever a trade touches the market — yours or anyone else's. This channel notifies you the moment a settlement happens, so you do not have to poll the REST API.

Subscribe

{
  "method": "subscribe",
  "params": {
    "channel": "funding",
    "market_ids": [1, 2]
  }
}
ParameterTypeRequiredDescription
market_idsnumber[]NoFilter by market IDs. Empty = all markets
makersstring[]NoAccount filter. Omit it — an authenticated client is scoped to its own account

Message Format

Update

Sent when a funding payment is settled on your position. There is no snapshot — funding payments are events, not state. Use the REST API for history.

{
  "channel": "funding",
  "type": "update",
  "market_id": "1",
  "data": {
    "account": "0x793C87ED0186EcA29D0De98cF5c93e02fEBb8246",
    "funding_payment": "-0.035893853717451273",
    "position_size": "-0.005953",
    "last_checkpoint": "-1162.288328274703627205",
    "new_checkpoint": "-1156.258787922368456104"
  },
  "block_number": 19328394,
  "log_index": 9,
  "tx_hash": "0xfb04187ea6c5f7833140f55d94ce05a94657618d8b8ec724172bc0ce6148f4d8",
  "worker_timestamp": "1786934151079017180"
}

Update Message Fields

FieldTypeDescription
channelstringAlways "funding"
typestringAlways "update"
market_idstringMarket ID
dataobjectFunding payment details
block_numbernumberBlockchain block number
log_indexnumberLog index within the block
tx_hashstringTransaction hash
worker_timestampstringServer time in nanoseconds

There is no timestamp or block_timestamp field on this channel.

Funding Payment Data Fields

FieldTypeDescription
accountstringAccount address
funding_paymentstringAmount settled, decimal USDC. See sign convention below
position_sizestringSigned position size at settlement, decimal (negative on a short)
last_checkpointstringPosition's previous accumulated-funding checkpoint, decimal
new_checkpointstringMarket's accumulated-funding checkpoint at settlement, decimal
🚧

Every value on this channel is decimal, not wei

"-0.035893853717451273" is 0.0359 USDC received, not 3.6 × 10-20. Dividing by 1018 — as an earlier revision of this page instructed — is wrong.

Sign Convention

SignMeaning
positiveYou paid funding (deducted from balance)
negativeYou received funding (added to balance)

Example: Paying Funding

Long position while the funding rate is positive (longs pay shorts):

{
  "funding_payment": "5.012345678901234567",
  "position_size": "10.5"
}

You paid 5.0123 USDC.

Example: Receiving Funding

Short position while the funding rate is positive:

{
  "funding_payment": "-0.035893853717451273",
  "position_size": "-0.005953"
}

You received 0.0359 USDC.

Funding Calculation

funding_payment = (new_checkpoint - last_checkpoint) * position_size

All three inputs are already decimal, so no scaling is involved. Using the example above: (-1156.258787922368456104 − (−1162.288328274703627205)) × (−0.005953) = −0.03589…

When Funding Settles

Funding is calculated and broadcast when:

  1. You execute a trade (open, close, or modify a position)
  2. Someone else trades in the same market

The amount covers the period your position was held since its last checkpoint.

Examples

Subscribe to all funding payments

{
  "method": "subscribe",
  "params": {
    "channel": "funding"
  }
}

Subscribe to specific markets

{
  "method": "subscribe",
  "params": {
    "channel": "funding",
    "market_ids": [1, 2]
  }
}

Unsubscribe

{
  "method": "unsubscribe",
  "params": {
    "channel": "funding"
  }
}

Authentication

Authenticate before subscribing. The channel is meant to carry your own settlements only.

Related Channels

  • Positions — position state, including unsettled_funding accrued since the last checkpoint
  • Fills — the trades that trigger these settlements