Documentation Index Fetch the complete documentation index at: https://docs.generalmarket.io/llms.txt
Use this file to discover all available pages before exploring further.
Batch State
The complete state of a single batch — every player, every balance, every commitment. A snapshot of collective conviction at one moment in time.
Get Batch State
GET /vision/batch/{id}/state
Returns every player’s position, balance, and bitmap status. Live data from the in-memory tick scheduler — the truth, as of right now.
The batch ID to query. Must be a valid, existing batch.
curl https://generalmarket.io/api/vision/batch/1/state
import requests
batch_id = 1
response = requests.get( f "https://generalmarket.io/api/vision/batch/ { batch_id } /state" )
state = response.json()
print ( f "Batch { state[ 'id' ] } : { state[ 'player_count' ] } players" )
print ( f "Next tick: { state[ 'next_tick' ] } " )
for player in state[ "players" ]:
print ( f " { player[ 'address' ] } : balance= { player[ 'balance' ] } , bitmap= { player[ 'has_bitmap' ] } " )
const batchId = 1 ;
const res = await fetch ( `https://generalmarket.io/api/vision/batch/ ${ batchId } /state` );
const state = await res . json ();
console . log ( `Batch ${ state . id } : ${ state . player_count } players` );
console . log ( `Next tick: ${ state . next_tick } ` );
for ( const player of state . players ) {
console . log ( ` ${ player . address } : balance= ${ player . balance } , bitmap= ${ player . has_bitmap } ` );
}
{
"id" : 1 ,
"creator" : "0xAbC123...def" ,
"market_ids" : [ "BTC-USD" , "ETH-USD" , "SOL-USD" ],
"tick_duration" : 3600 ,
"created_at_tick" : 475166 ,
"paused" : false ,
"player_count" : 3 ,
"next_tick" : 1708603600 ,
"players" : [
{
"address" : "0x1111...aaaa" ,
"stake_per_tick" : "100000" ,
"balance" : "5000000000000000" ,
"start_tick" : 475166 ,
"has_bitmap" : true
},
{
"address" : "0x2222...bbbb" ,
"stake_per_tick" : "200000" ,
"balance" : "3200000000000000" ,
"start_tick" : 475167 ,
"has_bitmap" : false
},
{
"address" : "0x3333...cccc" ,
"stake_per_tick" : "150000" ,
"balance" : "8100000000000000" ,
"start_tick" : 475166 ,
"has_bitmap" : true
}
]
}
Response Fields
Field Type Description idnumber Batch ID creatorstring Ethereum address of the batch creator market_idsstring[] Market identifiers in this batch tick_durationnumber Seconds between tick resolutions created_at_ticknumber The tick number when the batch was created pausedboolean Whether the batch is paused player_countnumber Number of active players next_ticknumber Unix timestamp of the next tick resolution playersobject[] Array of player positions (see below)
Player Object
Field Type Description addressstring Player’s Ethereum address stake_per_tickstring Amount staked per tick per market, in wei balancestring Current balance in the batch, in wei start_ticknumber The tick number when the player joined has_bitmapboolean Whether the player has submitted a bitmap for the current tick
Players with has_bitmap: false forfeit their stake without participating in outcomes. To have no opinion is not to be safe — it is to lose by default.
Errors
Status Condition 404Batch with the given ID does not exist