Skip to content

feat: add optional referrer to TransferMetadata - #566

Open
nd-roy wants to merge 3 commits into
mainfrom
core-779-expose-referrer-in-transfer-metadata
Open

feat: add optional referrer to TransferMetadata#566
nd-roy wants to merge 3 commits into
mainfrom
core-779-expose-referrer-in-transfer-metadata

Conversation

@nd-roy

@nd-roy nd-roy commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What

Adds an optional referrer to TransferMetadata, so the field can be surfaced in the metadata object returned by /v1/status, /v1/analytics/transfers and /v2/analytics/transfers.

interface TransferMetadata {
  integrator: string;
  referrer?: string;
}

Why

Integrators already pass referrer on /quote and it is persisted on every transfer, but the read endpoints only ever returned integrator. A partner asked for it back on the read side.

referrer is not new public data: it is emitted on-chain in the LiFiTransferStarted event on every transfer, so exposing it in read responses reveals nothing that is not already visible on a block explorer.

Why optional

Two cases can leave it absent, so a required field would be a lie:

  • Solana swap transfers store the zero address rather than a real referrer.
  • Legacy transfer documents predate the field, and the backend builds metadata with lodash.pick, which simply drops missing keys.

Consumer

Backend side is lifinance/lifi-backend#8813.

Note for whoever releases this: the backend catalog currently pins 18.3.0-beta.0, which was published from feat/gasless-quote-surface-types and is not on main. This branch is based on main and deliberately does not carry those commits, so a release that reaches the backend needs to include both.

Linear: https://linear.app/lifi-linear/issue/CORE-779/expose-referrer-in-transfer-metadata-on-status-and-analytics-read

https://claude.ai/code/session_014TsG1HvsSBcd3RkJPZun9j

nd-roy added 3 commits August 18, 2026 13:45
Optional because Solana swap transfers store the zero address and legacy
transfer documents may not carry the field at all.

Claude-Session: https://claude.ai/code/session_014TsG1HvsSBcd3RkJPZun9j
The field is address-shaped only on bridge transfers; generic swaps carry
an opaque integrator-supplied string, and it is absent when the transfer
recorded no referrer.

Claude-Session: https://claude.ai/code/session_014TsG1HvsSBcd3RkJPZun9j
The neighbouring integrator field carries no comment; the doc block was
out of step with the density of the surrounding types.

Claude-Session: https://claude.ai/code/session_014TsG1HvsSBcd3RkJPZun9j
@nd-roy
nd-roy marked this pull request as ready for review August 18, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant