What a liquidity ad contains
Every ad specifies:- Source chain and token — the chain and token a Bridger must deposit
- Destination chain and token — the chain and token the Maker provides
- Available amount — the total liquidity the Maker is offering
- Rate — the exchange ratio the Maker is willing to accept
- Ad ID — a unique identifier used to reference the ad in orders and proofs
AdManager contract and are publicly visible to all Bridgers browsing the marketplace.
Ad lifecycle
Create
The Maker calls
createAd on the AdManager contract, specifying the token pair, destination chain, and rate. The ad is now visible in the marketplace but holds no liquidity yet.Fund
The Maker calls
fundAd to deposit destination-chain tokens into the contract. Only funded ads can be matched with Bridger orders.Matched by a Bridger
A Bridger selects the ad and deposits source-chain tokens on the
OrderPortal. A cryptographically signed order is created, binding the trade terms to both chain IDs and contract addresses.Locked for order
The Maker calls
lockForOrder, reserving a portion of their ad’s liquidity exclusively for this trade. The locked amount is appended to the on-chain Merkle Mountain Range as a commitment.Settled
The relayer generates a ZK proof and submits it to both chains. Each chain’s
Verifier contract validates the proof and releases funds to the respective recipients simultaneously.A Maker can withdraw unused (unlocked) funds at any time using
withdrawFromAd. Locked funds remain reserved until an order settles or times out.Browsing the marketplace
As a Bridger, you can filter available ads by:- Source chain — the chain you’re depositing on
- Destination chain — the chain you want to receive tokens on
- Token pair — the specific tokens being exchanged
- Rate — how much destination token you receive per unit of source token deposited
How settlement works
Settlement releases tokens to both parties at the same time, with no manual coordination required.What happens on the destination chain (AdManager)
What happens on the destination chain (AdManager)
The relayer submits a ZK proof to the
AdManager on the destination chain. The Verifier contract checks that the proof correctly attests to a valid deposit on the source chain. If valid, the Maker’s locked tokens are released directly to the Bridger’s specified recipient address.What happens on the source chain (OrderPortal)
What happens on the source chain (OrderPortal)
The relayer also submits a proof to the
OrderPortal on the source chain. Once verified, the Bridger’s deposited source tokens are released to the Maker’s designated recipient address.What prevents the same proof from being used twice
What prevents the same proof from being used twice
Each proof consumes a nullifier — a one-time cryptographic value derived from the trade. Once a nullifier is recorded on-chain, any attempt to replay the same proof is rejected. This is enforced independently on each chain.
Ad parameters reference
| Parameter | Description |
|---|---|
adId | Unique identifier for the ad |
adToken | Destination-chain token the Maker provides |
orderToken | Source-chain token the Bridger deposits |
adChainId | Chain ID where the ad is posted |
orderChainId | Chain ID where Bridgers deposit |
balance | Total tokens currently in the ad |
locked | Tokens reserved for in-progress orders |
open | Whether the ad accepts new orders |