riftenlabs-indexer/Cargo.toml

55 lines
1.8 KiB
TOML
Raw Normal View History

2023-11-29 12:25:04 +01:00
[package]
2024-04-02 14:07:21 +02:00
name = "riftenlabs-indexer"
2026-02-10 14:48:45 +01:00
version = "0.2.0"
2023-11-29 12:25:04 +01:00
edition = "2021"
2026-02-10 14:48:45 +01:00
authors = ["Whiterun LLC <hello@riftenlabs.com>"]
2023-11-29 12:25:04 +01:00
description = "Riften Labs DeFi contract indexer on Bitcoin Cash"
license = "AGPL-3.0-or-later"
2024-04-02 14:07:21 +02:00
homepage = "https://gitlab.com/riftenlabs/riftenlabs-indexer"
repository = "https://gitlab.com/riftenlabs/riftenlabs-indexer"
2023-11-29 12:25:04 +01:00
keywords = ["bitcoincash", "bitcoin", "cauldron", "defi", "cpmm"]
readme = "README.md"
2024-10-25 15:28:40 +02:00
build = "build.rs"
2023-11-29 12:25:04 +01:00
[dependencies]
anyhow = { version = "1.0.94", features = ["backtrace"] }
tokentoken/tokenbch: index delegation pools, replace the pre-delegation AMM Replace the old P2SH32/CONJURE TokenToken AMM indexer (never in production; its tables are dropped by an always-run migration) with the delegation-model indexers from riftenlabs-defi 0.4.5: - tokentoken: two co-created bare-P2S UTXOs (thin main + storage sibling). tokenbch (new): single-UTXO token<->BCH pool with the runtime feePaidInToken fee side. Both admitted purely by the constant locking derived from the per-network delegation-pool platform NFTH. - src/db/orbconstants.rs: ONE platform NFTH serves both contracts — chipnet pins the deployed ORB v0 value (libriften orb/v0/chipnet.ts), mainnet is the all-zero placeholder: while unconfigured NOTHING delegation-related is parsed, fetched or indexed (fail-closed). - Schema: immutable config (nftOwner, tokens, poolFeeRate, minFee, virtualX/Y, tokenbch feePaidInToken) on the pool row; per-state history carries raw reserves, owed, platformFeeRate (both mutable by platform sweeps) and deltas. History rows now FK tx(txid) ON DELETE CASCADE, so evicted mempool txs clean up after themselves (the old tokentoken indexer leaked those). - LP teardowns carry no pool output: ingestion probes every blob-presenting tx's spent outpoints against the recorded pool set and flags a known pool UTXO spent without successor as withdrawn (withdrawn_in_txid FK ON DELETE SET NULL reverts an evicted teardown; reorg undo reverts a confirmed one). - electrum mempool filters: the combined logic blob (scriptsig; every spend incl. teardowns) + the constant thin-main locking (scriptpubkey; creations), per contract, skipped while unconfigured. - RPC: /tokentoken responses gain owed_a, platform/pool fee rates, minFee and virtual offsets; new /tokenbch (pool/active?token, pools, tokens) mirrors it for BCH pairs. - deps: bitcoincash 0.32.4 (token.amount -> .to_int() in the ido indexer), riftenlabs-defi 0.4.5. NOTE: 0.4.5 (rust-riftenlabs-defi 7c65f66) is not on crates.io yet — until it is published, build with a local [patch.crates-io] pointing at the sibling checkout (the committed Cargo.lock carries the path-patched entry). Also fixes a latent test bug (ido_params_nft_commitment_roundtrip never wrote createExecutionFee after the 127-byte layout shift). Verified: cargo build, test (232 passing), clippy (no new warnings) and fmt all clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-04 15:30:55 +00:00
bitcoincash = "0.32.4"
bitcoin_hashes = { version = "0.14.100", default-features = false } # Same version as used by bitcoincash
electrum-client-netagnostic = { version = "0.21.2", features = ["use-rustls", "use-websocket"] }
hex = { version = "0.4.3", features = ["serde"] }
2024-03-04 16:40:50 +01:00
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.133"
rocket = { version = "0.5.1", features = ["json"] }
sqlx = { version = "0.8", features = ["runtime-tokio", "sqlite"] }
rayon = "1.10.0"
tokentoken/tokenbch: index delegation pools, replace the pre-delegation AMM Replace the old P2SH32/CONJURE TokenToken AMM indexer (never in production; its tables are dropped by an always-run migration) with the delegation-model indexers from riftenlabs-defi 0.4.5: - tokentoken: two co-created bare-P2S UTXOs (thin main + storage sibling). tokenbch (new): single-UTXO token<->BCH pool with the runtime feePaidInToken fee side. Both admitted purely by the constant locking derived from the per-network delegation-pool platform NFTH. - src/db/orbconstants.rs: ONE platform NFTH serves both contracts — chipnet pins the deployed ORB v0 value (libriften orb/v0/chipnet.ts), mainnet is the all-zero placeholder: while unconfigured NOTHING delegation-related is parsed, fetched or indexed (fail-closed). - Schema: immutable config (nftOwner, tokens, poolFeeRate, minFee, virtualX/Y, tokenbch feePaidInToken) on the pool row; per-state history carries raw reserves, owed, platformFeeRate (both mutable by platform sweeps) and deltas. History rows now FK tx(txid) ON DELETE CASCADE, so evicted mempool txs clean up after themselves (the old tokentoken indexer leaked those). - LP teardowns carry no pool output: ingestion probes every blob-presenting tx's spent outpoints against the recorded pool set and flags a known pool UTXO spent without successor as withdrawn (withdrawn_in_txid FK ON DELETE SET NULL reverts an evicted teardown; reorg undo reverts a confirmed one). - electrum mempool filters: the combined logic blob (scriptsig; every spend incl. teardowns) + the constant thin-main locking (scriptpubkey; creations), per contract, skipped while unconfigured. - RPC: /tokentoken responses gain owed_a, platform/pool fee rates, minFee and virtual offsets; new /tokenbch (pool/active?token, pools, tokens) mirrors it for BCH pairs. - deps: bitcoincash 0.32.4 (token.amount -> .to_int() in the ido indexer), riftenlabs-defi 0.4.5. NOTE: 0.4.5 (rust-riftenlabs-defi 7c65f66) is not on crates.io yet — until it is published, build with a local [patch.crates-io] pointing at the sibling checkout (the committed Cargo.lock carries the path-patched entry). Also fixes a latent test bug (ido_params_nft_commitment_roundtrip never wrote createExecutionFee after the 127-byte layout shift). Verified: cargo build, test (232 passing), clippy (no new warnings) and fmt all clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-04 15:30:55 +00:00
riftenlabs-defi = "0.4.5"
2024-01-19 14:38:31 +01:00
rocket_cors = "0.6.0"
2024-02-14 11:11:16 +01:00
log = "0.4"
stderrlog = "0.6.0"
tokio = { version = "1", features = ["full"] }
rust_decimal = { version = "1.36", features = ["maths"] }
rust_decimal_macros = "1.36"
reqwest = { version = "0.12", features = ["json", "rustls-tls"], default-features = false }
rand = "0.8.5"
configure_me = "0.4.0"
futures = "0.3.32"
serde_with = { version = "3.18.0", features = ["hex"] }
[build-dependencies]
configure_me_codegen = "0.4.8"
2025-07-16 09:30:17 +02:00
[dependencies.malachite]
version = "0.6.1"
default-features = false
features = [ "naturals_and_integers"]
[package.metadata.configure_me]
spec = "internal/config_specification.toml"
2024-03-04 16:40:50 +01:00
[profile.release]
debug = true
2025-07-16 09:31:14 +02:00
[lints.clippy]
# workaround for generated code in depdencendy configure_me
uninlined_format_args = "allow"