# Lithos client API

> The HTTP API every Lithos client serves on its own machine (port 9000 by default): blocks, payments, mining stats, collateral, LithosDex, difficulty forwards, wallet and stratum settings. Calls that sign or spend need the client's `api_key` header. It is local to each client; for public network numbers use the site's stats API instead.

Source: https://lithosprotocol.org/docs/api

## Endpoints

### Info

Synchronization status and capability availability for the Lithos client

- [Lithos client information](https://lithosprotocol.org/docs/api/get-lithos-info.md): `GET /info`

### Blocks

Usable, canonically committed blocks currently being processed by Lithos contracts

- [List UTXO ids for blocks](https://lithosprotocol.org/docs/api/get-contract-ids.md): `GET /blocks`
- [UTXO ids by block height](https://lithosprotocol.org/docs/api/get-blocks-by-height.md): `GET /blocks/byHeight`
- [Block info by UTXO id](https://lithosprotocol.org/docs/api/get-block-by-id.md): `GET /blocks/{utxoId}`
- [Block info for multiple UTXO ids](https://lithosprotocol.org/docs/api/get-pool-blocks-by-ids.md): `POST /blocks/utxoIds`
- [Get a block's miner set](https://lithosprotocol.org/docs/api/get-block-miners-by-id.md): `GET /blocks/{utxoId}/miners`
- [List all pool blocks](https://lithosprotocol.org/docs/api/get-all-pool-blocks.md): `GET /blocks/all`

### Payments

Confirmed Lithos payouts to this client's primary miner address

- [Get Lithos payouts](https://lithosprotocol.org/docs/api/get-payments.md): `GET /payments`

### Statistics

Mining, payment, collateral and client activity numbers for dashboards and graphs.
Collection runs in the background, so a request never makes the client scan the node.
Only `/stats/local` needs an `api_key`; the rest are open reads. Nothing here is cached.

Every response carries a `status`. Only `ready` means the numbers have caught up to the
chain tip — show anything else as loading or stale.


**All amounts and work totals are exact decimal strings, not JSON numbers.** ERG amounts
are nanoERG (1 ERG = 1,000,000,000); LIT amounts are base units (9 decimals); timestamps
are Unix milliseconds. History is kept for a configured number of days, not forever.

- [Statistics overview](https://lithosprotocol.org/docs/api/get-stats.md): `GET /stats`
- [Mining and payment totals](https://lithosprotocol.org/docs/api/get-mining-totals.md): `GET /stats/mining/totals`
- [Mining statistics by hour or day](https://lithosprotocol.org/docs/api/get-mining-buckets.md): `GET /stats/mining/buckets`
- [Estimate Lithos hashrate](https://lithosprotocol.org/docs/api/get-mining-hashrate.md): `GET /stats/mining/hashrate`
- [Network difficulty by epoch](https://lithosprotocol.org/docs/api/get-difficulty-epochs.md): `GET /stats/mining/difficulty`
- [This client's own hashrate](https://lithosprotocol.org/docs/api/get-local-mining-summary.md): `GET /stats/mining/workers`
- [This client's hashrate over time](https://lithosprotocol.org/docs/api/get-local-mining-history.md): `GET /stats/mining/workers/history`
- [This client's payouts and claims](https://lithosprotocol.org/docs/api/get-mining-payments.md): `GET /stats/mining/payments`
- [Collateral inventory](https://lithosprotocol.org/docs/api/get-collateral-stats.md): `GET /stats/collateral`
- [This wallet's lending earnings](https://lithosprotocol.org/docs/api/get-lending-earnings.md): `GET /stats/collateral/earnings`
- [Local mining activity](https://lithosprotocol.org/docs/api/get-local-mining-stats.md): `GET /stats/local`

### Collateral Market

Stats and participation for the collateral market: the queue, the active set, emission state, and joining the queue.

**All amounts are decimal strings, not JSON numbers.** ERG amounts are nanoERG; LIT amounts are base units (9 decimals).

- [Collateral market snapshot](https://lithosprotocol.org/docs/api/get-collateral-market-info.md): `GET /collateral/market`
- [List queue boxes](https://lithosprotocol.org/docs/api/get-collateral-queue.md): `GET /collateral/queue`
- [List the active set](https://lithosprotocol.org/docs/api/get-collateral-active-set.md): `GET /collateral/active`
- [Permit price history](https://lithosprotocol.org/docs/api/get-collateral-permit-history.md): `GET /collateral/permits/history`
- [Your lending status](https://lithosprotocol.org/docs/api/get-collateral-wallet-status.md): `GET /collateral/wallet`
- [Quote joining the queue](https://lithosprotocol.org/docs/api/check-collateral-join.md): `POST /collateral/join/check`
- [Join the collateral queue](https://lithosprotocol.org/docs/api/join-collateral-queue.md): `POST /collateral/join`

### Lithos Dex

Swap, provide liquidity and collect fees on the LithosDex pool.

Swaps, deposits and redemptions can be placed as **orders** under `/dex/orders`, which any miner fills for the order's executor fee, or sent **directly**, spending the pool at once. Prefer orders: a miner filling orders may replace an unconfirmed direct spend of the pool, which then has to be resent.

**All amounts are decimal strings, not JSON numbers.** A 409 means a box you quoted against has moved: re-read, re-quote and resend.

- [LithosDex pool state](https://lithosprotocol.org/docs/api/get-ld-pool.md): `GET /dex/pool`
- [Every LithosDex pool](https://lithosprotocol.org/docs/api/list-ld-pools.md): `GET /dex/pools`
- [One LithosDex pool and its vault](https://lithosprotocol.org/docs/api/get-ld-pool-by-nft.md): `GET /dex/pools/{poolNft}`
- [List your outstanding orders on any pool](https://lithosprotocol.org/docs/api/list-ld-pool-orders.md): `GET /dex/pools/{poolNft}/orders`
- [Quote a direct swap on any pool](https://lithosprotocol.org/docs/api/check-ld-pool-direct-swap.md): `POST /dex/pools/{poolNft}/swap/check`
- [Swap directly on any pool](https://lithosprotocol.org/docs/api/direct-ld-pool-swap.md): `POST /dex/pools/{poolNft}/swap`
- [Quote a direct deposit on any pool](https://lithosprotocol.org/docs/api/check-ld-pool-direct-deposit.md): `POST /dex/pools/{poolNft}/deposit/check`
- [Deposit directly on any pool](https://lithosprotocol.org/docs/api/direct-ld-pool-deposit.md): `POST /dex/pools/{poolNft}/deposit`
- [Quote a direct redemption on any pool](https://lithosprotocol.org/docs/api/check-ld-pool-direct-redeem.md): `POST /dex/pools/{poolNft}/redeem/check`
- [Redeem a provision directly on any pool](https://lithosprotocol.org/docs/api/direct-ld-pool-redeem.md): `POST /dex/pools/{poolNft}/redeem`
- [List your provisions on any pool](https://lithosprotocol.org/docs/api/list-ld-pool-provisions.md): `GET /dex/pools/{poolNft}/provisions`
- [Claim a provision's fees on any pool](https://lithosprotocol.org/docs/api/claim-ld-pool-provision.md): `POST /dex/pools/{poolNft}/provisions/{boxId}/claim`
- [Check a flush on any pool](https://lithosprotocol.org/docs/api/check-ld-pool-flush.md): `POST /dex/pools/{poolNft}/flush/check`
- [Flush any pool](https://lithosprotocol.org/docs/api/flush-ld-pool.md): `POST /dex/pools/{poolNft}/flush`
- [A verified pool's price history](https://lithosprotocol.org/docs/api/get-ld-pool-price-history.md): `GET /dex/pools/{poolNft}/price/history`
- [A verified pool's fee history](https://lithosprotocol.org/docs/api/get-ld-pool-fee-history.md): `GET /dex/pools/{poolNft}/fees/history`
- [A verified pool's recent activity](https://lithosprotocol.org/docs/api/get-ld-pool-recent-activity.md): `GET /dex/pools/{poolNft}/activity/recent`
- [A provision's fee history on a verified pool](https://lithosprotocol.org/docs/api/get-ld-pool-provision-fee-history.md): `GET /dex/pools/{poolNft}/provisions/{boxId}/fees/history`
- [Quote a new LithosDex pool](https://lithosprotocol.org/docs/api/check-ld-pool-create.md): `POST /dex/pools/create/check`
- [Create a LithosDex pool](https://lithosprotocol.org/docs/api/create-ld-pool.md): `POST /dex/pools/create`
- [Quote a swap order on any pool](https://lithosprotocol.org/docs/api/check-ld-pool-swap-order.md): `POST /dex/pools/{poolNft}/orders/swap/check`
- [Place a swap order on any pool](https://lithosprotocol.org/docs/api/place-ld-pool-swap-order.md): `POST /dex/pools/{poolNft}/orders/swap`
- [Quote a deposit order on any pool](https://lithosprotocol.org/docs/api/check-ld-pool-deposit-order.md): `POST /dex/pools/{poolNft}/orders/deposit/check`
- [Place a deposit order on any pool](https://lithosprotocol.org/docs/api/place-ld-pool-deposit-order.md): `POST /dex/pools/{poolNft}/orders/deposit`
- [Quote a redeem order on any pool](https://lithosprotocol.org/docs/api/check-ld-pool-redeem-order.md): `POST /dex/pools/{poolNft}/orders/redeem/check`
- [Place a redeem order on any pool](https://lithosprotocol.org/docs/api/place-ld-pool-redeem-order.md): `POST /dex/pools/{poolNft}/orders/redeem`
- [LithosDex fee vault state](https://lithosprotocol.org/docs/api/get-ld-vault.md): `GET /dex/vault`
- [List your outstanding orders](https://lithosprotocol.org/docs/api/list-ld-orders.md): `GET /dex/orders`
- [Quote a swap order](https://lithosprotocol.org/docs/api/check-ld-swap-order.md): `POST /dex/orders/swap/check`
- [Place a swap order](https://lithosprotocol.org/docs/api/place-ld-swap-order.md): `POST /dex/orders/swap`
- [Quote a deposit order](https://lithosprotocol.org/docs/api/check-ld-deposit-order.md): `POST /dex/orders/deposit/check`
- [Place a deposit order](https://lithosprotocol.org/docs/api/place-ld-deposit-order.md): `POST /dex/orders/deposit`
- [Quote a redeem order](https://lithosprotocol.org/docs/api/check-ld-redeem-order.md): `POST /dex/orders/redeem/check`
- [Place a redeem order](https://lithosprotocol.org/docs/api/place-ld-redeem-order.md): `POST /dex/orders/redeem`
- [Cancel an order](https://lithosprotocol.org/docs/api/cancel-ld-order.md): `POST /dex/orders/{boxId}/cancel`
- [Quote a swap](https://lithosprotocol.org/docs/api/check-ld-swap.md): `POST /dex/swap/check`
- [Quote a swap by desired output](https://lithosprotocol.org/docs/api/check-ld-swap-output.md): `POST /dex/swap/checkOutput`
- [Execute a swap](https://lithosprotocol.org/docs/api/ld-swap.md): `POST /dex/swap`
- [Quote a liquidity deposit](https://lithosprotocol.org/docs/api/check-ld-deposit.md): `POST /dex/deposit/check`
- [Deposit liquidity](https://lithosprotocol.org/docs/api/ld-deposit.md): `POST /dex/deposit`
- [Quote a liquidity redemption](https://lithosprotocol.org/docs/api/check-ld-redeem.md): `POST /dex/redeem/check`
- [Redeem liquidity](https://lithosprotocol.org/docs/api/ld-redeem.md): `POST /dex/redeem`
- [List liquidity provisions](https://lithosprotocol.org/docs/api/list-ld-provisions.md): `GET /dex/provisions`
- [Look up provision NFTs](https://lithosprotocol.org/docs/api/lookup-ld-provision-nfts.md): `POST /dex/provisions/nft`
- [Claim settled fees for a provision](https://lithosprotocol.org/docs/api/claim-ld-provision.md): `POST /dex/provisions/{boxId}/claim`
- [Quote a provision resize](https://lithosprotocol.org/docs/api/check-ld-resize.md): `POST /dex/provisions/{boxId}/resize/check`
- [Resize a provision](https://lithosprotocol.org/docs/api/ld-resize.md): `POST /dex/provisions/{boxId}/resize`
- [Check a pending fee flush](https://lithosprotocol.org/docs/api/check-ld-flush.md): `POST /dex/flush/check`
- [Flush pending fees to the vault](https://lithosprotocol.org/docs/api/ld-flush.md): `POST /dex/flush`
- [Pool-wide fee history](https://lithosprotocol.org/docs/api/get-ld-fee-history.md): `GET /dex/fees/history`
- [Pool price history](https://lithosprotocol.org/docs/api/get-ld-price-history.md): `GET /dex/price/history`
- [Recent pool activity](https://lithosprotocol.org/docs/api/get-ld-recent-activity.md): `GET /dex/activity/recent`
- [Fee history for one provision](https://lithosprotocol.org/docs/api/get-ld-provision-fee-history.md): `GET /dex/provisions/{boxId}/fees/history`

### Difficulty Forwards

Difficulty forwards: peer-to-peer bets on Ergo's mean difficulty over a window of 1 to 120 epochs of 128 blocks, margined in LIT. A maker posts an offer, a taker fills it, and once the window is recorded anyone settles it. The long side is paid when the window's mean is above the strike, the short side when it is below, up to each side's margin of a fifth of the notional.

Reads and every `check` are open; your positions and everything that signs need an `api_key`. **All amounts and difficulties are decimal strings, not JSON numbers.** LIT amounts are base units (9 decimals). A 409 means a box you named is already being spent: re-read and resend.

- [Difficulty accumulator and the next epoch's difficulty](https://lithosprotocol.org/docs/api/get-df-accumulator.md): `GET /forwards/accumulator`
- [List open offers](https://lithosprotocol.org/docs/api/list-df-offers.md): `GET /forwards/offers`
- [Create an offer](https://lithosprotocol.org/docs/api/create-df-offer.md): `POST /forwards/offers`
- [Quote an offer](https://lithosprotocol.org/docs/api/check-df-offer.md): `POST /forwards/offers/check`
- [Quote filling an offer](https://lithosprotocol.org/docs/api/check-df-fill.md): `POST /forwards/offers/{boxId}/fill/check`
- [Fill an offer](https://lithosprotocol.org/docs/api/fill-df-offer.md): `POST /forwards/offers/{boxId}/fill`
- [Quote cancelling an offer](https://lithosprotocol.org/docs/api/check-df-cancel.md): `POST /forwards/offers/{boxId}/cancel/check`
- [Cancel an offer](https://lithosprotocol.org/docs/api/cancel-df-offer.md): `POST /forwards/offers/{boxId}/cancel`
- [The whole market](https://lithosprotocol.org/docs/api/get-df-market.md): `GET /forwards/market`
- [Your settled positions and closed offers](https://lithosprotocol.org/docs/api/get-df-history.md): `GET /forwards/history`
- [List your positions and offers](https://lithosprotocol.org/docs/api/list-df-positions.md): `GET /forwards/positions`
- [Quote settling a position](https://lithosprotocol.org/docs/api/check-df-settle.md): `POST /forwards/positions/{boxId}/settle/check`
- [Settle a position](https://lithosprotocol.org/docs/api/settle-df-position.md): `POST /forwards/positions/{boxId}/settle`

### SigmaFi Bonds

SigmaFi bonds: peer-to-peer zero-coupon loans. A borrower posts a collateral-backed order. A lender fills it, creating a bond and minting two bond-asset units: one singleton locked in the bond and one circulating claim for the lender. Repayment and liquidation burn the singleton. The borrower repays before maturity and takes the collateral back; otherwise anyone may liquidate the bond, sending the borrower's collateral to the vault. The lender chooses and funds a separate batching reserve on fill, above all borrower collateral; repayment refunds it to the bond holder, while liquidation may pay it to the liquidator. Whoever holds the bond asset claims what the vault holds for it.

Lists, the asset lookup and every `check` are open and sign nothing; the portfolio and everything that signs need an `api_key`. **All amounts are decimal strings, not JSON numbers.** A 409 means a box you named is already being spent: re-read and resend.

- [List open orders](https://lithosprotocol.org/docs/api/list-sf-orders.md): `GET /sigmafi/orders`
- [Create an order](https://lithosprotocol.org/docs/api/create-sf-order.md): `POST /sigmafi/orders`
- [Quote an order](https://lithosprotocol.org/docs/api/check-sf-order.md): `POST /sigmafi/orders/check`
- [Quote cancelling an order](https://lithosprotocol.org/docs/api/check-cancel-sf-order.md): `POST /sigmafi/orders/{boxId}/cancel/check`
- [Cancel an order](https://lithosprotocol.org/docs/api/cancel-sf-order.md): `POST /sigmafi/orders/{boxId}/cancel`
- [Quote filling an order](https://lithosprotocol.org/docs/api/check-fill-sf-order.md): `POST /sigmafi/orders/{boxId}/fill/check`
- [Fill an order](https://lithosprotocol.org/docs/api/fill-sf-order.md): `POST /sigmafi/orders/{boxId}/fill`
- [List live bonds](https://lithosprotocol.org/docs/api/list-sf-bonds.md): `GET /sigmafi/bonds`
- [Quote repaying a bond](https://lithosprotocol.org/docs/api/check-repay-sf-bond.md): `POST /sigmafi/bonds/{boxId}/repay/check`
- [Repay a bond](https://lithosprotocol.org/docs/api/repay-sf-bond.md): `POST /sigmafi/bonds/{boxId}/repay`
- [Quote liquidating a bond](https://lithosprotocol.org/docs/api/check-liquidate-sf-bond.md): `POST /sigmafi/bonds/{boxId}/liquidate/check`
- [Liquidate a bond](https://lithosprotocol.org/docs/api/liquidate-sf-bond.md): `POST /sigmafi/bonds/{boxId}/liquidate`
- [Quote a claim](https://lithosprotocol.org/docs/api/check-sf-claim.md): `POST /sigmafi/claims/{tokenId}/check`
- [Claim a settled bond](https://lithosprotocol.org/docs/api/claim-sf-bond.md): `POST /sigmafi/claims/{tokenId}`
- [Look up bond assets](https://lithosprotocol.org/docs/api/lookup-sf-assets.md): `POST /sigmafi/assets`
- [This wallet in SigmaFi](https://lithosprotocol.org/docs/api/get-sf-portfolio.md): `GET /sigmafi/portfolio`

### Oracle Feeds

Confirmed oracle feeds read from this client's Ergo node and extra index. The shipped mainnet feed `erg-usd` is USD v2. Other v2 pools can be configured under `oracles.feeds`. Prices and raw integers are decimal strings. No wallet or API key is required.

- [List configured oracle feeds](https://lithosprotocol.org/docs/api/list-oracle-feeds.md): `GET /oracles`
- [Current oracle state and recent confirmed history](https://lithosprotocol.org/docs/api/get-oracle-feed.md): `GET /oracles/{feedId}`

### Wallet

The client's own wallet: ERG and token balances, block rewards, the arb stake, and the list of verified tokens those balances are matched against. Balances, rewards and the arb stake require an `api_key`; the verified list does not.

**All amounts are decimal strings, not JSON numbers.** ERG amounts are nanoERG; LIT amounts are base units (9 decimals).

- [Wallet balances](https://lithosprotocol.org/docs/api/get-wallet-balances.md): `GET /wallet/balances`
- [Your block rewards](https://lithosprotocol.org/docs/api/get-wallet-reward-summary.md): `GET /wallet/rewards`
- [Claim unlocked block rewards](https://lithosprotocol.org/docs/api/claim-wallet-rewards.md): `POST /wallet/rewards/claim`
- [Verified tokens](https://lithosprotocol.org/docs/api/get-verified-tokens.md): `GET /wallet/tokens/verified`
- [Arb stake](https://lithosprotocol.org/docs/api/get-wallet-arb-stake.md): `GET /wallet/arb`
- [Reclaim the arb stake](https://lithosprotocol.org/docs/api/reclaim-wallet-arb-stake.md): `POST /wallet/arb/reclaim`

### Mining

Information about the local stratum and mining process

- [Get Stratum information](https://lithosprotocol.org/docs/api/get-stratum-info.md): `GET /mining`
- [Get candidate settings](https://lithosprotocol.org/docs/api/get-candidate-settings.md): `GET /mining/candidate`
- [Get difficulty commitment](https://lithosprotocol.org/docs/api/get-commitment.md): `GET /mining/commitment`
- [Commit a difficulty](https://lithosprotocol.org/docs/api/commit-difficulty.md): `POST /mining/commitment`
- [Get best NISP at height](https://lithosprotocol.org/docs/api/get-best-nisp-at-height.md): `GET /mining/bestNISP`
