Mental model
A strategy is a reusable template. It contains an allocation, a schedule, and swap preferences. A portfolio connects one user to a strategy. It has one smart account for each chain. All enrolled portfolios use the allocation and schedule of the strategy. A new strategy version changes their target for the next rebalance. There are two rebalance triggers:- Scheduled: Uses the strategy
frequency. ReadnextDueAtandlastRebalanceAtfrom the portfolioschedule. - Manual:
POST /v2/portfolios/{id}/rebalancestarts one rebalance outside the schedule. A short cooldown applies to each portfolio.
Asset coverage
Strategy allocations and portfolio positions accept each supported CAIP-19 asset. Supported assets include ERC-20 tokens, SPL tokens, and tokenized real-world assets.GET /v2/portfolios/{id}/positions uses one row format for all asset types.
Chain abstraction
The Glider wallet infrastructure routes cross-chain deposits. It also moves assets between supported chains when required. Your client does not need to plan these migrations.Machine-readable specifications
Use these files for coding agents and SDK generators. These files are the source of truth for the API.Base URL
https://staging-api.glider.fi/v2 for integration tests. Contact
[email protected] for a staging API key.
Authentication
Each business route exceptGET /v2/scopes requires an API key. Send the key
in the x-api-key header. The OpenAPI file, interactive reference, and
LLM-friendly reference are public.
HTTP header names are not case-sensitive. The B2B API documentation uses
lowercase for x-api-key.
GET /v2/whoami returns the tenant identity and the assigned scopes. Call
this route first to test the key.
Response envelope
The B2B API uses one response envelope. Tracing identifiers are in the response headers, not in the JSON body.Success
Paginated success
nextCursor is next to data. It is not inside data. Each collection in
data has a named key, such as data.portfolios.
Error
details field is optional. The API omits it when message contains all
applicable information.
Tracing headers
Each response includes these headers:
The B2B API does not put
correlationId, requestId, or timestamp in the
body. Read these values from the headers.
Scopes
Each authenticated route requires one scope. If the key does not have this scope, the API returns403 API_104.
Tiers:
- default: Assigned to each new key.
- standard: Assigned to an integrator on request. Contact
[email protected]to upgrade. - restricted: Requires a commercial agreement.
GET /v2/scopes to read the current scope list. This route does not
require authentication. Call GET /v2/whoami to read the scopes for your key.
Identifiers (CAIP)
All onchain identifiers use CAIP. Thus, the same request format works for each supported chain. Do not send bare hex addresses.
Withdrawal recipients must be chain-bound. The recipient chain must match
each asset chain. One withdrawal can use only one chain.
The recipient can be any address that the owner authorizes. This rule applies
to EVM and Solana. The API rejects a transfer to the source smart account.
See CAIP identifiers for a worked walk-through.
Supported Chains
Each deployment has a configured set of enrollment chains. An EVM chain requires a nonemptyJSON_RPC_URL_<chainId> value. Solana (1399811149)
requires SOLANA_RPC_URL and the applicable tenant entitlement.
Do not use a fixed global chain list. Ask Glider which chains are enabled in
the applicable environment. An unsupported chain returns 400 API_400. The
error.details field identifies the rejected chainIds.
You select portfolio chains during enrollment. An EVM portfolio can add
chains later with the two-stage
chain-activation flow
(POST /v2/portfolios/{portfolioId}/chains/signature +
POST /v2/portfolios/{portfolioId}/chains).
Solana (SVM) enrollment
Thesvm_b2b_api entitlement controls Solana enrollment for each tenant.
Contact [email protected] to enable it. Without it, a Solana enrollment
request returns 403 API_104.
Each enrollment request uses one namespace. Send Solana (1399811149) chain
IDs or EVM chain IDs. Do not send both. Both owner models create a Swig smart
wallet. Its sub-account is the deposit address.
- Solana-rooted (Model B):
ownerAccountIdis asolana:CAIP-10, and the user signs a Solana transaction returned by stage 1. - EVM-rooted (Model A):
ownerAccountIdstayseip155:0:<addr>withchainIds: [1399811149]. The secp256k1 key of the user becomes the Swig root and authorizes the sub-account with a slot-bound signature.
data.authorization instead of data.typedData.
Stage 2 accepts a hex or base58 signature. See
Prepare Withdrawal Authorization → Solana withdrawals.
Monetary Values
The API sends monetary values as decimal strings. This format prevents IEEE 754 precision loss.
For a full withdrawal, read
balanceRaw from
GET /v2/portfolios/{portfolioId}/positions. Send this value as amountRaw.
Do not calculate it from balance.
Pagination
Pagination uses a cursor based on(createdAt, id).
limit: Minimum 1, maximum 200, and default 50.cursor: An opaque base64url string.nextCursor:nullwhen there are no more pages.
nextCursor unchanged.
Idempotency
Write routes with permanent effects use an idempotency anchor. An identical replay returns the original response. A replay with a different body returns409 API_008.
See Idempotency for retry rules and the three 409
sub-codes you may see.
Asynchronous operations
Write routes that start onchain work return202 and an operationId. Poll
the operation every 2–5 seconds. Stop when the state is completed, failed,
or cancelled.
Error codes
All B2B API error codes use theAPI_XXX format. The number range identifies
the category. The following table contains common codes.
For the full list, see Error codes.
Tracing and support
Include theX-Correlation-Id header when you report an issue. Glider uses
this value to find related logs.