Provide liquidity¶
You can provide liquidity to the DEX pools and earn fees. Positions are concentrated-liquidity (Uniswap-V3-style), so each one covers a price range. As with swaps, you must be logged in with a minted DID.
Impermanent loss is real
Providing liquidity exposes you to price movement in the pool. Understand the position before you fund it; see Risk & responsible use.
Two pool types — check the instrument first¶
Which call you make, and which checks apply, depend on the instrument. Classify it with pd.instrument_kind(symbol):
- Oracle-free token (today just
WDEL;AMMT1/AMMT2on dev) — an oracle-free pool (Uniswap-V3-style, 24/7 concentrated liquidity). Add withpd.add_liquidity(AMMAddLiquidity(...)), sizing the tick range fromspot_price/quote_swap. No market-hours gate. - Oracle-priced token (
AAPL-class tokenized stock) — an oracle-priced pool that settles against the signed oracle price. Add withpd.add_liquidity(PriceFeedAddLiquidity(...)). There is no pre-trade quote (spot_price/quote_swapraisePoolNotFound), and it is market-hours-gated:pd.is_market_open()must beTrue, or the pool reverts off-hours with a stale-price error (MarketClosed) — exactly like an oracle-priced swap. Gate every oracle-priced add/remove onis_market_open(), the same as you would a swap.
Add a position¶
Adjust an existing position¶
pd.increase_liquidity(...) # add to a position
pd.collect_fees(...) # withdraw accrued fees
pd.preview_fees(...) # what's collectable
Remove or close¶
pd.remove_liquidity(...) # take liquidity back out
pd.burn_position(...) # close an emptied position
Inspect your positions¶
For exact parameters (price ranges, amounts, token pairs), see the SDK reference — it's generated from the source, so it never drifts.
Related: Place a swap · On-chain balances