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/Client API/Collateral Market

Join the collateral queue

post/collateral/joinapi_key

Post principal and permit for count new positions, each under its own lender key. Positions cannot be withdrawn once queued, so acknowledgeNoWithdrawal must be true. Send expectedEmissionBoxId from the quote to get a 409 instead of a join priced against stale state.

Send priorityFeeEachNanoErgs as the quote was taken at, since it decides what each position locks up. A non-zero fee is at least minPriorityFeeNanoErgs, but there is no maximum: a fee above the quote's break-even is accepted, because the mined block's own transaction fees can still cover it.

Refused with 409 while the client has autoCollateralize on. The automated pass owns lender-key selection, and a manual join can take a key it is already using; only one live position per key is allowed, and the second is forfeited. Check manualJoinAllowed on the quote first.

Positions are created one at a time, each chained onto the last. If one fails, the run stops there: the response is 200 with the positions already created and a stoppedReason. A run that creates none returns an error status instead.

Request body

CollateralJoinExecuteRequest · application/json
  • countinteger · int32required

    Positions to create

    1 – 25
  • acknowledgeNoWithdrawalbooleanrequired

    Must be true, or the request is rejected with 400. A queued position cannot be withdrawn or cancelled; its principal and permit return only when a block spends the box.

  • maxPermitEachLitstring

    Permit cap. If any single permit would exceed this, nothing is sent. Omit for no cap. Decimal string.

  • expectedEmissionBoxIdstring

    Emission box the quote was made against

  • priorityFeeEachNanoErgsstring

    The fee, as the quote was taken at. Omitted or '0' posts at the floor; anything else is at least minPriorityFeeNanoErgs. Not capped at the quote's break-even — a higher fee is accepted and can still be repaid by the mined block's transaction fees. Decimal string.

    default "0"decimal string

Responses

200The join transactions, one per positionCollateralJoinResult▶
  • ▶
    joinsCollateralJoinEntry[]required
    • outcomestringrequired

      Node submission outcome for the known transaction ID.

      one ofacceptedrejecteduncertain
    • txIdstringrequired
    • positioninteger · int64required

      Queue position taken

    • lenderAddressstringrequired

      The key holding this position. It receives the block reward when the position is mined against, and the permit back when the box is spent.

    • principalNanoErgsstringrequired

      What this position locked up, the whole priority fee included. Decimal string.

    • priorityFeeNanoErgsstring

      The fee this position posted. '0' when it posted at the floor. Decimal string.

    • permitLitstringrequired

      Decimal string.

  • totalNanoErgsstringrequired

    Everything sent, principals plus fees. Decimal string.

  • stoppedReasonstring

    Present when fewer positions were created than requested, giving the error that stopped the run. The entries in joins were still created and their principal is committed.

400Malformed body, a count outside 1..25, a permit cap below the current requirement, or `acknowledgeNoWithdrawal` not set. ApiError▶
  • errorintegerrequired

    Error code

  • reasonstringrequired

    Error message explaining the reason of the error

  • detailstringrequirednullable

    Detailed error description

409`autoCollateralize` is on, so manual joins are refused — the client's own pass owns joining. Also returned when the emission box moved between quote and send, in which case re-quote and resend. ApiError▶
  • errorintegerrequired

    Error code

  • reasonstringrequired

    Error message explaining the reason of the error

  • detailstringrequirednullable

    Detailed error description

422The wallet cannot cover it, a permit exceeds `maxPermitEachLit`, fewer free lender keys remain than positions requested, or the run created no position at all. ApiError▶
  • errorintegerrequired

    Error code

  • reasonstringrequired

    Error message explaining the reason of the error

  • detailstringrequirednullable

    Detailed error description

503Node or wallet unavailable. Retry.ApiError▶
  • errorintegerrequired

    Error code

  • reasonstringrequired

    Error message explaining the reason of the error

  • detailstringrequirednullable

    Detailed error description

defaultErrorApiError▶
  • errorintegerrequired

    Error code

  • reasonstringrequired

    Error message explaining the reason of the error

  • detailstringrequirednullable

    Detailed error description

← PreviousQuote joining the queueNext →LithosDex pool state
Request
curl -X POST "http://localhost:9000/collateral/join" \
  -H "api_key: $LITHOS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "count": 3, "acknowledgeNoWithdrawal": true, "maxPermitEachLit": "20000000000", "expectedEmissionBoxId": "88c297f99da7172f6aa20efbead69aa40e2b7734a1873d66ca1db6b19d214db6", "priorityFeeEachNanoErgs": "10000000" }'
Response
{
  "joins": [
    {
      "outcome": "accepted",
      "txId": "40b7d045a858d537cdbf072e46ffbb86c0c9f6b0e93c369c1ffcba76797636d7",
      "position": 1247,
      "lenderAddress": "3WwbQFz3vgi8ChY9dM1haQLGDeQYe5U9z98bwWW4TqxxEAvyYu5y",
      "principalNanoErgs": "2925000000",
      "priorityFeeNanoErgs": "10000000",
      "permitLit": "19370000000"
    }
  ],
  "totalNanoErgs": "8748000000",
  "stoppedReason": "Double spending attempt"
}