Skip to content
Logo

flint.margin.user.v1 reference

Table of Contents

Top

flint/margin/user/v1/account/messages.proto

AccountHealth

Cross-margin account health in USD.

FieldTypeLabelDescription
net_equityDecimal
initial_marginDecimalRequired to borrow or withdraw collateral.
maintenance_marginDecimal
net_exposureDecimal
meets_initial_marginbool
meets_maintenance_marginbool
free_collateralDecimalnet_equity minus initial_margin, floored at zero.
deficitDecimalmaintenance_margin minus net_equity, floored at zero.
health_ratioDecimalnet_equity / maintenance_margin; unset when maintenance margin is zero.
can_open_positionboolRequires initial margin and positive equity.
can_be_backstoppedboolWhether a backstopper may take over the account's legs.

AccountHistoryPoint

One archived account-value sample.

FieldTypeLabelDescription
tsTimestampBucket start; uses its newest sample.
observed_atTimestampServer observation time, not block time.
slotuint64Highest observed tip; may not increase between points.
nav_usdDecimalUnweighted signed account value.
pnl_usdDecimalnav_usd minus deposits; estimated and unset without complete ledger coverage.
net_exposureDecimal
debt_usdDecimal
health_ratioDecimalnet_equity / maintenance_margin; unset when maintenance margin is zero.
provenanceDataProvenance

AccountRef

FieldTypeLabelDescription
trader_idTraderId
ownerstring
is_delegateboolTrue when the requested authority is a delegate rather than the owner.
addressstring
namestringWorld-readable display label, including when is_name_public is false; empty when unset.
is_name_publicboolWhether the label is shown on rankings; defaults to false, not an access-control flag.

AccountSnapshot

FieldTypeLabelDescription
trader_idTraderId
ownerstring
positionsSpotPositionrepeated
healthAccountHealth
slotuint64
tsTimestamp
addressstring
provenanceDataProvenance
perp_positionsPerpPositionrepeated
perp_positions_supportedboolFalse when combined spot/perp health is unavailable.

ActionLimit

FieldTypeLabelDescription
amountDecimalToken units; zero when unavailable.
constraintLimitConstraint

ActivityEntry

FieldTypeLabelDescription
kindActivityKind
spot_idSpotId
slotuint64
tsTimestampServer observation time, not block time.
signaturestring
amountDecimalUnsigned token units moved; unset when unknown.
value_usdDecimalEstimated USD value at ingestion; unset without a usable price.
liquidationboolTrue when this account was the liquidator.
event_idstring
provenanceDataProvenance
perp_settlementbool

BatchGetAccountsRequest

FieldTypeLabelDescription
trader_idsTraderIdrepeatedRequired; at most 100 unique IDs. Results preserve request order.

BatchGetAccountsResponse

FieldTypeLabelDescription
accountsAccountSnapshotrepeated
missing_trader_idsTraderIdrepeatedNo local valued snapshot; does not prove on-chain absence.
provenanceDataProvenance

DelegateInfo

FieldTypeLabelDescription
addressstring
credential_kindDelegateCredentialKind
authoritystring
scope_bitsuint32
expires_atTimestamp
activebool

GetAccountHistoryRequest

FieldTypeLabelDescription
trader_idTraderId
startTimestampInclusive; unset selects 24 hours before end.
endTimestampExclusive; unset selects now.
resolution_secondsuint32Zero lets the server choose; non-zero is exact or INVALID_ARGUMENT.
include_perp_pnlbool

GetAccountHistoryResponse

FieldTypeLabelDescription
pointsAccountHistoryPointrepeatedOldest first; empty buckets are omitted.
resolution_secondsuint32Actual bucket width.
coverageHistoryCoverage
perp_pnlPerpPnlHistory

GetAccountRequest

FieldTypeLabelDescription
trader_idTraderId

GetAccountResponse

FieldTypeLabelDescription
accountAccountSnapshot

GetActionLimitsRequest

FieldTypeLabelDescription
trader_idTraderId
spot_idsSpotIdrepeatedEmpty selects every listed market.

GetActionLimitsResponse

FieldTypeLabelDescription
marketsMarketActionLimitsrepeated
slotuint64
tsTimestamp
provenanceDataProvenance

GetActivityRequest

FieldTypeLabelDescription
trader_idTraderId
startTimestampInclusive; unset selects the whole ledger.
endTimestampExclusive; unset selects now.
limituint32Zero uses the default (50); maximum 1000.
kindsActivityKindrepeatedEmpty selects every kind; UNSPECIFIED values are ignored.
page_tokenstring

GetActivityResponse

FieldTypeLabelDescription
activitiesActivityEntryrepeatedDescending by slot, signature, instruction index, then event index; pagination is not a snapshot.
next_page_tokenstring
provenanceDataProvenance
coverageHistoryCoverage

GetRankedAccountsRequest

FieldTypeLabelDescription
metricAccountRankingMetricAll metrics sort descending except CLOSEST_TO_LIQUIDATION.
timeframeAccountRankingTimeframeHistorical windows are rolling 24h, 7d, or 30d completed hours. Current-state rankings ignore this field and leave response windows unset.
minimum_account_valueAccountRankingSizeMinimum unweighted USD economic NAV.
limituint32Zero uses the default (20); maximum 100. Results are not paginated.

GetRankedAccountsResponse

FieldTypeLabelDescription
accountsRankedAccountrepeated
as_ofTimestampTimestamp at which the ranking was built.
window_startTimestamp
window_endTimestamp
provenanceDataProvenance
history_completeboolAlways false while processed archive history may have gaps.

ListAccountsRequest

FieldTypeLabelDescription
authoritystringBase58 owner or delegate pubkey.

ListAccountsResponse

FieldTypeLabelDescription
accountsAccountRefrepeated
provenanceDataProvenance

ListDelegatesRequest

FieldTypeLabelDescription
trader_idTraderId
include_inactivebool

ListDelegatesResponse

FieldTypeLabelDescription
delegatesDelegateInforepeated
provenanceDataProvenance

MarketActionLimits

Per-market action limits at the response state; they may change before submission.

FieldTypeLabelDescription
spot_idSpotId
depositActionLimit
withdrawActionLimit
lendActionLimit
redeemActionLimit
borrowActionLimit
repayActionLimit

RankedAccount

FieldTypeLabelDescription
trader_idTraderId
ownerstringLive identity and statistics may be absent for historical-only accounts.
addressstring
account_value_usdDecimalUnweighted USD economic NAV.
metric_valueDecimal
rankuint32
open_interest_usdDecimalCurrent statistics are independent of the historical ranking window.
leverageDecimalGross perp notional / positive economic NAV; absent otherwise.
health_ratioDecimal
open_position_countuint32optionalNumber of perp positions with nonzero quantity.
account_equity_usdDecimalNet equity from current account health, including collateral weights.
performance_startTimestampFirst observation used for performance; all-time begins with eligible NAV history.
namestringOnly public labels are returned; empty when unset or private.

RenameAccountRequest

The signed bytes are UTF-8, no trailing newline, fields in this order. Insert the is_public line only when the field is present, using lowercase true or false. Explicit false signs the line; omission leaves it out. The server verifies only that layout.

flint:rename-account\n
expires_at=<expires_at>\n
trader_id=<trader_id>\n
is_public=<true|false>\n
name=<name>
FieldTypeLabelDescription
trader_idTraderId
authoritystringBase58 signing owner or delegate pubkey.
namestringEmpty clears the label. Trimmed; maximum 32 characters. Sign the trimmed value.
expires_atuint64Unix seconds, at most 120 seconds ahead.
signaturebytes
is_publicbooloptionalOmission resets leaderboard visibility to false, including for an already-public label.

RenameAccountResponse

FieldTypeLabelDescription
namestring
is_publicbool

SimulateActionRequest

Simulates an action without signing or submitting it.

FieldTypeLabelDescription
trader_idTraderId
spot_idSpotId
actionSpotAction
amountDecimalToken units; excess asset precision is rejected.
authoritystringBase58 owner or registered delegate pubkey used for simulation.
create_token_accountboolCreates the signer's token account; rejected for actions that move no tokens.
wrap_lamportsuint64Lamports to wrap before a wrapped-SOL deposit; zero disables wrapping.

SimulateActionResponse

Simulation result and post-state.

FieldTypeLabelDescription
errorstringEmpty on success; otherwise the node's transaction error.
logsstringrepeated
compute_unitsuint64Minimum compute-unit limit for the simulated transaction.
accountAccountSnapshotSimulated post-state; unset on error.
tsTimestamp
program_errorstringStable margin-program error name; empty for failures from other programs.
provenanceDataProvenance

SpotPosition

One spot leg. Amounts are token units.

FieldTypeLabelDescription
spot_idSpotId
raw_depositDecimalIdle collateral that earns no interest.
lentDecimal
borrowedDecimal
value_usdDecimalUnweighted USD value.
deposit_sharesDecimalRaw pool share counts.
borrow_sharesDecimal
weighted_collateral_usdDecimalUSD collateral after the deposit-weight haircut; zero for a net borrow.
debt_usdDecimalUSD debt; zero for a net deposit.
initial_margin_usdDecimal
maintenance_margin_usdDecimal
liquidation_priceDecimalUSD token price at maintenance margin; unset when no single-asset move can reach it.

SubscribeAccountRequest

FieldTypeLabelDescription
trader_idTraderId

SubscribeAccountsRequest

FieldTypeLabelDescription
trader_idsTraderIdrepeated

SubscribeAccountsResponse

Each message replaces the selected account set; intermediate states may coalesce.

FieldTypeLabelDescription
accountsAccountSnapshotrepeated
missing_trader_idsTraderIdrepeatedNo local valued snapshot; does not prove on-chain absence.
provenanceDataProvenance

SubscribeActivityRequest

FieldTypeLabelDescription
trader_idTraderId
kindsActivityKindrepeated

AccountRankingMetric

NameNumberDescription
ACCOUNT_RANKING_METRIC_UNSPECIFIED0
ACCOUNT_RANKING_METRIC_PNL1Signed USD NAV change minus external cash flows.
ACCOUNT_RANKING_METRIC_PNL_PERCENT2Linked hourly Modified Dietz returns, in percent (10 means 10%).
ACCOUNT_RANKING_METRIC_VOLUME3Sum over completed-hour buckets in the selected timeframe.
ACCOUNT_RANKING_METRIC_ACCOUNT_VALUE4
ACCOUNT_RANKING_METRIC_OPEN_INTEREST5
ACCOUNT_RANKING_METRIC_CLOSEST_TO_LIQUIDATION6Health ratio ascending; accounts without usable prices are excluded.
ACCOUNT_RANKING_METRIC_LARGEST_LIQUIDATION7Largest single liquidation, not the sum, over completed-hour buckets.
ACCOUNT_RANKING_METRIC_SHARPE_RATIO8Annualized hourly Sharpe, zero risk-free rate; requires 24 returns.

AccountRankingSize

NameNumberDescription
ACCOUNT_RANKING_SIZE_UNSPECIFIED0No minimum account value.
ACCOUNT_RANKING_SIZE_USD_1001
ACCOUNT_RANKING_SIZE_USD_10002
ACCOUNT_RANKING_SIZE_USD_100003
ACCOUNT_RANKING_SIZE_USD_1000004
ACCOUNT_RANKING_SIZE_USD_10000005

AccountRankingTimeframe

NameNumberDescription
ACCOUNT_RANKING_TIMEFRAME_UNSPECIFIED0
ACCOUNT_RANKING_TIMEFRAME_DAY1
ACCOUNT_RANKING_TIMEFRAME_WEEK2
ACCOUNT_RANKING_TIMEFRAME_MONTH3
ACCOUNT_RANKING_TIMEFRAME_ALL_TIME4All observed history.

ActivityKind

NameNumberDescription
ACTIVITY_KIND_UNSPECIFIED0
ACTIVITY_KIND_DEPOSIT1
ACTIVITY_KIND_WITHDRAW2
ACTIVITY_KIND_LEND3
ACTIVITY_KIND_REDEEM4
ACTIVITY_KIND_BORROW5
ACTIVITY_KIND_REPAY6
ACTIVITY_KIND_SOCIALIZE_LOSS7Bad debt written off this account.

DelegateCredentialKind

NameNumberDescription
DELEGATE_CREDENTIAL_KIND_UNSPECIFIED0
DELEGATE_CREDENTIAL_KIND_ED255191
DELEGATE_CREDENTIAL_KIND_PASSKEY2

LimitConstraint

Constraint on an action amount.

NameNumberDescription
LIMIT_CONSTRAINT_UNSPECIFIED0
LIMIT_CONSTRAINT_BALANCE1The available balance; deposit uses uint64 maximum because wallet balance is unknown.
LIMIT_CONSTRAINT_INITIAL_MARGIN2
LIMIT_CONSTRAINT_POOL_LIQUIDITY3
LIMIT_CONSTRAINT_UTILISATION_THROTTLE4
LIMIT_CONSTRAINT_MARKET_CAP5
LIMIT_CONSTRAINT_FLOW_CAP6
LIMIT_CONSTRAINT_OPERATION_DISABLED7For borrow, the redeem flag also applies.
LIMIT_CONSTRAINT_POSITION_LIMIT8A new position would exceed the account's spot-position limit.

SpotAction

NameNumberDescription
SPOT_ACTION_UNSPECIFIED0
SPOT_ACTION_DEPOSIT1
SPOT_ACTION_WITHDRAW2Debits only the idle deposit and never borrows; must leave initial margin met.
SPOT_ACTION_LEND3
SPOT_ACTION_REDEEM4
SPOT_ACTION_BORROW5
SPOT_ACTION_REPAY6

Top

flint/margin/user/v1/account/service.proto

AccountService

Method NameRequest TypeResponse TypeDescription
BatchGetAccountsBatchGetAccountsRequestBatchGetAccountsResponse
SubscribeAccountsSubscribeAccountsRequestSubscribeAccountsResponse stream
ListDelegatesListDelegatesRequestListDelegatesResponse
SubscribeActivitySubscribeActivityRequestActivityEntry stream
GetInterestHistoryGetInterestHistoryRequestGetInterestHistoryResponse
GetPositionHistoryGetPositionHistoryRequestGetPositionHistoryResponse
GetFillsGetFillsRequestGetFillsResponse
SubscribeFillsSubscribeFillsRequestFill stream
GetTradingLimitsGetTradingLimitsRequestGetTradingLimitsResponse
GetTradingFeesGetTradingFeesRequestGetTradingFeesResponse
ListAccountsListAccountsRequestListAccountsResponse
GetRankedAccountsGetRankedAccountsRequestGetRankedAccountsResponse
GetAccountGetAccountRequestGetAccountResponse
SubscribeAccountSubscribeAccountRequestAccountSnapshot stream
GetActionLimitsGetActionLimitsRequestGetActionLimitsResponse
SimulateActionSimulateActionRequestSimulateActionResponse
GetActivityGetActivityRequestGetActivityResponse
GetAccountHistoryGetAccountHistoryRequestGetAccountHistoryResponse
RenameAccountRenameAccountRequestRenameAccountResponse

Top

flint/margin/user/v1/action/messages.proto

ActionDetail

FieldTypeLabelDescription
labelstringFor example "Est. fill".
valuestringFor example "102.31".

ActionPreviewRow

FieldTypeLabelDescription
indexuint32The action's index in the request.
stepuint32When it runs: 1 deposits; 2 cancels, settles, lends, repays and borrows; 3 orders and closes; 4 withdrawals, transfers and redeems. Within a step the request's order is kept.
titlestringThe sentence the trading app shows for this action.
statusActionPreviewStatus
detailsActionDetailrepeated
warningsstringrepeated
blocked_reasonstring

AssetAction

FieldTypeLabelDescription
assetstring
amountDecimal

CancelOrderAction

Set target: unset is INVALID_ARGUMENT.

FieldTypeLabelDescription
marketstring
order_idstring`<perpId>:<buy
allboolEvery resting order on the market. Must be true; false is INVALID_ARGUMENT. Resting orders aren't indexed by the server: whether a single order still rests is checked by the app when the link opens.

ClosePositionAction

FieldTypeLabelDescription
marketstring
fractionuint32Percent of the position to close at market: 25, 50, 75 or 100, else INVALID_ARGUMENT.
max_slippage_bpsuint32optional1 to 1000, as for a market order. Absent is 500, written into the link.

PlaceOrderAction

FieldTypeLabelDescription
marketstring
sideActionOrderSide
sizeDecimalA multiple of the market's lot size; never rounded.
order_typeActionOrderType
limit_priceDecimalLimit orders only, and required for them. A multiple of the market's tick.
max_slippage_bpsuint32optionalMarket orders only: 1 to 1000, else INVALID_ARGUMENT. Absent is 500. The link always carries the value, so the app enforces the band checked here.
time_in_forceActionTimeInForceLimit orders only; on a market order, anything but UNSPECIFIED is INVALID_ARGUMENT.
reduce_onlybool
post_onlyboolLimit GTC orders only, else INVALID_ARGUMENT.

PreviewActionsRequest

FieldTypeLabelDescription
trader_idTraderIdThe account the actions are for. Its owner reviews and signs them.
actionsTraderActionrepeated1 to 10 actions.
expires_in_secsuint32optionalHow long the link stays valid. Absent is 600; 1 to 900, else INVALID_ARGUMENT.

PreviewActionsResponse

FieldTypeLabelDescription
rowsActionPreviewRowrepeatedOne per action, in the order they run.
linkstringThe trading app's review page with every action. Empty when any action is BLOCKED, or when no trading app is deployed for this cluster; warnings say which.
expires_atTimestamp
slotuint64The slot the checks read.
warningsstringrepeatedAbout the batch as a whole: why there is no link, and that actions were checked alone.

SettlePnlAction

Set target: unset is INVALID_ARGUMENT.

FieldTypeLabelDescription
marketstring
allboolEvery market with pending PnL. Must be true; false is INVALID_ARGUMENT.

TraderAction

One trader action. Markets are perp symbols as the trading app shows them ("SOL-USDC-PERP"), or a base ("SOL") when only one market trades it. Assets are token names ("USDC"); mints are also accepted. Sizes are base units, amounts token units, and prices quote prices, all as decimal strings.

FieldTypeLabelDescription
place_orderPlaceOrderAction
close_positionClosePositionAction
cancel_orderCancelOrderAction
settle_pnlSettlePnlAction
depositAssetAction
withdrawAssetActionPays only the account owner's wallet.
transferTransferAction
lendAssetAction
redeemAssetAction
borrowAssetAction
repayAssetAction

TransferAction

FieldTypeLabelDescription
assetstring
amountDecimal
to_trader_idTraderIdAnother account with the same owner.

ActionOrderSide

UNSPECIFIED is INVALID_ARGUMENT.

NameNumberDescription
ACTION_ORDER_SIDE_UNSPECIFIED0
ACTION_ORDER_SIDE_LONG1
ACTION_ORDER_SIDE_SHORT2

ActionOrderType

UNSPECIFIED is INVALID_ARGUMENT.

NameNumberDescription
ACTION_ORDER_TYPE_UNSPECIFIED0
ACTION_ORDER_TYPE_MARKET1Fill or kill within max_slippage_bps of the mark the trader reviews.
ACTION_ORDER_TYPE_LIMIT2

ActionPreviewStatus

NameNumberDescription
ACTION_PREVIEW_STATUS_UNSPECIFIED0
ACTION_PREVIEW_STATUS_READY1
ACTION_PREVIEW_STATUS_WARNING2Can be approved; see warnings.
ACTION_PREVIEW_STATUS_BLOCKED3Can't be approved; see blocked_reason. Any BLOCKED row means no link.

ActionTimeInForce

NameNumberDescription
ACTION_TIME_IN_FORCE_UNSPECIFIED0GTC.
ACTION_TIME_IN_FORCE_GTC1
ACTION_TIME_IN_FORCE_IOC2
ACTION_TIME_IN_FORCE_FOK3

Top

flint/margin/user/v1/action/service.proto

ActionService

Method NameRequest TypeResponse TypeDescription
PreviewActionsPreviewActionsRequestPreviewActionsResponseChecks a batch of trader actions (orders, closes, cancels, settles, deposits, withdrawals, transfers, lending) for one margin account and returns a link to the trading app's review page, where the account owner reviews, excludes and signs them. Builds, signs, and sends nothing: the link carries intent only and grants nothing, and the app checks everything again before signing.

Each action is checked alone against the account as it stands now; balances and positions are not chained through the batch. A deposit that funds an order, or two withdrawals that together overdraw, can each come back READY. Actions run in steps, keeping the request's order within one: 1 deposits; 2 cancels, settles, lends, repays and borrows; 3 orders and closes; 4 withdrawals, transfers and redeems.

Malformed input is INVALID_ARGUMENT, naming actions[i].field; problems with live state are BLOCKED rows. If any row is BLOCKED there is no link: fix or drop those actions and preview again. The link is also empty, with a warning, when no trading app is deployed for this cluster. |

Top

flint/margin/user/v1/common.proto

DataProvenance

Observation metadata, not a claim that the node is caught up with the chain.

FieldTypeLabelDescription
commitmentCommitment
observed_atTimestamp
slotuint64
revisionuint64optional
fork_reconciledbool

Decimal

Decimal string (e.g. "155.14"), parsed with rust_decimal-compatible semantics.

FieldTypeLabelDescription
valuestring

HistoryCoverage

Effective query window [start, end). Complete only when coverage is proven.

FieldTypeLabelDescription
startTimestamp
endTimestamp
completebool
reasonstring

SpotId

On-chain spot-asset id (u32 on-chain, unlike flint.spot.v1's u64).

FieldTypeLabelDescription
iduint32

SpotMetadata

FieldTypeLabelDescription
idSpotId
namestring
mintstring
decimalsuint32
token_programstringBase58 mint owner program (SPL Token or Token-2022).
iconstring
product_iduint64optionalOn-chain catalog product ID; separate from id and unset on older servers.

Timestamp

Unix microseconds since epoch. Zero means unspecified.

FieldTypeLabelDescription
microsuint64

TraderId

On-chain margin-account ID chosen by its creator.

FieldTypeLabelDescription
iduint64

Commitment

NameNumberDescription
COMMITMENT_UNSPECIFIED0
COMMITMENT_PROCESSED1
COMMITMENT_CONFIRMED2
COMMITMENT_FINALIZED3

Top

flint/margin/user/v1/funding/messages.proto

FundingPayment

FieldTypeLabelDescription
payment_idstring
trader_idTraderId
perp_idPerpId
amount_usdDecimalPositive is a credit to the account; negative is a debit.
position_quantityDecimal
funding_rateDecimal
funded_atTimestamp
provenanceDataProvenance

FundingRate

FieldTypeLabelDescription
perp_idPerpId
rateDecimalFraction per interval_seconds; positive means longs pay shorts.
funding_atTimestamp
next_funding_atTimestamp
interval_secondsuint64
provenanceDataProvenance

GetFundingPaymentsRequest

FieldTypeLabelDescription
trader_idTraderId
perp_idsPerpIdrepeated
startTimestamp
endTimestamp
page_sizeuint32
page_tokenstring

GetFundingPaymentsResponse

FieldTypeLabelDescription
paymentsFundingPaymentrepeated
next_page_tokenstring
coverageHistoryCoverage

GetFundingRateHistoryRequest

FieldTypeLabelDescription
perp_idsPerpIdrepeated
startTimestamp
endTimestamp
page_sizeuint32
page_tokenstring
bucket_secondsuint320 returns every sample. Otherwise returns only each perp's last sample in every epoch-aligned bucket_seconds window of funding_at.

GetFundingRateHistoryResponse

FieldTypeLabelDescription
ratesFundingRaterepeated
next_page_tokenstring
coverageHistoryCoverage

GetFundingRatesRequest

FieldTypeLabelDescription
perp_idsPerpIdrepeated

GetFundingRatesResponse

FieldTypeLabelDescription
ratesFundingRaterepeated
provenanceDataProvenance

SubscribeFundingPaymentsRequest

FieldTypeLabelDescription
trader_idTraderId
perp_idsPerpIdrepeated

SubscribeFundingPaymentsResponse

FieldTypeLabelDescription
paymentsFundingPaymentrepeated
snapshotbool
sequenceuint64
provenanceDataProvenance

SubscribeFundingRatesRequest

FieldTypeLabelDescription
perp_idsPerpIdrepeated

SubscribeFundingRatesResponse

FieldTypeLabelDescription
ratesFundingRaterepeated
snapshotbool
sequenceuint64
provenanceDataProvenance

Top

flint/margin/user/v1/funding/service.proto

FundingService

Method NameRequest TypeResponse TypeDescription
GetFundingRatesGetFundingRatesRequestGetFundingRatesResponse
SubscribeFundingRatesSubscribeFundingRatesRequestSubscribeFundingRatesResponse stream
GetFundingRateHistoryGetFundingRateHistoryRequestGetFundingRateHistoryResponse
GetFundingPaymentsGetFundingPaymentsRequestGetFundingPaymentsResponse
SubscribeFundingPaymentsSubscribeFundingPaymentsRequestSubscribeFundingPaymentsResponse stream

Top

flint/margin/user/v1/history/messages.proto

GetInterestHistoryRequest

FieldTypeLabelDescription
trader_idTraderId
spot_idsSpotIdrepeatedEmpty selects every observed spot asset.
startTimestampInclusive. Unset / zero-micros selects 24 hours before end.
endTimestampExclusive. Unset / zero-micros selects now.
resolution_secondsuint32Zero lets the server choose a bucket width that fits its point limit.

GetInterestHistoryResponse

FieldTypeLabelDescription
pointsInterestHistoryPointrepeated
resolution_secondsuint32
coverageHistoryCoverage

GetMarketHistoryRequest

FieldTypeLabelDescription
spot_idSpotId
startTimestampInclusive. Unset / zero-micros selects 24 hours before end.
endTimestampExclusive. Unset / zero-micros selects now.
resolution_secondsuint32Zero lets the server choose a bucket width that fits its point limit.

GetMarketHistoryResponse

FieldTypeLabelDescription
pointsMarketHistoryPointrepeated
resolution_secondsuint32
coverageHistoryCoverage

InterestHistoryPoint

FieldTypeLabelDescription
spot_idSpotId
tsTimestampStart of the requested bucket.
earnedDecimalToken interest earned; unset when the ledger cannot establish it.
paidDecimalToken interest paid; unset when the ledger cannot establish it.
unavailable_reasonstringWhy one or both values are absent. Empty only when both are known.
provenanceDataProvenance

MarketHistoryPoint

FieldTypeLabelDescription
tsTimestampStart of the requested bucket. Empty buckets are omitted.
observed_atTimestampNewest coherent observation in the bucket.
slotuint64
deposit_aprDecimal
borrow_aprDecimal
utilisationDecimal
vault_utilisationDecimal
total_depositsDecimal
total_borrowsDecimal
total_isolated_depositDecimal
deposit_share_priceDecimal
borrow_share_priceDecimal
oracle_priceDecimal
protocol_feeDecimal
provenanceDataProvenance
available_liquidityDecimal

Top

flint/margin/user/v1/market/messages.proto

FlowCap

Per-market net-flow limiter.

FieldTypeLabelDescription
deposit_cappedbool
withdraw_cappedbool
max_depositDecimalNet-inflow ceiling in token units; unset when uncapped.
max_withdrawDecimalNet-outflow ceiling, token units. Unset when uncapped.
deposit_headroomDecimalCurrent token-unit headroom; unset when uncapped.
withdraw_headroomDecimal

GetMarketRequest

FieldTypeLabelDescription
spot_idSpotId

GetMarketResponse

FieldTypeLabelDescription
marketMarketInfo

InterestRateCurve

Live piecewise-linear borrow-rate curve in utilisation.

FieldTypeLabelDescription
target_utilisationDecimalCurve kink; bounded on-chain to [0.05, 0.95].
apr_at_zeroDecimal
apr_at_targetDecimal
apr_at_fullDecimal

ListMarketsRequest

ListMarketsResponse

FieldTypeLabelDescription
marketsMarketInforepeated
provenanceDataProvenance

MarketFlags

Operations currently accepted by the market.

FieldTypeLabelDescription
deposit_enabledbool
withdraw_enabledbool
lend_enabledbool
borrow_enabledbool
redeem_enabledbool

MarketInfo

Lending-market state. Token amounts are token units.

FieldTypeLabelDescription
assetSpotMetadata
deposit_weightDecimalDeposit-value haircut for collateral.
borrow_imfDecimal
borrow_mmfDecimal
oracle_priceDecimalUSD per token unit.
deposit_share_priceDecimalToken units per pool share.
borrow_share_priceDecimal
total_depositsDecimalTotal supplied token units, including isolated deposits.
total_borrowsDecimal
utilisationDecimaltotal_borrows / total_deposits; distinct from vault_utilisation.
deposit_aprDecimalNominal annual rates at current utilisation.
borrow_aprDecimal
slotuint64
tsTimestamp
liquidation_bonusDecimalCollateral bonus per unit of debt repaid by a liquidator.
lending_rate_feeDecimalProtocol share of interest, already reflected in deposit_apr.
protocol_feeDecimalUnpaid protocol interest in token units.
throttle_borrow_utilisationDecimalVault utilisation at or above which the chain rejects a new borrow.
throttle_redeem_utilisationDecimalVault utilisation at which the chain rejects redeeming lent deposits.
deposit_limitDecimalTotal-asset ceiling in token units; unset when uncapped.
borrow_limitDecimalPool-borrow ceiling in token units; unset when uncapped.
flagsMarketFlags
flow_capFlowCap
total_isolated_depositDecimalIdle, unlent deposits in token units.
vault_utilisationDecimaltotal_borrows / lent pool; capped at 1.
available_liquidityDecimalCurrent borrow/redeem headroom in token units.
total_deposit_sharesDecimalRaw pool-share totals.
total_borrow_sharesDecimal
last_accrual_atTimestampInterest-accrual time; share prices and APRs are as of this time.
rate_curveInterestRateCurve
addressstring
vaultstring
oracleOracleInfo
provenanceDataProvenance

OracleInfo

Market oracle source and cache freshness.

FieldTypeLabelDescription
last_synced_atTimestamp
valid_untilTimestampOn-chain reads after this time are rejected.
oracle_iduint32Registry oracle ID; markets with the same ID share a price.
sourcesOracleSourcerepeatedConfigured slots in order; empty until indexed.

OracleSource

One oracle source slot.

FieldTypeLabelDescription
providerOracleProvider
feedstringBase58 source account.

SubscribeMarketsRequest

FieldTypeLabelDescription
spot_idsSpotIdrepeatedEmpty selects every listed market.

OracleProvider

NameNumberDescription
ORACLE_PROVIDER_UNSPECIFIED0
ORACLE_PROVIDER_DEV1
ORACLE_PROVIDER_PYTH2
ORACLE_PROVIDER_CHAINLINK3

Top

flint/margin/user/v1/market/service.proto

MarketService

Public catalog and live state of lending markets.

Method NameRequest TypeResponse TypeDescription
GetMarketGetMarketRequestGetMarketResponse
GetMarketHistoryGetMarketHistoryRequestGetMarketHistoryResponse
ListMarketsListMarketsRequestListMarketsResponse
SubscribeMarketsSubscribeMarketsRequestMarketInfo stream

Top

flint/margin/user/v1/market_data/messages.proto

Candle

FieldTypeLabelDescription
perp_idPerpId
intervalCandleInterval
price_sourceCandlePriceSource
opened_atTimestamp
closed_atTimestamp
openDecimal
highDecimal
lowDecimal
closeDecimal
volumeDecimal
trade_countuint64
provenanceDataProvenance

GetCandlesRequest

FieldTypeLabelDescription
perp_idPerpId
intervalCandleInterval
price_sourceCandlePriceSource
startTimestamp
endTimestamp
page_sizeuint32
page_tokenstring

GetCandlesResponse

FieldTypeLabelDescription
candlesCandlerepeated
next_page_tokenstring
coverageHistoryCoverage

GetOrderBookRequest

FieldTypeLabelDescription
perp_idPerpId
depthuint32

GetOrderBookResponse

FieldTypeLabelDescription
order_bookOrderBookSnapshot

GetTradesRequest

FieldTypeLabelDescription
perp_idsPerpIdrepeated
startTimestamp
endTimestamp
page_sizeuint32
page_tokenstring

GetTradesResponse

FieldTypeLabelDescription
tradesPublicTraderepeated
next_page_tokenstring
coverageHistoryCoverage

OrderBookLevel

FieldTypeLabelDescription
priceDecimal
quantityDecimal
order_countuint64

OrderBookSnapshot

FieldTypeLabelDescription
perp_idPerpId
bidsOrderBookLevelrepeated
asksOrderBookLevelrepeated
sequenceuint64
provenanceDataProvenance

PublicTrade

FieldTypeLabelDescription
trade_idstring
perp_idPerpId
aggressor_sideTradeSide
priceDecimal
quantityDecimal
executed_atTimestamp
provenanceDataProvenance

SubscribeCandlesRequest

FieldTypeLabelDescription
perp_idPerpId
intervalCandleInterval
price_sourceCandlePriceSource

SubscribeCandlesResponse

FieldTypeLabelDescription
candleCandle
snapshotbool
sequenceuint64
provenanceDataProvenance

SubscribeOrderBookRequest

FieldTypeLabelDescription
perp_idPerpId
depthuint32

SubscribeOrderBookResponse

FieldTypeLabelDescription
order_bookOrderBookSnapshotSnapshot replaces the book. Deltas replace sizes by price; zero deletes.
snapshotbool
sequenceuint64
previous_sequenceuint64

SubscribeTradesRequest

FieldTypeLabelDescription
perp_idsPerpIdrepeated

SubscribeTradesResponse

FieldTypeLabelDescription
tradesPublicTraderepeated
snapshotbool
sequenceuint64
provenanceDataProvenance

CandleInterval

NameNumberDescription
CANDLE_INTERVAL_UNSPECIFIED0
CANDLE_INTERVAL_1_MINUTE1
CANDLE_INTERVAL_5_MINUTES2
CANDLE_INTERVAL_15_MINUTES3
CANDLE_INTERVAL_1_HOUR4
CANDLE_INTERVAL_4_HOURS5
CANDLE_INTERVAL_1_DAY6

CandlePriceSource

NameNumberDescription
CANDLE_PRICE_SOURCE_UNSPECIFIED0
CANDLE_PRICE_SOURCE_TRADES1
CANDLE_PRICE_SOURCE_MARK2
CANDLE_PRICE_SOURCE_INDEX3

Top

flint/margin/user/v1/market_data/service.proto

MarketDataService

Method NameRequest TypeResponse TypeDescription
GetOrderBookGetOrderBookRequestGetOrderBookResponse
SubscribeOrderBookSubscribeOrderBookRequestSubscribeOrderBookResponse stream
GetTradesGetTradesRequestGetTradesResponse
SubscribeTradesSubscribeTradesRequestSubscribeTradesResponse stream
GetCandlesGetCandlesRequestGetCandlesResponse
SubscribeCandlesSubscribeCandlesRequestSubscribeCandlesResponse stream

Top

flint/margin/user/v1/notifications/messages.proto

RequestEmailVerificationRequest

FieldTypeLabelDescription
emailstring

RequestEmailVerificationResponse

FieldTypeLabelDescription
challenge_idstring
expires_at_msuint64Unix epoch milliseconds.
retry_after_msuint64Milliseconds before another verification email may be requested.

Settings

Settings belong to the owner and selected trader account in the authenticated margin session. Delegates cannot read or change notification settings.

FieldTypeLabelDescription
delivery_availableboolFalse when this server cannot send verification or fill emails.
email_addressstringVerified destination only; empty when no email destination is enabled.
email_enabledbool

VerifyEmailRequest

FieldTypeLabelDescription
challenge_idstring
codestring

Top

flint/margin/user/v1/notifications/service.proto

NotificationService

Manages email delivery preferences. Every method requires a margin-session bearer token for the selected trader account's current owner. Public fill history is available through AccountService.GetFills. Reading or dismissing fills in a client never suppresses email delivery.

Method NameRequest TypeResponse TypeDescription
GetSettings.google.protobuf.EmptySettingsReturns current settings without enabling email delivery.
RequestEmailVerificationRequestEmailVerificationRequestRequestEmailVerificationResponseSends a verification code. Requesting a code does not enable email or change the currently verified destination when requesting a replacement.
VerifyEmailVerifyEmailRequestSettingsVerifies a single-use code and enables the destination for new fills from verification onward, replacing any previous destination without a backlog.
DisableEmail.google.protobuf.EmptySettingsDisables email and cancels pending verification for this account. Re-enabling email requires fresh verification.

Top

flint/margin/user/v1/order/messages.proto

GetOrderRequest

FieldTypeLabelDescription
trader_idTraderId
order_idstring
client_order_idstring

GetOrderResponse

FieldTypeLabelDescription
orderOrder

ListOrdersRequest

FieldTypeLabelDescription
trader_idTraderId
perp_idsPerpIdrepeated
statusesOrderStatusrepeated
startTimestamp
endTimestamp
page_sizeuint32
page_tokenstring

ListOrdersResponse

FieldTypeLabelDescription
ordersOrderrepeated
next_page_tokenstring
coverageHistoryCoverage

Order

FieldTypeLabelDescription
order_idstring
client_order_idstring
trader_idTraderId
perp_idPerpId
sideTradeSide
order_typeOrderType
time_in_forceTimeInForce
statusOrderStatus
quantityDecimal
filled_quantityDecimal
remaining_quantityDecimal
limit_priceDecimal
trigger_priceDecimal
reduce_onlybool
post_onlybool
created_atTimestamp
updated_atTimestamp
expires_atTimestamp
rejection_reasonstring
provenanceDataProvenance

PreviewOrder

FieldTypeLabelDescription
perp_idPerpId
sideTradeSide
requested_quantityDecimal
executable_quantityDecimal
average_priceDecimal
worst_priceDecimal
price_impactDecimal
estimated_fee_usdDecimal
resulting_position_quantityDecimal
resulting_initial_margin_usdDecimal
resulting_maintenance_margin_usdDecimal
provenanceDataProvenance

PreviewOrderRequest

FieldTypeLabelDescription
trader_idTraderId
perp_idPerpId
sideTradeSide
quantityDecimal
order_typeOrderType
limit_priceDecimal
reduce_onlybool

PreviewOrderResponse

FieldTypeLabelDescription
previewPreviewOrder

SubscribeOrdersRequest

FieldTypeLabelDescription
trader_idTraderId
perp_idsPerpIdrepeated

SubscribeOrdersResponse

FieldTypeLabelDescription
ordersOrderrepeated
snapshotbool
sequenceuint64
provenanceDataProvenance

OrderStatus

NameNumberDescription
ORDER_STATUS_UNSPECIFIED0
ORDER_STATUS_OPEN1
ORDER_STATUS_PARTIALLY_FILLED2
ORDER_STATUS_FILLED3
ORDER_STATUS_CANCELLED4
ORDER_STATUS_REJECTED5
ORDER_STATUS_EXPIRED6
ORDER_STATUS_TRIGGERED7

OrderType

NameNumberDescription
ORDER_TYPE_UNSPECIFIED0
ORDER_TYPE_LIMIT1
ORDER_TYPE_MARKET2
ORDER_TYPE_STOP_MARKET3
ORDER_TYPE_STOP_LIMIT4
ORDER_TYPE_TAKE_PROFIT_MARKET5
ORDER_TYPE_TAKE_PROFIT_LIMIT6

TimeInForce

NameNumberDescription
TIME_IN_FORCE_UNSPECIFIED0
TIME_IN_FORCE_GOOD_TIL_CANCELLED1
TIME_IN_FORCE_IMMEDIATE_OR_CANCEL2
TIME_IN_FORCE_FILL_OR_KILL3
TIME_IN_FORCE_POST_ONLY4

Top

flint/margin/user/v1/order/service.proto

OrderService

Method NameRequest TypeResponse TypeDescription
ListOrdersListOrdersRequestListOrdersResponse
GetOrderGetOrderRequestGetOrderResponse
SubscribeOrdersSubscribeOrdersRequestSubscribeOrdersResponse stream
PreviewOrderPreviewOrderRequestPreviewOrderResponse

Top

flint/margin/user/v1/perp/messages.proto

Fill

FieldTypeLabelDescription
fill_idstring
order_idstring
client_order_idstring
trader_idTraderId
perp_idPerpId
sideTradeSide
priceDecimal
quantityDecimal
fee_usdDecimal
rebate_usdDecimal
makerbool
executed_atTimestamp
provenanceDataProvenance
realized_pnl_usdDecimal

GetFillsRequest

FieldTypeLabelDescription
trader_idTraderId
perp_idsPerpIdrepeated
startTimestamp
endTimestamp
page_sizeuint32
page_tokenstring

GetFillsResponse

FieldTypeLabelDescription
fillsFillrepeated
next_page_tokenstring
coverageHistoryCoverage

GetPositionHistoryRequest

FieldTypeLabelDescription
trader_idTraderId
perp_idsPerpIdrepeated
startTimestamp
endTimestamp
page_sizeuint32
page_tokenstring

GetPositionHistoryResponse

FieldTypeLabelDescription
positionsPositionHistoryEntryrepeated
next_page_tokenstring
coverageHistoryCoverage

GetTradingFeesRequest

FieldTypeLabelDescription
trader_idTraderId
perp_idsPerpIdrepeated

GetTradingFeesResponse

FieldTypeLabelDescription
feesTradingFeesrepeated
provenanceDataProvenance

GetTradingLimitsRequest

FieldTypeLabelDescription
trader_idTraderId
perp_idsPerpIdrepeated

GetTradingLimitsResponse

FieldTypeLabelDescription
limitsTradingLimitsrepeated
provenanceDataProvenance

PerpId

FieldTypeLabelDescription
iduint32

PerpPnlHistory

FieldTypeLabelDescription
pointsPerpPnlHistoryPointrepeated

PerpPnlHistoryPoint

FieldTypeLabelDescription
tsTimestamp
total_pnl_usdDecimal
realized_trading_pnl_usdDecimal
fees_usdDecimal- fees; + rebates/rewards.
funding_usdDecimal+ credit; - debit.

PerpPosition

FieldTypeLabelDescription
perp_idPerpId
quantityDecimalSigned base units: positive long, negative short.
entry_priceDecimal
mark_priceDecimal
notional_usdDecimal
unrealized_pnl_usdDecimal
realized_pnl_usdDecimal
accrued_funding_usdDecimalPositive is an estimated credit to the account, negative a debit.
initial_margin_usdDecimal
maintenance_margin_usdDecimal
liquidation_priceDecimal
statusPerpPositionStatus
opened_atTimestamp
updated_atTimestamp
provenanceDataProvenance

PositionHistoryEntry

FieldTypeLabelDescription
position_idstring
positionPerpPosition
closed_atTimestamp
total_fees_usdDecimal
total_funding_usdDecimal

SubscribeFillsRequest

FieldTypeLabelDescription
trader_idTraderId
perp_idsPerpIdrepeated

TradingFees

FieldTypeLabelDescription
perp_idPerpId
maker_fee_rateDecimal
taker_fee_rateDecimal
maker_rebate_rateDecimal
tierstring
effective_atTimestamp
provenanceDataProvenance

TradingLimits

FieldTypeLabelDescription
perp_idPerpId
max_buy_quantityDecimal
max_sell_quantityDecimal
reduce_only_buy_quantityDecimal
reduce_only_sell_quantityDecimal
available_margin_usdDecimal
provenanceDataProvenance

PerpPositionStatus

NameNumberDescription
PERP_POSITION_STATUS_UNSPECIFIED0
PERP_POSITION_STATUS_OPEN1
PERP_POSITION_STATUS_CLOSED2
PERP_POSITION_STATUS_LIQUIDATED3

TradeSide

NameNumberDescription
TRADE_SIDE_UNSPECIFIED0
TRADE_SIDE_BUY1
TRADE_SIDE_SELL2

Top

flint/margin/user/v1/perp_market/messages.proto

GetMarketHistoryStatsRequest

FieldTypeLabelDescription
perp_idsPerpIdrepeatedEmpty selects every perpetual market; servers accept at most 100 IDs.

GetMarketHistoryStatsResponse

FieldTypeLabelDescription
statsPerpMarketHistoryStatsrepeated
as_ofTimestamp
coverageHistoryCoverage

GetMarketStatsRequest

FieldTypeLabelDescription
perp_idsPerpIdrepeated

GetMarketStatsResponse

FieldTypeLabelDescription
statsMarketStatsrepeated
provenanceDataProvenance

GetPerpMarketRequest

FieldTypeLabelDescription
perp_idPerpId

GetPerpMarketResponse

FieldTypeLabelDescription
marketPerpMarket

GetVolumeBreakdownRequest

FieldTypeLabelDescription
perp_idsPerpIdrepeatedEmpty selects every perpetual market.

GetVolumeBreakdownResponse

FieldTypeLabelDescription
perpsPerpVolumerepeated
coverageHistoryCoverage

GetVolumeSeriesRequest

FieldTypeLabelDescription
perp_idPerpIdUnset aggregates every perpetual market.
windowStatsWindow

GetVolumeSeriesResponse

FieldTypeLabelDescription
bucketsVolumeBucketrepeatedOrdered oldest first, including empty buckets.
bucket_secondsuint32
coverageHistoryCoverage

ListPerpMarketsRequest

FieldTypeLabelDescription
perp_idsPerpIdrepeated
statusesPerpMarketStatusrepeated
page_sizeuint32
page_tokenstring

ListPerpMarketsResponse

FieldTypeLabelDescription
marketsPerpMarketrepeated
next_page_tokenstring
provenanceDataProvenance

MarginTier

FieldTypeLabelDescription
min_position_notional_usdDecimal
initial_margin_rateDecimal
maintenance_margin_rateDecimal

MarketStats

FieldTypeLabelDescription
perp_idPerpId
mark_priceDecimal
index_priceDecimal
oracle_priceDecimal
last_trade_priceDecimal
best_bid_priceDecimal
best_ask_priceDecimal
volume_24hDecimal
price_change_24hDecimalFractional price change over the trailing 24 hours.
open_interestDecimalBase units, counted once per matched long/short pair.
funding_rateDecimal
next_funding_atTimestamp
provenanceDataProvenance
funding_interval_secondsuint64
best_bid_quantityDecimalBase quantity available at the best quoted price.
best_ask_quantityDecimal

PerpMarket

FieldTypeLabelDescription
perp_idPerpId
symbolstring
base_assetSpotMetadata
quote_assetSpotMetadata
settlement_assetSpotMetadata
tick_sizeDecimal
lot_sizeDecimal
min_order_quantityDecimal
max_order_quantityDecimal
max_position_notional_usdDecimal
initial_margin_rateDecimal
maintenance_margin_rateDecimal
statusPerpMarketStatus
provenanceDataProvenance
margin_tiersMarginTierrepeated
max_open_interestDecimal

PerpMarketHistoryStats

FieldTypeLabelDescription
perp_idPerpId
volume_24h_usdDecimalTrailing 24-hour USD volume; absent if unknown or unpriced.
price_change_24h_fractionDecimalFractional price change: current / reference - 1.
price_change_reference_atTimestampCandle end for the exact minute [minute(as_of) - 24h - 1m, minute(as_of) - 24h).
price_change_as_ofTimestampCandle end for the latest traded minute in [minute(as_of) - 4m, as_of), capped at as_of.

PerpVolume

FieldTypeLabelDescription
perp_idPerpId
one_hourVolumeWindow
twenty_four_hourVolumeWindow
thirty_dayVolumeWindow
last_priceDecimal

SubscribeMarketStatsRequest

FieldTypeLabelDescription
perp_idsPerpIdrepeated

SubscribeMarketStatsResponse

FieldTypeLabelDescription
statsMarketStatsrepeated
snapshotbool
sequenceuint64
provenanceDataProvenance

VolumeBucket

FieldTypeLabelDescription
tsTimestamp
volume_usdDecimalAbsent if any fills in the bucket cannot be valued in USD.
fill_countuint64

VolumeWindow

FieldTypeLabelDescription
volume_usdDecimalUSD notional counted once per trade; absent if any fills cannot be valued.
fill_countuint64

PerpMarketStatus

NameNumberDescription
PERP_MARKET_STATUS_UNSPECIFIED0
PERP_MARKET_STATUS_ACTIVE1
PERP_MARKET_STATUS_PAUSED2
PERP_MARKET_STATUS_REDUCE_ONLY3
PERP_MARKET_STATUS_SETTLING4
PERP_MARKET_STATUS_CLOSED5

StatsWindow

NameNumberDescription
STATS_WINDOW_UNSPECIFIED0
STATS_WINDOW_1H1
STATS_WINDOW_24H2
STATS_WINDOW_30D3

Top

flint/margin/user/v1/perp_market/service.proto

PerpMarketService

Method NameRequest TypeResponse TypeDescription
ListPerpMarketsListPerpMarketsRequestListPerpMarketsResponse
GetPerpMarketGetPerpMarketRequestGetPerpMarketResponse
GetMarketStatsGetMarketStatsRequestGetMarketStatsResponse
GetMarketHistoryStatsGetMarketHistoryStatsRequestGetMarketHistoryStatsResponse
GetVolumeBreakdownGetVolumeBreakdownRequestGetVolumeBreakdownResponse
GetVolumeSeriesGetVolumeSeriesRequestGetVolumeSeriesResponse
SubscribeMarketStatsSubscribeMarketStatsRequestSubscribeMarketStatsResponse stream

Top

flint/margin/user/v1/risk/messages.proto

AccountAtRisk

FieldTypeLabelDescription
accountAccountSnapshot
total_deposited_usdDecimal
total_borrowed_usdDecimal
net_assets_usdDecimal
maintenance_buffer_usdDecimalnet_equity - maintenance_margin; negative means liquidatable.
health_ratioDecimalBelow 1 means liquidatable.

AssetPriceShock

FieldTypeLabelDescription
spot_idSpotId
price_changeDecimalSigned fractional price change in [-1, 10]; at most 20 unique spot IDs.

GetInsuranceFundRequest

GetInsuranceFundResponse

FieldTypeLabelDescription
fundInsuranceFund
provenanceDataProvenance

GetMarketOverviewRequest

FieldTypeLabelDescription
non_stable_price_changesDecimalrepeatedSimultaneous signed fractional non-stable oracle changes in [-1, 0]; empty uses defaults.

GetMarketOverviewResponse

FieldTypeLabelDescription
overviewProtocolRiskOverview
marketsMarketRiskOverviewrepeated
liquidation_shocksLiquidationShockRowrepeatedRequest order, or ascending price fall when using defaults.
slotuint64
tsTimestamp
provenanceDataProvenance

InsuranceFund

FieldTypeLabelDescription
addressstring
borrow_lend_socialize_loss_max_drawDecimalMaximum fraction one socialize-loss instruction may draw; 1 permits all.
balancesInsuranceFundBalancerepeated
completeboolFalse when the fund or a listed market vault was not observed.
unavailable_reasonstring

InsuranceFundBalance

FieldTypeLabelDescription
assetSpotMetadata
vaultstring
balanceDecimal

LiquidationShockRow

FieldTypeLabelDescription
non_stable_price_changeDecimal
liquidatable_account_countuint64
bad_debt_account_countuint64optionalUnset when unavailable; liquidation_usd and bad_debt_usd are then unset too.
liquidation_usdDecimalDebt value a liquidation would transfer, including its buffer.
bad_debt_usdDecimal
deficit_usdDecimal

ListAccountsAtRiskRequest

FieldTypeLabelDescription
min_account_size_usdDecimalGross unweighted deposits in USD; unset bounds are open.
max_account_size_usdDecimal
max_health_ratioDecimalMaximum health ratio; unset uses the configured threshold. Accounts without one are excluded.
liquidatable_onlybooloptionalTrue restricts results to liquidatable accounts.
page_sizeuint32Zero uses the server default.
page_tokenstringOpaque token anchoring pagination to one risk snapshot.

ListAccountsAtRiskResponse

FieldTypeLabelDescription
accountsAccountAtRiskrepeatedOrdered by health ratio ascending, account size descending, then trader ID ascending.
total_countuint64Total matching accounts across all pages.
next_page_tokenstring
max_health_ratioDecimalEffective health-ratio cutoff.
slotuint64
tsTimestamp
provenanceDataProvenance

ListLargestAccountsRequest

FieldTypeLabelDescription
page_sizeuint32Zero uses the server default.
page_tokenstringOpaque token anchoring pagination to one risk snapshot.

ListLargestAccountsResponse

FieldTypeLabelDescription
accountsAccountAtRiskrepeatedOrdered by gross supplied assets descending, then trader ID ascending. Accounts without maintenance margin remain included with no health ratio.
total_countuint64Total accounts across all pages.
next_page_tokenstring
slotuint64
tsTimestamp
provenanceDataProvenance

MarketRiskOverview

FieldTypeLabelDescription
marketMarketInfo
is_stableboolHeld fixed in liquidation-shock scenarios.
total_deposited_usdDecimal
total_borrowed_usdDecimal
available_liquidity_usdDecimal
net_deposits_usdDecimal
deposit_limit_usdDecimalUSD market caps; unset when uncapped.
borrow_limit_usdDecimal
deposit_limit_headroom_usdDecimalRemaining cap headroom, floored at zero; unset when uncapped.
borrow_limit_headroom_usdDecimal
initial_borrow_weightDecimalDebt-value factors: 1 + borrow_imf and 1 + borrow_mmf.
maintenance_borrow_weightDecimal
deposit_limit_utilisationDecimalCap usage; may exceed 1 after a cap reduction and is unset when uncapped.
borrow_limit_utilisationDecimal

MonitoredAccountAtRisk

FieldTypeLabelDescription
accountAccountSnapshot
statusMonitoredAccountStatus

ProtocolRiskOverview

FieldTypeLabelDescription
account_countuint64
depositor_countuint64
borrower_countuint64
loan_countuint64Number of non-zero borrow positions.
accounts_at_riskuint64
liquidatable_accountsuint64
total_deposited_usdDecimal
total_borrowed_usdDecimal
available_liquidity_usdDecimal
net_deposits_usdDecimal
protocol_fees_usdDecimal
at_risk_health_ratioDecimal

SimulateAccountRiskRequest

FieldTypeLabelDescription
trader_idTraderId
price_shocksAssetPriceShockrepeatedApplied simultaneously by oracle; conflicting oracle changes are rejected.

SimulateAccountRiskResponse

FieldTypeLabelDescription
currentAccountSnapshot
stressedAccountSnapshot
provenanceDataProvenance

SubscribeAccountsAtRiskRequest

SubscribeAccountsAtRiskResponse

FieldTypeLabelDescription
upsertsMonitoredAccountAtRiskrepeatedUpserts ordered by trader ID; complete replacement when snapshot is true.
removed_trader_idsTraderIdrepeatedIDs to remove; empty for snapshots.
snapshotbool
entry_health_ratioDecimalAdmission and release thresholds; their gap provides hysteresis.
exit_health_ratioDecimal
slotuint64
tsTimestamp
revisionuint64Monotonically non-decreasing valuation revision.
provenanceDataProvenance

MonitoredAccountStatus

NameNumberDescription
MONITORED_ACCOUNT_STATUS_UNSPECIFIED0
MONITORED_ACCOUNT_STATUS_WATCHING1
MONITORED_ACCOUNT_STATUS_LIQUIDATABLE2
MONITORED_ACCOUNT_STATUS_UNAVAILABLE3Account is the last known snapshot and may be stale.

Top

flint/margin/user/v1/risk/service.proto

RiskService

Public read-only margin-risk views.

Method NameRequest TypeResponse TypeDescription
GetMarketOverviewGetMarketOverviewRequestGetMarketOverviewResponse
SimulateAccountRiskSimulateAccountRiskRequestSimulateAccountRiskResponse
GetInsuranceFundGetInsuranceFundRequestGetInsuranceFundResponse
ListAccountsAtRiskListAccountsAtRiskRequestListAccountsAtRiskResponse
SubscribeAccountsAtRiskSubscribeAccountsAtRiskRequestSubscribeAccountsAtRiskResponse stream
ListLargestAccountsListLargestAccountsRequestListLargestAccountsResponse

Top

flint/margin/user/v1/sponsorship/messages.proto

GetSponsorshipPubkeyRequest

GetSponsorshipPubkeyResponse

FieldTypeLabelDescription
pubkeystringBase58 fee payer; leave its signature slot empty for the server.

SponsorTransactionRequest

FieldTypeLabelDescription
transactionbytesWire-format VersionedTransaction with only the empty sponsor signature.

SponsorTransactionResponse

FieldTypeLabelDescription
signaturestringBase58 confirmed transaction signature.

Top

flint/margin/user/v1/sponsorship/service.proto

SponsorshipService

Pays fees for pre-authorized margin transactions; the sponsor is fee payer only. Transactions may invoke only the margin, compute-budget, and secp256r1 programs.

Method NameRequest TypeResponse TypeDescription
GetSponsorshipPubkeyGetSponsorshipPubkeyRequestGetSponsorshipPubkeyResponse
SponsorTransactionSponsorTransactionRequestSponsorTransactionResponse

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)