1. The hero price
Every page load reads the current ADA/USD price from chain usingc3.getOdvReference("ADA/USD") in a Server Component. The SDK reads the datum for you, and the UI shows the value, whether it is fresh, and how old it is.
What the code does:
price.isExpired is true, the badge says stale, and the Refresh button in the next section fixes it.
2. Run the loop
Scroll to Run the loop. This runs the full pull-oracle flow with a small on-chain contract: deposit tADA, lock it behind a price rule, refresh, claim.Connect Lace
The panel asks Lace for its network and your address. If Lace is on mainnet, the demo refuses and asks you to switch.
Deposit 3 tADA
Builds a Lucid tx that sends 3 tADA to the contract, with a rule saying “release once ADA/USD is at or above $0.10, to me”. Your Lace wallet signs and sends it.
Refresh oracle price
Calls
POST /api/refresh. On the server, Lucid signs a Round 2 tx with the demo seed, gets signatures from the six oracle nodes, and submits. About 30 seconds to confirm. The hero price above is fresh after this.3. AI agent: pay a USD invoice in ADA
Scroll to AI agent: pay a USD invoice in ADA. This is the big feature: a GPT-4o-mini agent usescharli3-js as a tool and pays a USD invoice in ADA.
Connect Lace
Same Lace connect as the loop panel. The agent needs your wallet to build the final payment tx.
Drop a sample invoice
Click insert sample invoice to fill the text box with a one-line USD invoice and a preprod
addr_test1... address. You can also download the sample PDF.Send
The agent runs these tools in order:
get_charli3_ada_usd(reads the price from chain)submit_round2_refresh(posts a fresh Round 2 tx, only if the first read was stale)get_charli3_ada_usdagain (reads the fresh price)validate_address(checks the preprod address)propose_payment(hands you a ready-to-sign payment)
Watch the thought process
Every tool call shows as a numbered step in the chat, with a Cardanoscan link for each read or refresh. This is how you know the agent is not guessing the price.
4. Copy skill.md to give any agent this power
The agent header has a copy skill.md button. It copies one markdown file you can paste into any tool-calling LLM (Claude, Cursor, Masumi agents, custom OpenAI setups) so that agent can read and refresh Charli3 prices without copying any code.How to wire skill.md into your agent
The full guide for Masumi, Claude Skills, and generic tool-calling frameworks.
5. Side by side: Python SDK vs charli3-js
The bottom of the page has a tab that shows the same refresh action in both SDKs. Thecharli3-js side is one Next.js API route. The Python side is a YAML config, a Python file, and a plan for hosting them outside your web app.
Full comparison.
If you are showing this to hackathon judges
The shortest path is:- Open the deployed URL.
- Connect Lace (preprod).
- Click Deposit 3 tADA, wait for the tx.
- Click Refresh oracle price, wait about 30 seconds.
- Click Claim locked tADA.
- Scroll to the AI agent, insert the sample invoice, send, sign.