lamarge
Rust client for the LaMarge API: market data, the event feed, sign-in, venue setup, takes, transfers, withdrawals, external bridges of a move and passive market making on escrow venues.
Before a signer sees anything, the crate:
- checks every item to sign against your request and the deployment values this release pins;
- saves the signatures of takes, transfers, withdrawals, maker capital and wallet permits in your
store::Journalbefore submitting them, and reuses them when the same request runs again; venue setup steps (setup permits included), closes and quote publications are not journalled and may sign again after an interruption; - keeps your client IDs stable across retries.
Install
The crate runs on Tokio. Any alloy_signer::Signer signs: a local key, a KMS key or a Ledger. TLS is rustls with the platform verifier: slim and distroless images need system CA roots (ca-certificates). HTTP requests honour HTTPS_PROXY; the event feed's WebSocket connects directly and, without a direct route, falls back to HTTP replay. Lighter's public API is read directly to check account owners; ClientBuilder::lighter_reads sends those reads through your own client, from your address and within your rate budget. Amounts are base units of each venue's token (types::Amount::parse_venue).
Examples
Market data
use ;
async
Take
From Hyperliquid margin into the session's Polymarket account, priced from the book with 10 bps slippage. The whole request resumes the take: it is saved before the first call and reused on every run.
use PrivateKeySigner;
use ;
async
Runnable programs in examples/:
| Example | Key | Does |
|---|---|---|
market_data |
none | venue prices, book limits, the public event feed |
taker_transfer |
financial | a resumable transfer from Hyperliquid margin into Polymarket |
maker_provision |
financial | Hyperliquid setup, a maker credential, pool capital |
maker_quote |
quote | lease, quote lines, fills on the private feed |
Features
| Feature | Default | Enables |
|---|---|---|
aws-lc-rs |
yes | rustls with the aws-lc-rs provider (needs cmake on some platforms) |
ring |
no | rustls with the ring provider |
One provider is required; with both, aws-lc-rs is used. The crate never installs a process-wide rustls provider.
MSRV
Rust 1.94.1. It is raised only in a minor release, noted in the changelog.
Documentation
- API: docs.rs/lamarge
- Guide: docs.lamarge.trade/rust-sdk
Licence
Licensed under either of Apache License, Version 2.0 or MIT license at your option.