flint.margin.user.v1 reference
Table of Contents
Top
flint/margin/user/v1/account/messages.proto
AccountHealth
Cross-margin account health in USD.
Field Type Label Description net_equity Decimal initial_margin Decimal Required to borrow or withdraw collateral. maintenance_margin Decimal net_exposure Decimal meets_initial_margin bool meets_maintenance_margin bool free_collateral Decimal net_equity minus initial_margin, floored at zero. deficit Decimal maintenance_margin minus net_equity, floored at zero. health_ratio Decimal net_equity / maintenance_margin; unset when maintenance margin is zero. can_open_position bool Requires initial margin and positive equity. can_be_backstopped bool Whether a backstopper may take over the account's legs.
AccountHistoryPoint
One archived account-value sample.
Field Type Label Description ts Timestamp Bucket start; uses its newest sample. observed_at Timestamp Server observation time, not block time. slot uint64 Highest observed tip; may not increase between points. nav_usd Decimal Unweighted signed account value. pnl_usd Decimal nav_usd minus deposits; estimated and unset without complete ledger coverage. net_exposure Decimal debt_usd Decimal health_ratio Decimal net_equity / maintenance_margin; unset when maintenance margin is zero. provenance DataProvenance
AccountRef
Field Type Label Description trader_id TraderId owner string is_delegate bool True when the requested authority is a delegate rather than the owner. address string name string World-readable display label, including when is_name_public is false; empty when unset. is_name_public bool Whether the label is shown on rankings; defaults to false, not an access-control flag.
AccountSnapshot
ActionLimit
ActivityEntry
BatchGetAccountsRequest
Field Type Label Description trader_ids TraderId repeated Required; at most 100 unique IDs. Results preserve request order.
BatchGetAccountsResponse
DelegateInfo
GetAccountHistoryRequest
Field Type Label Description trader_id TraderId start Timestamp Inclusive; unset selects 24 hours before end. end Timestamp Exclusive; unset selects now. resolution_seconds uint32 Zero lets the server choose; non-zero is exact or INVALID_ARGUMENT. include_perp_pnl bool
GetAccountHistoryResponse
GetAccountRequest
Field Type Label Description trader_id TraderId
GetAccountResponse
GetActionLimitsRequest
Field Type Label Description trader_id TraderId spot_ids SpotId repeated Empty selects every listed market.
GetActionLimitsResponse
GetActivityRequest
Field Type Label Description trader_id TraderId start Timestamp Inclusive; unset selects the whole ledger. end Timestamp Exclusive; unset selects now. limit uint32 Zero uses the default (50); maximum 1000. kinds ActivityKind repeated Empty selects every kind; UNSPECIFIED values are ignored. page_token string
GetActivityResponse
GetRankedAccountsRequest
Field Type Label Description metric AccountRankingMetric All metrics sort descending except CLOSEST_TO_LIQUIDATION. timeframe AccountRankingTimeframe Historical windows are rolling 24h, 7d, or 30d completed hours. Current-state rankings ignore this field and leave response windows unset. minimum_account_value AccountRankingSize Minimum unweighted USD economic NAV. limit uint32 Zero uses the default (20); maximum 100. Results are not paginated.
GetRankedAccountsResponse
ListAccountsRequest
Field Type Label Description authority string Base58 owner or delegate pubkey.
ListAccountsResponse
ListDelegatesRequest
Field Type Label Description trader_id TraderId include_inactive bool
ListDelegatesResponse
MarketActionLimits
Per-market action limits at the response state; they may change before submission.
RankedAccount
Field Type Label Description trader_id TraderId owner string Live identity and statistics may be absent for historical-only accounts. address string account_value_usd Decimal Unweighted USD economic NAV. metric_value Decimal rank uint32 open_interest_usd Decimal Current statistics are independent of the historical ranking window. leverage Decimal Gross perp notional / positive economic NAV; absent otherwise. health_ratio Decimal open_position_count uint32 optional Number of perp positions with nonzero quantity. account_equity_usd Decimal Net equity from current account health, including collateral weights. performance_start Timestamp First observation used for performance; all-time begins with eligible NAV history. name string Only 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>
Field Type Label Description trader_id TraderId authority string Base58 signing owner or delegate pubkey. name string Empty clears the label. Trimmed; maximum 32 characters. Sign the trimmed value. expires_at uint64 Unix seconds, at most 120 seconds ahead. signature bytes is_public bool optional Omission resets leaderboard visibility to false, including for an already-public label.
RenameAccountResponse
SimulateActionRequest
Simulates an action without signing or submitting it.
Field Type Label Description trader_id TraderId spot_id SpotId action SpotAction amount Decimal Token units; excess asset precision is rejected. authority string Base58 owner or registered delegate pubkey used for simulation. create_token_account bool Creates the signer's token account; rejected for actions that move no tokens. wrap_lamports uint64 Lamports to wrap before a wrapped-SOL deposit; zero disables wrapping.
SimulateActionResponse
Simulation result and post-state.
Field Type Label Description error string Empty on success; otherwise the node's transaction error. logs string repeated compute_units uint64 Minimum compute-unit limit for the simulated transaction. account AccountSnapshot Simulated post-state; unset on error. ts Timestamp program_error string Stable margin-program error name; empty for failures from other programs. provenance DataProvenance
SpotPosition
One spot leg. Amounts are token units.
Field Type Label Description spot_id SpotId raw_deposit Decimal Idle collateral that earns no interest. lent Decimal borrowed Decimal value_usd Decimal Unweighted USD value. deposit_shares Decimal Raw pool share counts. borrow_shares Decimal weighted_collateral_usd Decimal USD collateral after the deposit-weight haircut; zero for a net borrow. debt_usd Decimal USD debt; zero for a net deposit. initial_margin_usd Decimal maintenance_margin_usd Decimal liquidation_price Decimal USD token price at maintenance margin; unset when no single-asset move can reach it.
SubscribeAccountRequest
Field Type Label Description trader_id TraderId
SubscribeAccountsRequest
Field Type Label Description trader_ids TraderId repeated
SubscribeAccountsResponse
Each message replaces the selected account set; intermediate states may coalesce.
SubscribeActivityRequest
AccountRankingMetric
Name Number Description ACCOUNT_RANKING_METRIC_UNSPECIFIED 0 ACCOUNT_RANKING_METRIC_PNL 1 Signed USD NAV change minus external cash flows. ACCOUNT_RANKING_METRIC_PNL_PERCENT 2 Linked hourly Modified Dietz returns, in percent (10 means 10%). ACCOUNT_RANKING_METRIC_VOLUME 3 Sum over completed-hour buckets in the selected timeframe. ACCOUNT_RANKING_METRIC_ACCOUNT_VALUE 4 ACCOUNT_RANKING_METRIC_OPEN_INTEREST 5 ACCOUNT_RANKING_METRIC_CLOSEST_TO_LIQUIDATION 6 Health ratio ascending; accounts without usable prices are excluded. ACCOUNT_RANKING_METRIC_LARGEST_LIQUIDATION 7 Largest single liquidation, not the sum, over completed-hour buckets. ACCOUNT_RANKING_METRIC_SHARPE_RATIO 8 Annualized hourly Sharpe, zero risk-free rate; requires 24 returns.
AccountRankingSize
Name Number Description ACCOUNT_RANKING_SIZE_UNSPECIFIED 0 No minimum account value. ACCOUNT_RANKING_SIZE_USD_100 1 ACCOUNT_RANKING_SIZE_USD_1000 2 ACCOUNT_RANKING_SIZE_USD_10000 3 ACCOUNT_RANKING_SIZE_USD_100000 4 ACCOUNT_RANKING_SIZE_USD_1000000 5
AccountRankingTimeframe
Name Number Description ACCOUNT_RANKING_TIMEFRAME_UNSPECIFIED 0 ACCOUNT_RANKING_TIMEFRAME_DAY 1 ACCOUNT_RANKING_TIMEFRAME_WEEK 2 ACCOUNT_RANKING_TIMEFRAME_MONTH 3 ACCOUNT_RANKING_TIMEFRAME_ALL_TIME 4 All observed history.
ActivityKind
Name Number Description ACTIVITY_KIND_UNSPECIFIED 0 ACTIVITY_KIND_DEPOSIT 1 ACTIVITY_KIND_WITHDRAW 2 ACTIVITY_KIND_LEND 3 ACTIVITY_KIND_REDEEM 4 ACTIVITY_KIND_BORROW 5 ACTIVITY_KIND_REPAY 6 ACTIVITY_KIND_SOCIALIZE_LOSS 7 Bad debt written off this account.
DelegateCredentialKind
Name Number Description DELEGATE_CREDENTIAL_KIND_UNSPECIFIED 0 DELEGATE_CREDENTIAL_KIND_ED25519 1 DELEGATE_CREDENTIAL_KIND_PASSKEY 2
LimitConstraint
Constraint on an action amount.
Name Number Description LIMIT_CONSTRAINT_UNSPECIFIED 0 LIMIT_CONSTRAINT_BALANCE 1 The available balance; deposit uses uint64 maximum because wallet balance is unknown. LIMIT_CONSTRAINT_INITIAL_MARGIN 2 LIMIT_CONSTRAINT_POOL_LIQUIDITY 3 LIMIT_CONSTRAINT_UTILISATION_THROTTLE 4 LIMIT_CONSTRAINT_MARKET_CAP 5 LIMIT_CONSTRAINT_FLOW_CAP 6 LIMIT_CONSTRAINT_OPERATION_DISABLED 7 For borrow, the redeem flag also applies. LIMIT_CONSTRAINT_POSITION_LIMIT 8 A new position would exceed the account's spot-position limit.
SpotAction
Name Number Description SPOT_ACTION_UNSPECIFIED 0 SPOT_ACTION_DEPOSIT 1 SPOT_ACTION_WITHDRAW 2 Debits only the idle deposit and never borrows; must leave initial margin met. SPOT_ACTION_LEND 3 SPOT_ACTION_REDEEM 4 SPOT_ACTION_BORROW 5 SPOT_ACTION_REPAY 6
Top
flint/margin/user/v1/account/service.proto
AccountService
Top
flint/margin/user/v1/action/messages.proto
ActionDetail
Field Type Label Description label string For example "Est. fill". value string For example "102.31".
ActionPreviewRow
Field Type Label Description index uint32 The action's index in the request. step uint32 When 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. title string The sentence the trading app shows for this action. status ActionPreviewStatus details ActionDetail repeated warnings string repeated blocked_reason string
AssetAction
CancelOrderAction
Set target: unset is INVALID_ARGUMENT.
Field Type Label Description market string order_id string `<perpId>:<buy all bool Every 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
Field Type Label Description market string fraction uint32 Percent of the position to close at market: 25, 50, 75 or 100, else INVALID_ARGUMENT. max_slippage_bps uint32 optional 1 to 1000, as for a market order. Absent is 500, written into the link.
PlaceOrderAction
Field Type Label Description market string side ActionOrderSide size Decimal A multiple of the market's lot size; never rounded. order_type ActionOrderType limit_price Decimal Limit orders only, and required for them. A multiple of the market's tick. max_slippage_bps uint32 optional Market 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_force ActionTimeInForce Limit orders only; on a market order, anything but UNSPECIFIED is INVALID_ARGUMENT. reduce_only bool post_only bool Limit GTC orders only, else INVALID_ARGUMENT.
PreviewActionsRequest
Field Type Label Description trader_id TraderId The account the actions are for. Its owner reviews and signs them. actions TraderAction repeated 1 to 10 actions. expires_in_secs uint32 optional How long the link stays valid. Absent is 600; 1 to 900, else INVALID_ARGUMENT.
PreviewActionsResponse
Field Type Label Description rows ActionPreviewRow repeated One per action, in the order they run. link string The 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_at Timestamp slot uint64 The slot the checks read. warnings string repeated About the batch as a whole: why there is no link, and that actions were checked alone.
SettlePnlAction
Set target: unset is INVALID_ARGUMENT.
Field Type Label Description market string all bool Every 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.
TransferAction
Field Type Label Description asset string amount Decimal to_trader_id TraderId Another account with the same owner.
ActionOrderSide
UNSPECIFIED is INVALID_ARGUMENT.
Name Number Description ACTION_ORDER_SIDE_UNSPECIFIED 0 ACTION_ORDER_SIDE_LONG 1 ACTION_ORDER_SIDE_SHORT 2
ActionOrderType
UNSPECIFIED is INVALID_ARGUMENT.
Name Number Description ACTION_ORDER_TYPE_UNSPECIFIED 0 ACTION_ORDER_TYPE_MARKET 1 Fill or kill within max_slippage_bps of the mark the trader reviews. ACTION_ORDER_TYPE_LIMIT 2
ActionPreviewStatus
Name Number Description ACTION_PREVIEW_STATUS_UNSPECIFIED 0 ACTION_PREVIEW_STATUS_READY 1 ACTION_PREVIEW_STATUS_WARNING 2 Can be approved; see warnings. ACTION_PREVIEW_STATUS_BLOCKED 3 Can't be approved; see blocked_reason. Any BLOCKED row means no link.
ActionTimeInForce
Name Number Description ACTION_TIME_IN_FORCE_UNSPECIFIED 0 GTC. ACTION_TIME_IN_FORCE_GTC 1 ACTION_TIME_IN_FORCE_IOC 2 ACTION_TIME_IN_FORCE_FOK 3
Top
flint/margin/user/v1/action/service.proto
ActionService
Method Name Request Type Response Type Description PreviewActions PreviewActionsRequest PreviewActionsResponse Checks 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.
Decimal
Decimal string (e.g. "155.14"), parsed with rust_decimal-compatible semantics.
Field Type Label Description value string
HistoryCoverage
Effective query window [start, end). Complete only when coverage is proven.
SpotId
On-chain spot-asset id (u32 on-chain, unlike flint.spot.v1's u64).
Field Type Label Description id uint32
Field Type Label Description id SpotId name string mint string decimals uint32 token_program string Base58 mint owner program (SPL Token or Token-2022). icon string product_id uint64 optional On-chain catalog product ID; separate from id and unset on older servers.
Timestamp
Unix microseconds since epoch. Zero means unspecified.
Field Type Label Description micros uint64
TraderId
On-chain margin-account ID chosen by its creator.
Field Type Label Description id uint64
Commitment
Name Number Description COMMITMENT_UNSPECIFIED 0 COMMITMENT_PROCESSED 1 COMMITMENT_CONFIRMED 2 COMMITMENT_FINALIZED 3
Top
flint/margin/user/v1/funding/messages.proto
FundingPayment
FundingRate
GetFundingPaymentsRequest
GetFundingPaymentsResponse
GetFundingRateHistoryRequest
Field Type Label Description perp_ids PerpId repeated start Timestamp end Timestamp page_size uint32 page_token string bucket_seconds uint32 0 returns every sample. Otherwise returns only each perp's last sample in every epoch-aligned bucket_seconds window of funding_at.
GetFundingRateHistoryResponse
GetFundingRatesRequest
Field Type Label Description perp_ids PerpId repeated
GetFundingRatesResponse
SubscribeFundingPaymentsRequest
SubscribeFundingPaymentsResponse
SubscribeFundingRatesRequest
Field Type Label Description perp_ids PerpId repeated
SubscribeFundingRatesResponse
Top
flint/margin/user/v1/funding/service.proto
FundingService
Top
flint/margin/user/v1/history/messages.proto
GetInterestHistoryRequest
Field Type Label Description trader_id TraderId spot_ids SpotId repeated Empty selects every observed spot asset. start Timestamp Inclusive. Unset / zero-micros selects 24 hours before end. end Timestamp Exclusive. Unset / zero-micros selects now. resolution_seconds uint32 Zero lets the server choose a bucket width that fits its point limit.
GetInterestHistoryResponse
GetMarketHistoryRequest
Field Type Label Description spot_id SpotId start Timestamp Inclusive. Unset / zero-micros selects 24 hours before end. end Timestamp Exclusive. Unset / zero-micros selects now. resolution_seconds uint32 Zero lets the server choose a bucket width that fits its point limit.
GetMarketHistoryResponse
InterestHistoryPoint
Field Type Label Description spot_id SpotId ts Timestamp Start of the requested bucket. earned Decimal Token interest earned; unset when the ledger cannot establish it. paid Decimal Token interest paid; unset when the ledger cannot establish it. unavailable_reason string Why one or both values are absent. Empty only when both are known. provenance DataProvenance
MarketHistoryPoint
Top
flint/margin/user/v1/market/messages.proto
FlowCap
Per-market net-flow limiter.
Field Type Label Description deposit_capped bool withdraw_capped bool max_deposit Decimal Net-inflow ceiling in token units; unset when uncapped. max_withdraw Decimal Net-outflow ceiling, token units. Unset when uncapped. deposit_headroom Decimal Current token-unit headroom; unset when uncapped. withdraw_headroom Decimal
GetMarketRequest
Field Type Label Description spot_id SpotId
GetMarketResponse
InterestRateCurve
Live piecewise-linear borrow-rate curve in utilisation.
Field Type Label Description target_utilisation Decimal Curve kink; bounded on-chain to [0.05, 0.95]. apr_at_zero Decimal apr_at_target Decimal apr_at_full Decimal
ListMarketsRequest
ListMarketsResponse
MarketFlags
Operations currently accepted by the market.
Field Type Label Description deposit_enabled bool withdraw_enabled bool lend_enabled bool borrow_enabled bool redeem_enabled bool
MarketInfo
Lending-market state. Token amounts are token units.
Field Type Label Description asset SpotMetadata deposit_weight Decimal Deposit-value haircut for collateral. borrow_imf Decimal borrow_mmf Decimal oracle_price Decimal USD per token unit. deposit_share_price Decimal Token units per pool share. borrow_share_price Decimal total_deposits Decimal Total supplied token units, including isolated deposits. total_borrows Decimal utilisation Decimal total_borrows / total_deposits; distinct from vault_utilisation. deposit_apr Decimal Nominal annual rates at current utilisation. borrow_apr Decimal slot uint64 ts Timestamp liquidation_bonus Decimal Collateral bonus per unit of debt repaid by a liquidator. lending_rate_fee Decimal Protocol share of interest, already reflected in deposit_apr. protocol_fee Decimal Unpaid protocol interest in token units. throttle_borrow_utilisation Decimal Vault utilisation at or above which the chain rejects a new borrow. throttle_redeem_utilisation Decimal Vault utilisation at which the chain rejects redeeming lent deposits. deposit_limit Decimal Total-asset ceiling in token units; unset when uncapped. borrow_limit Decimal Pool-borrow ceiling in token units; unset when uncapped. flags MarketFlags flow_cap FlowCap total_isolated_deposit Decimal Idle, unlent deposits in token units. vault_utilisation Decimal total_borrows / lent pool; capped at 1. available_liquidity Decimal Current borrow/redeem headroom in token units. total_deposit_shares Decimal Raw pool-share totals. total_borrow_shares Decimal last_accrual_at Timestamp Interest-accrual time; share prices and APRs are as of this time. rate_curve InterestRateCurve address string vault string oracle OracleInfo provenance DataProvenance
OracleInfo
Market oracle source and cache freshness.
Field Type Label Description last_synced_at Timestamp valid_until Timestamp On-chain reads after this time are rejected. oracle_id uint32 Registry oracle ID; markets with the same ID share a price. sources OracleSource repeated Configured slots in order; empty until indexed.
OracleSource
One oracle source slot.
SubscribeMarketsRequest
Field Type Label Description spot_ids SpotId repeated Empty selects every listed market.
OracleProvider
Name Number Description ORACLE_PROVIDER_UNSPECIFIED 0 ORACLE_PROVIDER_DEV 1 ORACLE_PROVIDER_PYTH 2 ORACLE_PROVIDER_CHAINLINK 3
Top
flint/margin/user/v1/market/service.proto
MarketService
Public catalog and live state of lending markets.
Top
flint/margin/user/v1/market_data/messages.proto
Candle
GetCandlesRequest
GetCandlesResponse
GetOrderBookRequest
GetOrderBookResponse
GetTradesRequest
GetTradesResponse
OrderBookLevel
OrderBookSnapshot
PublicTrade
SubscribeCandlesRequest
SubscribeCandlesResponse
SubscribeOrderBookRequest
SubscribeOrderBookResponse
Field Type Label Description order_book OrderBookSnapshot Snapshot replaces the book. Deltas replace sizes by price; zero deletes. snapshot bool sequence uint64 previous_sequence uint64
SubscribeTradesRequest
Field Type Label Description perp_ids PerpId repeated
SubscribeTradesResponse
CandleInterval
Name Number Description CANDLE_INTERVAL_UNSPECIFIED 0 CANDLE_INTERVAL_1_MINUTE 1 CANDLE_INTERVAL_5_MINUTES 2 CANDLE_INTERVAL_15_MINUTES 3 CANDLE_INTERVAL_1_HOUR 4 CANDLE_INTERVAL_4_HOURS 5 CANDLE_INTERVAL_1_DAY 6
CandlePriceSource
Name Number Description CANDLE_PRICE_SOURCE_UNSPECIFIED 0 CANDLE_PRICE_SOURCE_TRADES 1 CANDLE_PRICE_SOURCE_MARK 2 CANDLE_PRICE_SOURCE_INDEX 3
Top
flint/margin/user/v1/market_data/service.proto
MarketDataService
Top
flint/margin/user/v1/notifications/messages.proto
RequestEmailVerificationRequest
Field Type Label Description email string
RequestEmailVerificationResponse
Field Type Label Description challenge_id string expires_at_ms uint64 Unix epoch milliseconds. retry_after_ms uint64 Milliseconds 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.
Field Type Label Description delivery_available bool False when this server cannot send verification or fill emails. email_address string Verified destination only; empty when no email destination is enabled. email_enabled bool
VerifyEmailRequest
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.
Top
flint/margin/user/v1/order/messages.proto
GetOrderRequest
GetOrderResponse
Field Type Label Description order Order
ListOrdersRequest
ListOrdersResponse
Order
PreviewOrder
PreviewOrderRequest
PreviewOrderResponse
SubscribeOrdersRequest
SubscribeOrdersResponse
OrderStatus
Name Number Description ORDER_STATUS_UNSPECIFIED 0 ORDER_STATUS_OPEN 1 ORDER_STATUS_PARTIALLY_FILLED 2 ORDER_STATUS_FILLED 3 ORDER_STATUS_CANCELLED 4 ORDER_STATUS_REJECTED 5 ORDER_STATUS_EXPIRED 6 ORDER_STATUS_TRIGGERED 7
OrderType
Name Number Description ORDER_TYPE_UNSPECIFIED 0 ORDER_TYPE_LIMIT 1 ORDER_TYPE_MARKET 2 ORDER_TYPE_STOP_MARKET 3 ORDER_TYPE_STOP_LIMIT 4 ORDER_TYPE_TAKE_PROFIT_MARKET 5 ORDER_TYPE_TAKE_PROFIT_LIMIT 6
TimeInForce
Name Number Description TIME_IN_FORCE_UNSPECIFIED 0 TIME_IN_FORCE_GOOD_TIL_CANCELLED 1 TIME_IN_FORCE_IMMEDIATE_OR_CANCEL 2 TIME_IN_FORCE_FILL_OR_KILL 3 TIME_IN_FORCE_POST_ONLY 4
Top
flint/margin/user/v1/order/service.proto
OrderService
Top
flint/margin/user/v1/perp/messages.proto
Fill
GetFillsRequest
GetFillsResponse
GetPositionHistoryRequest
GetPositionHistoryResponse
GetTradingFeesRequest
GetTradingFeesResponse
GetTradingLimitsRequest
GetTradingLimitsResponse
PerpId
Field Type Label Description id uint32
PerpPnlHistory
PerpPnlHistoryPoint
PerpPosition
PositionHistoryEntry
SubscribeFillsRequest
TradingFees
TradingLimits
PerpPositionStatus
Name Number Description PERP_POSITION_STATUS_UNSPECIFIED 0 PERP_POSITION_STATUS_OPEN 1 PERP_POSITION_STATUS_CLOSED 2 PERP_POSITION_STATUS_LIQUIDATED 3
TradeSide
Name Number Description TRADE_SIDE_UNSPECIFIED 0 TRADE_SIDE_BUY 1 TRADE_SIDE_SELL 2
Top
flint/margin/user/v1/perp_market/messages.proto
GetMarketHistoryStatsRequest
Field Type Label Description perp_ids PerpId repeated Empty selects every perpetual market; servers accept at most 100 IDs.
GetMarketHistoryStatsResponse
GetMarketStatsRequest
Field Type Label Description perp_ids PerpId repeated
GetMarketStatsResponse
GetPerpMarketRequest
Field Type Label Description perp_id PerpId
GetPerpMarketResponse
GetVolumeBreakdownRequest
Field Type Label Description perp_ids PerpId repeated Empty selects every perpetual market.
GetVolumeBreakdownResponse
GetVolumeSeriesRequest
Field Type Label Description perp_id PerpId Unset aggregates every perpetual market. window StatsWindow
GetVolumeSeriesResponse
ListPerpMarketsRequest
ListPerpMarketsResponse
MarginTier
Field Type Label Description min_position_notional_usd Decimal initial_margin_rate Decimal maintenance_margin_rate Decimal
MarketStats
PerpMarket
PerpMarketHistoryStats
Field Type Label Description perp_id PerpId volume_24h_usd Decimal Trailing 24-hour USD volume; absent if unknown or unpriced. price_change_24h_fraction Decimal Fractional price change: current / reference - 1. price_change_reference_at Timestamp Candle end for the exact minute [minute(as_of) - 24h - 1m, minute(as_of) - 24h). price_change_as_of Timestamp Candle end for the latest traded minute in [minute(as_of) - 4m, as_of), capped at as_of.
PerpVolume
SubscribeMarketStatsRequest
Field Type Label Description perp_ids PerpId repeated
SubscribeMarketStatsResponse
VolumeBucket
Field Type Label Description ts Timestamp volume_usd Decimal Absent if any fills in the bucket cannot be valued in USD. fill_count uint64
VolumeWindow
Field Type Label Description volume_usd Decimal USD notional counted once per trade; absent if any fills cannot be valued. fill_count uint64
PerpMarketStatus
Name Number Description PERP_MARKET_STATUS_UNSPECIFIED 0 PERP_MARKET_STATUS_ACTIVE 1 PERP_MARKET_STATUS_PAUSED 2 PERP_MARKET_STATUS_REDUCE_ONLY 3 PERP_MARKET_STATUS_SETTLING 4 PERP_MARKET_STATUS_CLOSED 5
StatsWindow
Name Number Description STATS_WINDOW_UNSPECIFIED 0 STATS_WINDOW_1H 1 STATS_WINDOW_24H 2 STATS_WINDOW_30D 3
Top
flint/margin/user/v1/perp_market/service.proto
PerpMarketService
Top
flint/margin/user/v1/risk/messages.proto
AccountAtRisk
Field Type Label Description account AccountSnapshot total_deposited_usd Decimal total_borrowed_usd Decimal net_assets_usd Decimal maintenance_buffer_usd Decimal net_equity - maintenance_margin; negative means liquidatable. health_ratio Decimal Below 1 means liquidatable.
AssetPriceShock
Field Type Label Description spot_id SpotId price_change Decimal Signed fractional price change in [-1, 10]; at most 20 unique spot IDs.
GetInsuranceFundRequest
GetInsuranceFundResponse
GetMarketOverviewRequest
Field Type Label Description non_stable_price_changes Decimal repeated Simultaneous signed fractional non-stable oracle changes in [-1, 0]; empty uses defaults.
GetMarketOverviewResponse
InsuranceFund
Field Type Label Description address string borrow_lend_socialize_loss_max_draw Decimal Maximum fraction one socialize-loss instruction may draw; 1 permits all. balances InsuranceFundBalance repeated complete bool False when the fund or a listed market vault was not observed. unavailable_reason string
InsuranceFundBalance
LiquidationShockRow
Field Type Label Description non_stable_price_change Decimal liquidatable_account_count uint64 bad_debt_account_count uint64 optional Unset when unavailable; liquidation_usd and bad_debt_usd are then unset too. liquidation_usd Decimal Debt value a liquidation would transfer, including its buffer. bad_debt_usd Decimal deficit_usd Decimal
ListAccountsAtRiskRequest
Field Type Label Description min_account_size_usd Decimal Gross unweighted deposits in USD; unset bounds are open. max_account_size_usd Decimal max_health_ratio Decimal Maximum health ratio; unset uses the configured threshold. Accounts without one are excluded. liquidatable_only bool optional True restricts results to liquidatable accounts. page_size uint32 Zero uses the server default. page_token string Opaque token anchoring pagination to one risk snapshot.
ListAccountsAtRiskResponse
Field Type Label Description accounts AccountAtRisk repeated Ordered by health ratio ascending, account size descending, then trader ID ascending. total_count uint64 Total matching accounts across all pages. next_page_token string max_health_ratio Decimal Effective health-ratio cutoff. slot uint64 ts Timestamp provenance DataProvenance
ListLargestAccountsRequest
Field Type Label Description page_size uint32 Zero uses the server default. page_token string Opaque token anchoring pagination to one risk snapshot.
ListLargestAccountsResponse
Field Type Label Description accounts AccountAtRisk repeated Ordered by gross supplied assets descending, then trader ID ascending. Accounts without maintenance margin remain included with no health ratio. total_count uint64 Total accounts across all pages. next_page_token string slot uint64 ts Timestamp provenance DataProvenance
MarketRiskOverview
Field Type Label Description market MarketInfo is_stable bool Held fixed in liquidation-shock scenarios. total_deposited_usd Decimal total_borrowed_usd Decimal available_liquidity_usd Decimal net_deposits_usd Decimal deposit_limit_usd Decimal USD market caps; unset when uncapped. borrow_limit_usd Decimal deposit_limit_headroom_usd Decimal Remaining cap headroom, floored at zero; unset when uncapped. borrow_limit_headroom_usd Decimal initial_borrow_weight Decimal Debt-value factors: 1 + borrow_imf and 1 + borrow_mmf. maintenance_borrow_weight Decimal deposit_limit_utilisation Decimal Cap usage; may exceed 1 after a cap reduction and is unset when uncapped. borrow_limit_utilisation Decimal
MonitoredAccountAtRisk
ProtocolRiskOverview
SimulateAccountRiskRequest
Field Type Label Description trader_id TraderId price_shocks AssetPriceShock repeated Applied simultaneously by oracle; conflicting oracle changes are rejected.
SimulateAccountRiskResponse
SubscribeAccountsAtRiskRequest
SubscribeAccountsAtRiskResponse
Field Type Label Description upserts MonitoredAccountAtRisk repeated Upserts ordered by trader ID; complete replacement when snapshot is true. removed_trader_ids TraderId repeated IDs to remove; empty for snapshots. snapshot bool entry_health_ratio Decimal Admission and release thresholds; their gap provides hysteresis. exit_health_ratio Decimal slot uint64 ts Timestamp revision uint64 Monotonically non-decreasing valuation revision. provenance DataProvenance
MonitoredAccountStatus
Name Number Description MONITORED_ACCOUNT_STATUS_UNSPECIFIED 0 MONITORED_ACCOUNT_STATUS_WATCHING 1 MONITORED_ACCOUNT_STATUS_LIQUIDATABLE 2 MONITORED_ACCOUNT_STATUS_UNAVAILABLE 3 Account is the last known snapshot and may be stale.
Top
flint/margin/user/v1/risk/service.proto
RiskService
Public read-only margin-risk views.
Top
Field Type Label Description pubkey string Base58 fee payer; leave its signature slot empty for the server.
Field Type Label Description transaction bytes Wire-format VersionedTransaction with only the empty sponsor signature.
Field Type Label Description signature string Base58 confirmed transaction signature.
Top
Pays fees for pre-authorized margin transactions; the sponsor is fee payer only.
Transactions may invoke only the margin, compute-budget, and secp256r1 programs.
Scalar Value Types
.proto Type Notes C++ Java Python Go C# PHP Ruby doubledouble double float float64 double float Float floatfloat float float float32 float float Float int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum 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. int64 long int/long int64 long integer/string Bignum uint32Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required) uint64Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required) sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required) sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required) fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum sfixed32Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required) sfixed64Always eight bytes. int64 long int/long int64 long integer/string Bignum boolbool boolean boolean bool bool boolean TrueClass/FalseClass stringA string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8) bytesMay contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)