Open the app
Data model

Schema · Venues, routing & cost

The Part V operational tables — venues and capabilities, execution quotes and trade costs, AI/API usage, budgets, the model registry, benchmarks and routing logs.

These tables extend the Convex operational model with the venue, routing and cost-governance state introduced in Part V. They hold current state and recent decisions — bulk history still lives in Parquet/DuckDB.

Venues & capabilities

venues

FieldTypeDescription
idIDVenue ID
typestringcex, dex, aggregator, launchpad
ccxt_exchange_idstring, optionalCCXT exchange ID where applicable
chain_idstring, optionalChain for on-chain venues
namestringHuman-readable name
trust_tierinteger0 discovery → 5 fully approved
enabled_for_discoverybooleanSurfaced to the discovery engine
enabled_for_executionbooleanAllowed to receive orders
human_approval_requiredbooleanOrders need a human gate
statusstringActive, degraded, disabled
last_health_check_atdatetimeLast connectivity/health check

venue_capabilities

FieldTypeDescription
venue_idstringOwning venue
capabilitystringe.g. fetchOHLCV, createOrder, watchOrderBook
supportedbooleanVerified support (not just CCXT has.*)
implementationstringccxt, native, aggregator, manual
tested_versionstringCCXT / adapter version contract-tested
last_verified_atdatetimeLast regression verification
notesstring, optionalVenue-specific caveats

Routing & trade cost

execution_quotes

FieldTypeDescription
idIDQuote ID
trade_candidate_idstringCandidate being priced
venue_idstringQuoting venue
routeobjectPools / path / aggregator route
input_amountnumberQuoted input amount
expected_output_amountnumberQuoted output amount
expected_fee_usdnumberTrading/provider fee estimate
expected_gas_usdnumberGas + priority fee estimate
expected_slippage_percentnumberEstimated slippage
expected_price_impact_percentnumberEstimated price impact
provider_fee_usdnumberAggregator/affiliate fee
expires_atdatetimeQuote expiry

trade_costs

FieldTypeDescription
order_idstringOwning order
exchange_fee_usdnumberMaker/taker fee realized
gas_fee_usdnumberNetwork gas
priority_fee_usdnumberPriority fee / validator tip
spread_cost_usdnumberSpread cost
slippage_cost_usdnumberRealized slippage
price_impact_cost_usdnumberRealized price impact
provider_fee_usdnumberAggregator/provider fee
withdrawal_fee_usdnumberWithdrawal fee
bridge_fee_usdnumberBridge fee
failed_transaction_cost_usdnumberGas burned on failed tx
total_cost_usdnumberSum of all cost components

Usage & budgets

ai_usage_logs

FieldTypeDescription
providerstringModel provider
modelstringModel id
agentstringCalling agent
workflowstringWorkflow / graph node
strategy_idstring, optionalRelated strategy
trade_candidate_idstring, optionalRelated candidate
input_tokensintegerPrompt tokens
cached_input_tokensintegerCached prompt tokens
output_tokensintegerCompletion tokens
reasoning_tokensinteger, optionalReasoning tokens where reported
tool_callsintegerTool calls made
estimated_cost_usdnumberEstimated call cost
latency_msintegerRound-trip latency
successbooleanValidated output
created_atdatetimeCall time

external_api_usage_logs

FieldTypeDescription
providerstringData/RPC/social provider
endpointstringEndpoint called
workflowstringCalling workflow
resource_typestringcompute_units, requests, etc.
request_countintegerRequests in this entry
units_consumednumberProvider units consumed
estimated_cost_usdnumberEstimated cost
status_codeinteger, optionalHTTP status
latency_msintegerRound-trip latency
created_atdatetimeCall time

usage_budgets

FieldTypeDescription
scope_typestringprovider, model, agent, strategy, candidate
scope_idstringScoped entity ID
daily_limit_usdnumberDaily cap
monthly_limit_usdnumberMonthly cap
warning_threshold_percentnumberWarn at this %
hard_stop_enabledbooleanBlock paid calls at 100%
fallback_providerstring, optionalFallback provider
fallback_modelstring, optionalFallback model
enabledbooleanBudget active

shared_infrastructure_allocations

FieldTypeDescription
idIDAllocation ID
resource_typestringvps, domain, backup, gpu
resource_namestringResource identifier
periodstringAccounting period
total_resource_cost_usdnumberTotal cost of the shared resource
allocation_methodstringusage_share, fixed, weighted
clawlas_allocation_percentnumberClawlas's share %
allocated_cost_usdnumberAllocated economic cost
cpu_usage_sharenumber, optionalCPU share
memory_usage_sharenumber, optionalMemory share
disk_usage_sharenumber, optionalDisk share
network_usage_sharenumber, optionalNetwork share
created_atdatetimeRecord time

Model registry & routing

model_registry

FieldTypeDescription
idIDRegistry ID
providerstringProvider
model_idstringModel identifier
model_versionstringPinned version
hosting_typestringcloud_api, local_cpu, local_gpu, remote_gpu
endpointstring, optionalServing endpoint
supported_tasksstring[]Tasks this model is eligible for
supports_toolsbooleanTool calling
supports_structured_outputbooleanReliable schema output
context_windowintegerMax context tokens
input_price_per_millionnumber, optionalInput price
cached_input_price_per_millionnumber, optionalCached input price
output_price_per_millionnumber, optionalOutput price
estimated_local_cost_per_hournumber, optionalLocal serving cost/hour
privacy_classstringPrivacy tier
fallback_groupstring, optionalFallback group
enabledbooleanAvailable to the router
created_atdatetimeCreation date
updated_atdatetimeLast update

model_task_benchmarks

FieldTypeDescription
idIDBenchmark ID
model_registry_idstringBenchmarked model
task_typestringTask evaluated
benchmark_versionstringGolden-dataset version
sample_countintegerSamples evaluated
quality_scorenumberTask-specific quality
schema_success_ratenumberValid-schema rate
false_positive_ratenumber, optionalFP rate
false_negative_ratenumber, optionalFN rate
p50_latency_msintegerMedian latency
p95_latency_msintegerTail latency
cost_per_valid_result_usdnumberCost per valid result
evaluated_atdatetimeEvaluation time

model_routing_logs

FieldTypeDescription
idIDRouting decision ID
workflowstringCalling workflow
task_typestringTask routed
risk_levelstringTask risk level
expected_value_usdnumber, optionalExpected value of the task
candidate_modelsarrayConsidered candidates
selected_model_registry_idstring, optionalChosen model
selected_route_typestringdeterministic, cache, local, cloud, premium, human
selection_reasonobjectWhy this route won
estimated_cost_usdnumberPre-call estimate
actual_cost_usdnumberRealized cost
latency_msintegerLatency
validation_passedbooleanOutput validated
fallback_usedbooleanFallback triggered
escalation_countintegerEscalations taken
created_atdatetimeDecision time
Identity & trust
A venue is keyed by its CCXT id or chain, carries a trust tier 0–5, and gates execution; venue_capabilities records what was actually verified (not just what CCXT has.* reports) and the version it was tested against.

Field lists are conceptual — Convex v.* validators and the shared Zod schemas are the source of truth in code.