OVERVIEW
FOR LPs
FOR MINERS
ARCHITECTURE
Your strategy is a function that maps state to positions.
Implement rebalance_query_handler to respond to validator queries. You receive the current state and return your desired positions.
async def rebalance_query_handler(self, synapse: RebalanceQuery) -> RebalanceQuery:
# 1. Decide if you want this job
synapse.accepted = True
# 2. Analyze current state
price = synapse.current_price
positions = synapse.current_positions
inventory = synapse.inventory_remaining
# 3. Return desired positions
synapse.desired_positions = your_strategy(price, positions, inventory)
# 4. Add metadata
synapse.miner_metadata = MinerMetadata(
version="1.0.0",
model_info="my-strategy-v1"
)
return synapse
Each RebalanceQuery includes:
Return current_positions as desired_positions to keep positions unchanged (no rebalance).
<aside> 🎯 Capital preservation beats aggressive fee chasing. The scoring system rewards stability.
</aside>