Docs / Integrating
Build on Ordeo
Building on ORDEO and the pool
ORDEO is an ordinary ERC-20, so most integrations need nothing special. This page covers quoting, buying into a note for someone, reading pool events and the figures you can compute.
On this page
An ordinary ERC-20
Wallets, explorers, exchanges and contracts can treat ORDEO like any other token: transfer, approve, balanceOf. Read decimals() from the token rather than assuming. The address is the one in src/config/brand.ts; until launch it is a placeholder.
Nothing about the token changes when people shield. Shielded tokens simply sit at the pool’s address.
Quoting the market
Read getLaunchedToken(token) on the Pons factory (0x7eD598BcEf8bd9Edd8C97A195C6d13f40801EC7e). Then:
- Phase 0 and the curve is neither
graduated()norreadyToGraduate(): the curve is live. It has no quote view, so simulatebuy(quoteIn, 0, you)witheth_calland the ETH as value. - Phase 2: the v4 pool is live. Call
quoteExactInputSingleon the v4 quoter (0x8Dc178eFB8111BB0973Dd9d722ebeFF267c98F94) with the pool key(ETH, token, poolFee, tickSpacing, memeHook)andzeroForOne = truefor a buy. - Anything else: trading is paused; the router reverts with
TradingPaused.
Both quotes include Pons fees and any launch tax, because they run the real trade path.
Buying into a note through the router
- 01
Get the recipient’s keys
From
keysOf(address)on the registry, or from theirordeo:private address. - 02
Make the note
Pick a random blinding below the field order, compute
ownerHash = Poseidon2(pk, blinding), and encrypt asset 1, value 0 and the blinding to the viewing key, exactly as described on Notes. - 03
Set a minimum
Quote the buy and subtract your slippage allowance. A zero minimum reverts.
- 04
Call buy
buy(ownerHash, minTokensOut, encryptedNote)with the ETH as value. It returns the tokens bought and the leaf index; unused ETH is refunded to the caller.
Reading pool events
Scan from the pool’s deployment block. NewCommitment in leaf order rebuilds the tree; NewNullifier marks spends; Shielded, Unshielded and PrivateTransfer give the public amounts of each kind of action; YieldAdded, SharesBurned and Donated track the vault. The router adds BoughtIntoNote, BoughtForVault and SoldFromNotes.
The site serves the leaf list at /api/pool/leaves?from=N in pages of 2,000. It answers { "configured": false } until the pool is set.
Supply figures you can compute
| Figure | How |
|---|---|
| Total supply | token.totalSupply() |
| Shielded token supply | backing + pendingYield from state(). The pool’s token balance can be higher only by tokens sent to it by plain transfer, which no note owns. |
| Share price | valueOfShares(x) / x for a large x. It never decreases. |
| ETH in the pool | Pool ETH balance: ETH notes plus ethFees waiting to be swept |
| Notes ever created | leaves from state(), fillers included |
| Fees paid out | totalToTeam() and totalToHolders() on the splitter |
What not to assume
- Token note values are vault shares, not tokens. Convert with
valueOfShares. - A shield note’s ciphertext says value 0; the value is in the
Shieldedevent. Shielded.fromis the caller. For app buys that is the router; the buyer is inBoughtIntoNote.- Tokens sent to the pool by plain transfer create no note and are lost. ETH sent to the router outside a trade reverts.
- Not every trade pays the creator fee: it is charged only on the Pons curve and in the Pons v4 pool that has the meme hook.
- A proof expires once its root is more than 100 insertions old.
- Leaf count is not user count: every spend adds two leaves, and many are zero-value fillers.
- Nothing is deployed yet. Read addresses from the configuration, never hard-code them.