LithosDocs
ProtocolPayoutsTokenStatsDocs
Start mining
Documentation home
Protocol
  • Lithos Protocol
  • LFSM
    • Rollups
    • NISPs
    • Emissions
    • Mining on Lithos
    • Candidate building
    • Ergo Voting
  • LithosDex
    • Trading with orders
    • Providing liquidity
Run Lithos
  • Startup guide
    • Setting up an Ergo testnet node
  • Configuration
    • Node connection and security
    • Stratum and difficulty
    • Block packages
    • Batching and orders
    • Collateral and emission
    • Wallet and consolidation
    • Statistics and web panels
    • Synchronization and storage
    • Tasks and dispatchers
    • Failure modes
    • Reporting issues
Client API
  • Overview
    • getLithos client information
    • getList UTXO ids for blocks
    • getUTXO ids by block height
    • getBlock info by UTXO id
    • postBlock info for multiple UTXO ids
    • getGet a block's miner set
    • getList all pool blocks
    • getGet Lithos payouts
    • getStatistics overview
    • getMining and payment totals
    • getMining statistics by hour or day
    • getEstimate Lithos hashrate
    • getNetwork difficulty by epoch
    • getThis client's own hashrate
    • getThis client's hashrate over time
    • getThis client's payouts and claims
    • getCollateral inventory
    • getLocal mining activity
    • getCollateral market snapshot
    • getList queue boxes
    • getList the active set
    • getPermit price history
    • getYour locked block rewards
    • postClaim unlocked block rewards
    • postQuote joining the queue
    • postJoin the collateral queue
    • getLithosDex pool state
    • getLithosDex fee vault state
    • getList your outstanding orders
    • postQuote a swap order
    • postPlace a swap order
    • postQuote a deposit order
    • postPlace a deposit order
    • postQuote a redeem order
    • postPlace a redeem order
    • postCancel an order
    • postQuote a swap
    • postQuote a swap by desired output
    • postExecute a swap
    • postQuote a liquidity deposit
    • postDeposit liquidity
    • postQuote a liquidity redemption
    • postRedeem liquidity
    • getList liquidity provisions
    • postClaim settled fees for a provision
    • postQuote a provision resize
    • postResize a provision
    • postCheck a pending fee flush
    • postFlush pending fees to the vault
    • getPool-wide fee history
    • getPool price history
    • getRecent pool activity
    • getFee history for one provision
    • getWallet balances and lending status
    • getGet Stratum information
    • getGet candidate settings
    • getGet difficulty commitment
    • postCommit a difficulty
    • getGet best NISP at height
Lithos

A decentralized mining pool protocol on Ergo. Miners build their own blocks; contracts pay them for proven work.

Live on Ergo mainnet
Protocol
  • How Lithos works
  • Mining on Lithos
  • NISPs
  • Emissions
  • LFSM contracts
Run Lithos
  • Startup guide
  • Configuration
  • LithosDex
  • Client API
  • Failure modes
Network
  • Live stats
  • Public stats API
  • Ergo Platform↗
  • SOAT Miner↗
Community
  • Telegram↗
  • X / Twitter↗
  • GitHub↗
Lithos
© 2026 Lithos Protocol. Open source under the MIT licence.λίθος — stone
Docs/Protocol

LithosDex

What LithosDex is, how a trade is priced, what it costs, and how orders reach the pool.

Standard4 min readFor anyone trading ERG and LIT through the Lithos client. No Ergo or smart contract experience needed.

LithosDex is a decentralized exchange for ERG and LIT. It runs entirely on Ergo smart contracts, and your Lithos client includes a web interface for it. This page explains how a trade is priced, what it costs, and how your trade reaches the exchange.

It does not cover depositing into the exchange, which is in Providing liquidity, or the settings a miner uses to fill other people's orders, which are in Batching and orders.

How the price is set#

LithosDex holds its ERG and LIT together in one pool, which is a single box on Ergo. You trade against the pool, not against another person, so a trade never waits for someone to take the other side.

The pool sets its price from its own reserves. It keeps the product of its ERG and its LIT constant across a trade, before fees. Two things follow from that:

  • Every trade moves the price. Buying LIT takes LIT out of the pool and puts ERG in, so the next LIT costs a little more.
  • Large trades move it further. The bigger your trade is against the reserves, the worse your average price. The web interface shows the price you will get before you confirm.

The reserves belong to liquidity providers, who deposit ERG and LIT together and earn the fees trades pay.

What a trade costs#

Every swap pays about 0.3% of what you put in, in two equal parts:

FeeShare of your inputWhere it goes
Pool fee0.15%Stays in the reserves, which raises the value of every provider's share
Permanent fee0.15%Set aside for providers, who claim it separately

On top of that you pay:

  • A network fee on the transaction you send, as with any Ergo transaction.
  • An executor fee, if you trade with an order. It is paid only when a miner fills the order.

Orders and direct trades#

A trade reaches the pool in one of two ways. The Use orders switch in the web interface picks between them, and it is on by default:

OrderDirect trade
What you sendAn order box that holds your funds and your termsA transaction that spends the pool itself
Who completes itA miner, who fills the order against the poolYou, if your transaction lands
Extra costThe executor fee, 0.003 ERG by default, paid only on fillNone
When several trades arrive at onceMiners fill them one after another in the same blockOnly one can spend the current pool box. The rest fail and must be sent again
If you change your mindCancel the order and your funds come backNothing to cancel once it is sent

Use orders. The pool is one box, so direct trades collide with each other and with miners. A miner filling orders replaces any unconfirmed direct trade in the blocks it builds, and that trade then has to be sent again against the new pool. An order does not collide: it waits in its own box until a miner fills it at your price or better.

Trading with orders covers placing, following and cancelling an order.

Who fills orders#

Miners do. A Lithos miner with block transactions turned on fills LithosDex orders in the blocks it mines, and keeps each order's executor fee. A miner can also fill orders by broadcasting them to the network, paying the network fee out of the executor fee.

Filling is permissionless and checked by the order's own contract. A miner cannot fill your order at a worse price than your minimum, and cannot take anything but the executor fee you set.

An order paying less than miners accept waits. Miners skip orders whose executor fee is below their own minimum. The default executor fee clears the shipped minimum of every miner running this client, so leave it unless you have a reason to change it.

Using the web interface#

Open LithosDex in the client's navigation bar. The interface has the following tabs:

TabWhat you do there
SwapTrade ERG for LIT or LIT for ERG, and follow or cancel your orders
LiquidityDeposit into the pool, or close a position
FlushMove the permanent fees the pool has collected into the vault, where providers claim them
FeesSee and claim the permanent fees your positions have earned
HistoryChart the fees earned over time, for the whole pool or one position

Anything that sends a transaction needs the client's API key. Enter it under Settings on the Swap tab. The key is kept only in memory, so you enter it again after refreshing the page. Settings also holds auto-refresh and your own executor fee for new orders.

Danger
Your client signs with your node wallet

LithosDex trades spend funds from the node wallet the client uses. Keep the client's port off the open internet, and change the shipped API key. See Node connection and security.

Next steps#

  • Trading with orders: placing, following and cancelling an order.
  • Providing liquidity: depositing into the pool and claiming its fees.
  • Batching and orders: the settings for filling other people's orders.
Edit this page on GitHubsynced from e0ca86a
← PreviousErgo VotingNext →Trading with orders
On this page
  • How the price is set
  • What a trade costs
  • Orders and direct trades
  • Who fills orders
  • Using the web interface
  • Next steps