Skip to content

Lithos Mainnet 1.0.7

Latest

Choose a tag to compare

@K-Singh K-Singh released this 02 Nov 18:03

LithosDex Pools, New Batching Sources and NiceHash Stratum

LithosDex now supports pool creation, verification, and token/token pools. Pools are verified manually or through genesis checks. Miners now fill LithosDex token/token orders, ErgoDEX token pool orders and Machina Finance orders. The stratum can serve rented NiceHash hashrate behind stratum.niceHashMode. The webpanel received new updates to its LithosDex and Collateral pages, along with a newly made Wallet page. This update makes some changes to API formats, please make sure to read them carefully.

Commit: 1d93ac2

To run the application, unzip the file and then run the script in the /bin directory.

./lithos-client

This will automatically read from lithos.conf in your /bin folder.

To run with a custom configuration file add the argument -Dconfig.file=

./lithos-client "-Dconfig.file=path/to/custom/config/file.conf"

To build from source run:

sbt dist

This will create a new zip file in the /target/universal directory


Release Notes:

Upgrade Notes

  • Wallet API moved, and the old routes are deleted. GET /collateral/rewards is now GET /wallet/rewards, and POST /collateral/rewards/claim is now POST /wallet/rewards/claim. The collateral field of GET /wallet/balances is gone: the same lending status is now GET /collateral/wallet. Scripts calling the old routes get a 404. The Lithos Launcher calls only /info and is unaffected.
  • GET /wallet/balances gains reservedBoxes and reservedNanoErgs, and verified and ticker on each token.
  • Every rig sees two stratum changes: the subscribe result now lists its subscriptions in the standard layout instead of [null, …], and jobs are held until the subscribe is answered.
  • No statistics store is rebuilt. Collateral selection paths are recorded from 1.0.7 on, so the APR by selection path covers more of its 30-day window each day.

LithosDex

  • Create a pool of either kind, from POST /dex/pools/create or the web panel. Creation sends four transactions: the pool NFT, the vault NFT, the NFT that owns the creator's provision, and the genesis. The genesis gives the creator a provision for every share but a millionth, which stays locked in the pool.
  • A creator chooses the fees, 0.15% kept by the pool and 0.15% to providers on each side by default. Creation charges no fee of its own. A token/token pool box holds 6.3 ERG and its vault 2.3 ERG, an ERG/token vault 0.1 ERG, none of it returned.
  • GET /dex/pools lists every pool, ERG:LIT first, then verified pools, then the newest. GET /dex/pools/{poolNft} returns one pool and its vault.
  • Swaps, deposits and redemptions on any pool, as orders under /dex/pools/{poolNft}/orders/ or directly under /dex/pools/{poolNft}/, each with a /check quote. A token/token swap names the token it sells.
  • Flush and claim on any pool: POST /dex/pools/{poolNft}/flush and POST /dex/pools/{poolNft}/provisions/{boxId}/claim. GET /dex/pools/{poolNft}/provisions and GET /dex/pools/{poolNft}/orders list this wallet's provisions and orders there.
  • Swap quotes carry minAmountIn, the least input that buys the same output, and priceImpact, protocolFee and ammFee.
  • A direct trade answers 409 when expectedPoolBoxId no longer matches the pool. A direct redeem of a provision still owed fees needs acknowledgeUnclaimedFees.
  • POST /dex/provisions/nft checks up to 100 token ids and answers, for each, whether it owns an open provision, which pool, its shares and fees, and whether it was redeemed.
  • Token/token provisions pay whoever refreshes them up to 0.01 ERG of the box's own ERG, never taking the box below 0.4 ERG.
  • Token/token pools and their swap orders round each side's provider fee up, so no swap that owes a fee pays none of it.

Verified Pools and Tokens

  • conf/verified/tokens.json and conf/verified/pools.json ship inside the client and change only with a release. LIT and ERG:LIT are always verified. A bad list leaves only those two verified, logs every problem, and never stops the client.
  • GET /wallet/tokens/verified returns the verified tokens.
  • Every other pool's genesis is checked once: both NFTs minted once, every share in the pool or a genesis provision, nothing pending or accrued, fees within bounds. GET /dex/pools reports each failure in problems and anything risky but not exploitable in warnings.
  • On a pool with problems, the client refuses swaps and deposits. Redeems, flushes and claims stay open, so liquidity can always leave.
  • Swaps and deposits on an unverified pool need acknowledgeUnverified: true.
  • Price, fee and activity graphs are kept for verified pools only, each from the block it joined the list. Graph routes answer 404 for any other pool.
  • lithosdex.pools.hidden leaves pools out of the pool list. A hidden pool still opens by link, and its orders are still filled.

Batching

  • LithosDex token/token swap, deposit and redeem orders are filled beside the ERG/token ones, under batching.lithosdex.discoverPools, in your own blocks and by broadcast.
  • ErgoDEX token pool swaps, deposits and redemptions are filled, for orders that pay their executor fee in ERG. Orders paying in SPF are not filled.
  • Machina Finance limit and grid orders between ERG and a token are filled in the same transaction as an ErgoDEX pool swap, so a fill needs no capital and earns the price gap in ERG. Only the newest Machina contracts are filled. Fills ride the ErgoDEX batcher's settings and candidate source, and statistics count them under ErgoDEX.
  • The LithosDex and ErgoDEX batchers reuse their last scan while the node's index stays at the same block, about 15 times fewer scan reads.
  • A Machina order is parsed only when its whole script matches a known contract, so an altered order cannot take a build slot it would then fail.

Mining

  • Added stratum.niceHashMode, off by default. On, the stratum sends each job's share difficulty with mining.set_difficulty instead of 1, which NiceHash requires, and warns when that difficulty is under the 4,000,000,000 NiceHash accepts for Autolykos. Turn it on only when NiceHash connects.
  • Submits are parsed in their 3, 4 and 5 parameter layouts. A malformed submit is answered with error 20 instead of left waiting.
  • mining.extranonce.subscribe is acknowledged. In NiceHash mode, mining.set_extranonce goes only to a client that asked for it.
  • Unsupported methods are refused under the id the client sent. Authorize no longer needs a password.

Statistics

  • /stats/mining/totals and /stats/mining/buckets carry tokens: token takings for verified tokens, with ticker and decimals, and a count of unverified ones.
  • Difficulty forwards recordings and settlements are now counted, under forwards. LithosDex token/token executions are now counted too.
  • /stats/collateral gains queue: the best queued bid, how many boxes share its 0.001 ERG step, and the least bid that goes first. It also gains selection: lender APR for boxes selected by bid and by clearance age.

Configuration

  • Added stratum.niceHashMode (false).
  • Added lithosdex.pools.hidden (["eb123f49f083f5b68d10d7037a45eb11d3371210ab10bc66757e29432d661ee6"], a test LIT/RSN pool).

Webpanel

  • New Wallet page: spendable and held ERG, tokens with verified badges and icons, provision NFT checks, and lending rewards with a claim. Token icons come from the Nautilus wallet.
  • Every LithosDex tab acts on the pool chosen in the header, ERG:LIT by default. A Pools tab lists every pool with its badge, and a create flow states the locked share and each box's ERG.
  • Every pool's swap and liquidity cards offer orders or direct trades, and every swap shows its execution price, minimum received, price impact and fees.
  • Unverified pools ask for consent on each trade. Pools that can be drained have warnings attached.
  • The Liquidity tab has a section to look up any provision NFT.
  • The collateral fee book pages its graphs, with 20, 50 or 100 boxes per side, and shows the best queued bid and the bid that goes first. The join page gains a First fee preset, and Lender returns show APR by selection path.
  • Mining > Payments shows forwards takings and token takings.
  • The active tab is highlighted again in production builds.

WebDocs

  • New pages: Choosing a pool, Creating a pool, and Checking your wallet.
  • New guide: Renting hashrate into Lithos, including stratum.niceHashMode and the NiceHash setup.
  • Updated the LithosDex overview, orders and liquidity pages for every pool, the provision NFT lookup and token/token refreshes.
  • Updated Batching and orders and the candidate sources for ErgoDEX token pools, Machina Finance and LithosDex token/token pools.
  • Updated the reward claim route on the wallet configuration page.
  • Regenerated the API reference.