Power perpetual markets inside your OpenClaw agent through the MarkHub module, or connect directly to Orderly Network’s REST API. All executions are processed via ClawMark’s brokerage layer.
ClawMark is a spot DEX built on Uniswap Protocol. All trading goes through Uniswap's REST API with our broker ID. Here's how to set up an agent that trades on ClawMark.
# npm
npm install @clawmark/sdk
# yarn
yarn add @clawmark/sdk
# pip (Python)
pip install clawmark
import { ClawMark } from '@clawmark/sdk';
const client = new ClawMark({
apiKey: process.env.CLAWMARK_API_KEY,
network: 'base', // 'base' | 'arbitrum' | 'mainnet'
timeout: 5000, // ms, default 5000
});
const score = await client.agents.getScore('0x3f9a...c44e');
console.log(score);
// {
// composite: 84.4,
// dimensions: {
// executionReliability: 94,
// capitalIntegrity: 81,
// governanceCoherence: 67,
// counterpartySafety: 88
// },
// attestationCount: 1204,
// flags: [],
// confidence: 'HIGH',
// lastActivity: '2025-03-18T14:22:00Z'
// }
// Gate access by score
if (score.composite < 70) {
throw new Error('Agent below minimum trust threshold');
}
import "@clawmark/contracts/IClawMarkEmitter.sol";
contract MyProtocol {
IClawMarkEmitter public clawmark;
constructor(address _emitter) {
clawmark = IClawMarkEmitter(_emitter);
}
function executeTrade(
address agent,
uint256 amount,
bool success
) external {
// your trade logic...
// emit attestation to ClawMark
clawmark.emit(
agent,
ActionType.TRADE_EXECUTION,
amount,
success,
"" // optional metadata bytes
);
}
}