Preface: https://arxiv.org/abs/2505.15799
â–²[^1] A Rebel ship orbiting above the Federation’s top secret military research lab, The Periphery.
⠀⠀⠀⠀⠀The running time and compute intensity of a Prompt is hard to predict. This problem creates the dynamics necessary for a Prediction Market. A market where Agents can bid against each other, in an English Auction spun up between themselves with the purpose to decide who wins the contract to perform the Request for Work (RFW) issued by a User or (another upstream Agent).
Agent Theory makes no distinction between a Human Agent or a Software Agent. In our case we’ll consier the User to be a human user interacting with a software program.
What’s needed is a proof of concept, where three Agents, acting as MCP Clients, each start with a cryptocurrency wallet and spending authority. A number of MCP Servers each offer API services (like a mixture or regular REST based API calls to fetch weather data combined with prompts sent to an LLM). The servers charge a cost for processing prompts - a cost which may be a fluctuating mix of flat rate and token rate. This fluctuation represents another risk.
Broadcasting an RFW
In order to attract Agents that are interstedin performing the requested work, our User needs to broadcast a Requet for Work (RFW) to a network of listening Agents.
Funny enough, our RFW only needs a few details:
- prompt - the Prompt that the user wants to run.
- expiration_date: the date on which the RFW will no l
struct RFW {
expiration_date
prompt
max_cost
}
impl RFW {
fn new(&self) -> Self {
}
fn issue(&self) -> HashValue {
todo!
}
}
Risk Appraisal
The cost of performing the requested work may end up turning the contract into a profit or a loss. In tracking and analyzing its profitability, the Agent adjusts its risk aversion going into the next auction - bidding more or less aggressively to win the next contract.
English Auction
Once an RFW is broadcast on the network, an English auction is organized between Agents interested in bidding on the contract. The Agent who won the contract has to find an MCP Server offering to run the Prompt at a price which has a chance to make the contract profitable to the Agent.
Shop around for a cheap MCP Server
Deliver the Requested WorkShop
Settlement on a Blockchain
A blockchain with a fast Block Time and decent Time to Finality is likely needed, with Solana being one possible platform for POC purposes. Solana is able to process around 1000 transactions per second, has a Block Time of 0.39 seconds, and a Time to Finality of around 15 seconds. Another, more ambitious, idea is to design a blockchain from scratch, with MCP client-server-transaction processing in mind.
Insurance Agent
One glaring challenge is how to handle MCP Servers’ inability to determine neither the Token Count nor the Time to Process of running a Prompt on an LLM. In order to make some inroads on a POC design, the concept of ‘slippage’ could be introduced and included in the MCP Server’s cost structure. An Agentic Insurance Market could also be considered, as a stabilizing mechanism against factors which increase the unpredictability of generated Ai.
System Architecture
An image is worth a thousand words, so let’s have a look at architecting our system.
We’ll use a Python library called Diagrams to do it.
# Setup project
mkdir mcp_contract
cd mcp_contract
uv init
# Adding testing, linter/formatter, and type checking
uv add pytest ruff mypy
# Diagrams uses graphviz under the hood.
brew install graphviz
$ pip install diagrams
Next, let’s scaffold a simple Python project and quickstart :
# ./src/mcp_contract/main.py
from diagrams import Cluster, Diagram, Edge
from diagrams.gcp.analytics import BigQuery, Dataflow, PubSub, DataFusion
from diagrams.gcp.compute import AppEngine, Functions
from diagrams.gcp.database import BigTable
from diagrams.gcp.iot import IotCore
from diagrams.gcp.storage import GCS
from diagrams.gcp.api import Apigee
from diagrams.gcp.security import Iam
from diagrams.gcp.ml import AutomlNaturalLanguage, AutomlVision
from diagrams.gcp.ml import AutomlTables, AIPlatform
def main() -> None:
with Diagram("Agentic Micro Economy", show=False, direction="LR"):
with Cluster("RFW Recipients"):
agent2 = AutomlTables("Agent 2")
agent1 = Apigee("Agent 1")
agents_rest = [agent1, agent2]
# Agents
with Cluster("MCP Client"):
agent3 = AIPlatform("Agent 3")
agents_rep = agent3
with Cluster("Calculate Token Cost"):
with Cluster("MCP Servers"):
servers = [GCS("Gemini"), GCS("OpenAi")]
servers_rep = servers[0]
with Cluster("Request for Work"):
rfw = [Iam("User"),
IotCore("Agent")]
with Cluster("Auction on RFW Contract"):
with Cluster("Participants"):
auction_agents = [ AIPlatform("Agent 3"), Apigee("Agent 1")]
with Cluster("Settlement"):
with Cluster("Blockchain"):
blockchain = DataFusion("Solana")
with Cluster("Perform Requested Work"):
with Cluster("Agent 3 Calls"):
work = GCS("MCP Server")
with Cluster("Contract"):
with Cluster("Wallets"):
wallets = [Iam("User"), AIPlatform("Agent 3"), GCS("MCP Server")]
auction_agents[0] >> Edge(label="Winner") >> work
rfw[0] >> Edge(label = "", color="red", style="dashed") >> wallets[0] \
>> Edge(label="Settlement") >> blockchain >> Edge(label="") >> wallets[1]
blockchain >> wallets[2]
rfw[0] >> Edge(label="RFW") >> agent1
rfw[0] >> Edge(label="RFW") >> agent2
rfw[0] >> Edge(label="RFW") >> agent3
agent3 >> Edge(label="Find") >> servers[0]
servers[0] >> Edge(label="Bid") >> auction_agents[0]
work >> Edge(label="Work Done") >> blockchain
if __name__ == "__main__":
main()
Run the project:
$ python3 ./src/mcp_contract/main.py
# The diagram will be located in our root folder and named after the Diagram
open agentic_micro_economy.png
â–²[^1] Diagram of our Agentic Micro Economy, as generated by our Python code.
This post is clearly exploratory in nature. A substantial amount of reading, googling, and tinkering is needed, to get a better sense of scope and complexity, of Agentic Micro Economy.
Thanks for reading.