May 9, 2025

From Joke to Working Demo: AI Agents Now Match Orders On-Chain with Saline

AI agents can now match and submit real on-chain trades—securely—using mandates, with no smart contracts required

From Joke to Working Demo: AI Agents Now Match Orders On-Chain with Saline

From Joke to Working Demo: AI Agents Now Match Orders On-Chain with Saline

“We joked about replacing validators with ChatGPT.
That part's still a joke.
But matching orders? That part just became real.”

With the recent launch of the Saline Python SDK and support for MCP (Machine Control Protocol), we’ve officially crossed into new territory:

 LLMs can now:

  • Fetch live on-chain intents

  • Parse and match orders

  • Submit transactions (and only if allowed by on-chain rules)

And they can’t steal your funds — because every action is gated by Mandates, enforced directly by the chain.

What We Did 

We connected Claude (via MCP) to:

  • Read Saline intents

  • Suggest matching orders

  • Submit atomic swaps

  • Respect all mandates automatically

And yes, we’ve got the full proof-of-workflow:

Some prerequisite

  • Watch this video to understand how to set up MCP server https://www.youtube.com/watch?v=ww293jeEDT4&t=288s
  • Go through Saline SDK document (shh, it's not fully public yet but I'll let you guys play with it), or just send it to your favourite AI to break it down for you
  • Claude desktop app (you can use whatever really) 
  • Some python knowledge (or ask chatgpt along the way)
  • [Optional] Saline Early beta wallet app to create some mandates with the UI (https://wallet.try-saline.com)

Connect LLM to Saline

  1. After you watch the video, create a new MCP server call “salinetx”, this will generate a bunch of standard file in there and the thing you mainly have to worry about is a file call server.py which should be inside src->salinetx
  2. Copy the my server.py code that I have (you actually dont need all of it but hey why not) – ATTACHED code

  3. I would advise you create a python virtual environment but make sure its python 3.12 (as some of the functionality aren’t support in 3.13+) 
python3.12 -m venv .venv
source venv/bin/activate
  1. Then in the pyproject.toml make sure that dependencies and python version are as follow 
.........
requires-python = "~=3.12"
dependencies = [ "mcp>=1.6.0","saline-sdk"]
.........
  1. Test running the file to make sure everything is good (nothing happen mean you ready to go)
python src/salinetx/server.py
  1. Open your Claude Desktop App, you should see a hammer at the bottom of your prompt. This mean your MCP connection are ready to go 

Mandates created via Saline Wallet

  1. Let’s first go to the Saline UI(or you can use SDK) to create mandates “Dont take my 1 BTC” 
  2. Navigate to Editor and do as follow, this ensure that at the end of any transaction my BTC balance always remain >=1. Install it onto your asset address.

  1. Let’s also make sure you have some assets on this address ready for AI agent to steal (or not). Navigate to explore and fullfill this faucet intent

Test with some transaction ETH transfer 

  1. Go to your Claude and start testing 
“I would like to transfer 1 ETH from nacl:0xb2ec41de20b87b3e77e6920eada1f262cae15c0e378200666c3b8bc896c87cf5795ae0d6751984a808120755355b464c to nacl:0xab51cd13d99ad704f1f47744d5d35febb1d1d73f6c7e8da4aa7092a1955f438dfd1dec98bde22393806db9a2b063a0ba” 

Try Stealing some BTC 

1. Let’s try something more naughty, as the mandate on the asset address was set to not allow anyone to take my BTC.  Let’s try taking the BTC: (Pic)

Ah, now it doesn’t work. Thanks, Claude for the explanation why. 

Step-by-Step: Matching Orders On-Chain with an LLM

1. Publish Limit Order Intents On-Chain

Before we let the LLM do its thing, we first need some orders for it to match.

Luckily, creating intents on Saline doesn’t require smart contracts or LLMs — just a few lines of Python using our SDK.

You can publish a batch of limit orders like this:

{"name": "erin",  "give_token": "SALT", "give_amount": 500, "want_token": "USDC", "want_amount": 50},
    {"name": "frank", "give_token": "USDC", "give_amount": 50,  "want_token": "SALT", "want_amount": 500},
    
    {"name": "grace", "give_token": "USDT", "give_amount": 1000,"want_token": "BTC",  "want_amount": 2},

    {"name": "hank",  "give_token": "BTC",  "give_amount": 1,   "want_token": "USDT", "want_amount": 2000},  # mismatched with carol/dave
    {"name": "ivy",   "give_token": "ETH",  "give_amount": 1,   "want_token": "USDC", "want_amount": 100},  # no counterparty

    {"name": "jack",  "give_token": "USDT", "give_amount": 100, "want_token": "SALT", "want_amount": 250},
    {"name": "kate",  "give_token": "SALT", "give_amount": 250, "want_token": "USDT", "want_amount": 100},

You should now see those intents appear on the Intent Explorer. These are just on-chain "offers" waiting to be matched.

2. Let the LLM Match Orders

Now the fun begins. We'll let the LLM act as a matching engine — something that would be an absolute headache to do on most smart contract platforms.

But on Saline? All you need is:

  1. A Python script running via MCP

  2. The LLM connected via Claude or ChatGPT

  3. Our Saline SDK installed

You’ll create two lightweight MCP servers:

  • query: to fetch on-chain intents

  • submittx: to submit the matched swap transactions

(Links to GitHub repos will go here)
🔗 [Query Server GitHub]
🔗 [SubmitTx Server GitHub]

 3. Let the LLM Decide Who Wants What

With all intents fetched, prompt your LLM:

“Find two swap intents that match each other — e.g. someone offering 100 USDC for 0.001 BTC and someone offering 0.001 BTC for 100 USDC.”

The LLM can now analyze intents and suggest valid pairings.

 4. Submit the Matched Transaction

Once Claude (or GPT) figures out a match, it will pass that transaction into the submittx MCP server, which will execute the atomic swap — only if the Mandates on both sides permit it.

If something fails (e.g. mandates don’t align), Claude will even explain why

And Just Like That… It Works

We started with a joke.

Now we have:

  • LLM fetching intents

  • LLM matching trades

  • LLM submitting transactions

  • All with on-chain, enforceable safety guarantees

No smart contracts. No vaults. No brittle backend.
Just one LLM, one SDK, and a chain that knows the rules.

 

Why Saline Is the Only Chain This Works On

On Ethereum, Solana, Cosmos, etc.:

  • You’d need complex smart contracts

  • You’d worry about AI messing up

  • You’d risk funds unless locked in dumb vaults

On Saline:

  • You write simple rules

  • LLMs can go nuts

  • The chain filters every transaction before it hits your wallet

“The chain is the judge. Not your app. Not your bot. Not your wallet.”

Try It Yourself

Final Words

One month ago, this was a joke.

Now, it’s real — and easier than expected.

This is a new way to build:

  • No smart contract programmingf

  • No custody risks

  • AI + rules = secure autonomy

It’s the beginning of AI-native finance. And Saline might be the only chain ready for it.

Chakrit Mettakhun
COO

From JP Morgan to Google to BitMEX—Chakrit builds and scales across finance, tech, and beyond.

Envelope Icon - Cryptotech X Webflow Template

Subscribe to our newsletter today

Thanks for joining our newsletter.
Oops! Something went wrong.
BG Shape V19 - Cryptotech X Webflow Template

Explore our collection of 200+ Premium Webflow Templates