## Documentation Index Fetch the complete documentation index at: https://docs.relay.link/llms.txt Use this file to discover all available pages before exploring further.
## Agent Instructions To quote bridges and swaps, look up chains and tokens, or track Relay transactions from an agent, use the Relay MCP server: npx -y @relayprotocol/relay-mcp. It is read-only and does not sign or broadcast transactions. Setup: https://docs.relay.link/resources/developing-with-ai.md For Relay Protocol's trust model, security architecture, and audits, see https://docs.relay.link/references/protocol/security.md. For address screening, see https://docs.relay.link/security/transaction-screening.md.Get Balance Events
This API returns the history of balance movements for a wallet, including fee credits, fee sponsorship, fixed-rate settlement, deposits and withdrawals.
[!NOTE] An API key is required. A wallet linked to your integrator returns its whole ledger, including balanceAfter; any other wallet returns the events your integrator caused on it, plus deposits and settled withdrawals — a narrower result, not an error. For current balances rather than history, use Get App Fee Balances.OpenAPI
openapi: 3.0.3
info:
title: Cross-chain solver
version: 1.0.0
servers:
- url: https://api.relay.link
description: Mainnet API
- url: https://api.testnets.relay.link
description: Testnet API
security: []
paths:
/balance/{wallet}/events:
get:
tags:
- Balances
description: >-
Balance movements for one wallet: fee sponsorship, fixed-rate
settlement, fee credits, deposits and withdrawals. A wallet linked to
your integrator returns its full ledger with running balances; any other
wallet returns the events your integrator caused on it, plus deposits
and settled withdrawals, which are public on-chain. For current balances
rather than history, use /app-fees/:wallet/balances.
parameters:
- schema:
type: string
in: query
name: requestId
required: false
description: Return only events belonging to this request.
- schema:
type: string
in: query
name: requestIds
required: false
description: >-
Comma-separated request ids, at most 20 per call. Use a type and
time range instead for a reconciliation sweep.
- schema:
type: string
in: query
name: type
required: false
description: >-
Comma-separated event types to filter by. Events matching any of the
given types are returned. Omit for all. Supported values:
fee-credit, fee-sponsorship-payment, fee-sponsorship-refund,
gasless-refund, balance-withdraw, balance-deposit,
gas-sponsorship-payment, fixed-rate-credit, fixed-rate-debit,
fixed-bps-pnl, fast-fill-hold, fast-fill-release,
admin-manual-adjustment.
- schema:
type: number
nullable: true
in: query
name: chainId
required: false
description: Restrict to one chain.
- schema:
type: string
nullable: true
in: query
name: currency
required: false
description: >-
Restrict to one currency. Pair with `chainId` for non-EVM
currencies.
- schema:
type: number
nullable: true
in: query
name: startTimestamp
required: false
description: Only events created at or after this unix timestamp, in seconds.
- schema:
type: number
nullable: true
in: query
name: endTimestamp
required: false
description: Only events created at or before this unix timestamp, in seconds.
- schema:
type: number
nullable: true
minimum: 1
maximum: 50
default: 20
in: query
name: limit
required: false
description: Maximum number of events to return per page.
- schema:
type: string
nullable: true
in: query
name: continuation
required: false
description: >-
Pagination cursor returned by a previous response. Pass it back to
fetch the next page.
- schema:
type: string
in: path
name: wallet
required: true
description: >-
Wallet address. A wallet linked to your integrator returns its full
ledger; any other returns the events your integrator caused on it,
plus deposits and settled withdrawals, which are public on-chain.
- schema:
type: string
in: header
name: x-api-key
required: false
description: API key. Required.
responses:
'200':
description: Default Response
content:
application/json:
schema:
type: object
properties:
wallet:
type: string
events:
type: array
items:
type: object
properties:
id:
type: string
description: Event identifier. Also the pagination cursor value.
type:
type: string
enum:
- fee-credit
- fee-sponsorship-payment
- fee-sponsorship-refund
- gasless-refund
- balance-withdraw
- balance-deposit
- gas-sponsorship-payment
- fixed-rate-credit
- fixed-rate-debit
- fixed-bps-pnl
- fast-fill-hold
- fast-fill-release
- admin-manual-adjustment
requestId:
type: string
nullable: true
description: >-
The request this event belongs to. Null for events
that are not request-scoped, such as deposits and
withdrawals.
wallet:
type: string
delta:
type: object
properties:
currency:
type: object
properties:
chainId:
type: number
address:
type: string
symbol:
type: string
name:
type: string
decimals:
type: number
metadata:
type: object
properties:
logoURI:
type: string
verified:
type: boolean
isNative:
type: boolean
amount:
type: string
amountFormatted:
type: string
amountUsd:
type: string
description: >-
Signed change to the balance. Negative amounts are
debits.
balanceAfter:
type: object
properties:
currency:
type: object
properties:
chainId:
type: number
address:
type: string
symbol:
type: string
name:
type: string
decimals:
type: number
metadata:
type: object
properties:
logoURI:
type: string
verified:
type: boolean
isNative:
type: boolean
amount:
type: string
amountFormatted:
type: string
amountUsd:
type: string
nullable: true
description: >-
Balance after this event. Returned only for a wallet
linked to your integrator, where the whole ledger is
visible and the running balance reconciles.
details:
type: object
nullable: true
description: >-
Type-specific context. Present only where the event
carries it; absent on rows written before the field
existed.
properties:
claimId:
type: string
nullable: true
description: >-
Withdrawal identifier. Present on
`balance-withdraw` events only.
fixedRate:
type: string
nullable: true
description: >-
The fixed rate the request was quoted at, e.g.
`1:1`.
currencyIn:
type: object
nullable: true
properties:
chainId:
type: number
address:
type: string
currencyOut:
type: object
nullable: true
properties:
chainId:
type: number
address:
type: string
currencyOutAmount:
type: string
nullable: true
marketAmountOut:
type: string
nullable: true
description: >-
What the output would have been at market. The
settled delta is the difference between this and
the amount delivered at the fixed rate.
requestIds:
type: array
nullable: true
items:
type: string
description: >-
Requests covered by an event that spans more
than one, such as a fast-fill write-off.
createdAt:
type: string
continuation:
type: string
nullable: true
'400':
description: Default Response
content:
application/json:
schema:
type: object
properties:
message:
type: string
'401':
description: Default Response
content:
application/json:
schema:
type: object
properties:
message:
type: string
'403':
description: Default Response
content:
application/json:
schema:
type: object
properties:
message:
type: string
This documentation is built and hosted on Mintlify, a developer documentation platform.