Skip to main content
Now, let’s see how we can build an agent.
The same crates the CLI uses are available as Rust libraries. Import them from a path or git and build custom agents, batch tools, or test harnesses.

Example - Buy CC

We take a canonical example – buying CantonCoins. The agent lives at examples/buy_cc. It buys CC on CC-USDC. examples/buy_cc/Cargo.toml:
examples/buy_cc/src/main.rs (abridged):
To launch the agent, run this command:
CC Buying agent is launched! Great job!