Skip to content

fix: polish crate docs, add READMEs, enforce missing_docs#158

Merged
kayibal merged 16 commits intomainfrom
docs/polish-crate-docs
Apr 1, 2026
Merged

fix: polish crate docs, add READMEs, enforce missing_docs#158
kayibal merged 16 commits intomainfrom
docs/polish-crate-docs

Conversation

@kayibal
Copy link
Copy Markdown
Contributor

@kayibal kayibal commented Mar 26, 2026

All four Rust crates now have complete, navigable docs on docs.rs. Previously, missing_docs was not enforced, intra-doc links were broken, and the example code in fynd-client used a verbose address instantiation pattern and had a broken doctest.

What changed:

  • Enforce #![deny(missing_docs)] across all crates; fill every gap
  • Fix broken intra-doc links in fynd-core and fynd-rpc
  • Expand the encoding module doc with links to the tycho-execution and Fynd encoding guide
  • Add direct link to the API reference (docs.fynd.xyz/reference/api) in fynd-rpc
  • Fix fynd-client doctest: succinct address instantiation, correct Result return context, crate-relative example path
  • Unpin fynd-client README version ("0.35""0")
  • Add a Rust API Reference section to the GitBook sidebar linking to docs.rs for all four crates

Users integrating the Rust crates get accurate, fully linked API docs on docs.rs and can navigate from the GitBook site directly to crate-level reference.

🤖 Generated with Claude Code

@kayibal kayibal changed the title docs: polish crate docs, add READMEs, enforce missing_docs fix: polish crate docs, add READMEs, enforce missing_docs Mar 26, 2026
Comment on lines 47 to 52
pub struct DepthAndPrice {
/// Spot price (token_out per token_in) for this edge direction.
pub spot_price: f64,
/// Liquidity depth in USD (or native token terms).
/// Liquidity depth denominated in the chain's native token.
pub depth: f64,
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tvinagre can you confirm the denomination here please?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked the code and I think we have a bug.. depth is in raw units of sell_token - which is fine if we're comparing same In-out token paths, but that is not the case. I'm investigating this further and will open a PR soon if the bug exists

@@ -7,6 +7,7 @@ use tycho_simulation::{tycho_core::traits::FeePriceGetter, tycho_ethereum::gas::
use crate::feed::{market_data::SharedMarketDataRef, DataFeedError};

// TODO: Refactor gas price fetching into a `DerivedComputation`.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tvinagre is this still a TODO?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless we think it's irrelevant.
It's a discussion if gas should be treated as derived data or not - and if it should block solving or not

@kayibal kayibal force-pushed the docs/polish-crate-docs branch from 2c7492d to b17e39d Compare March 27, 2026 11:15
Copy link
Copy Markdown
Collaborator

@dianacarvalho1 dianacarvalho1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @kayibal ! 🙏🏼 only have smol comments

//! "https://rpc.fynd.exchange",
//! "https://mainnet.infura.io/v3/YOUR_KEY",
//! "http://localhost:3000",
//! "https://reth-ethereum.ithaca.xyz/rpc",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in other places we are using https://eth.llamarpc.com. Should we be consistent?

Comment on lines +9 to +12
```toml
[dependencies]
fynd-client = "0" # see crates.io for the latest version
```
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just cargo add fynd-client then? 👀

/// Route encoder: converts solver output into ABI-encoded on-chain calldata.
///
/// Wraps [tycho-execution](https://docs.propellerheads.xyz/tycho/for-solvers/execution) to
/// produce ABI-encoded calldata for single and sequential swaps, with and without Permit2. See
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

single, sequential and split swaps

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know we don't have an algo that does splits yet but the encoding already supports it

kayibal and others added 15 commits April 1, 2026 10:33
…itSingle::new

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Add a Workflow section pointing to the swap_erc20 example, add a
build_quote_only example, and replace placeholder address bytes with
real mainnet addresses via alloy::primitives::address!.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Also adds field-level docs to FyndError::Api named fields, which were
the only items not yet covered.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Replace placeholder https://rpc.fynd.exchange URLs with
http://localhost:3000 (default Fynd) and http://localhost:8545 (Anvil).
Add docs.fynd.xyz link in the crate intro and workflow section.
Add README.md for crates.io.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…README

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Add docs.fynd.xyz link in crate intro. Add doc comments to all
previously undocumented public items: module declarations, defaults
constants, ApiDoc/ExperimentalApiDoc structs, StaleData::age_ms field,
IncludeField variants, FyndRPCBuilder::build, and parse_chain.
Add README.md for crates.io.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Add docs.fynd.xyz link and workflow description in crate intro. Add
declarations, defaults constants, BellmanFordAlgorithm, AlgorithmError
named fields, price_guard types, SolveError named fields,
RouteValidationError/OrderValidationError variants and fields,
QuoteRequest, WorkerPoolBuilder::new, FyndBuilder::chain, and
test_utils helpers.
Add README.md for crates.io.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Remove inline code examples from all READMEs. Each README now contains
a brief description, install snippet, and links to docs.fynd.xyz
instead of duplicating workflow steps and examples.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Rustdoc resolves //! inner docs in the parent module's scope, not the
submodule's own scope. Fixed by using fully-qualified crate paths.
Also fixed backtick display text in [`text`](path) links, which rustdoc
treats as an additional intra-doc link resolution target.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Use succinct address!().to_vec().into() form in fynd-client doctest
- Fix broken doctest (missing Result return context for ?)
- Fix workspace-relative example path to crate-relative in lib.rs docs
- Unpin fynd-client version in README (0.35 -> 0)
- Expand encoding module docs with links to tycho-execution and encoding guide
- Add direct link to API reference (docs.fynd.xyz/reference/api) in fynd-rpc

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Resolve review feedback: use `cargo add` in README, use ithaca RPC URL
consistently, add split swaps to encoding docs, fix depth doc to raw
sell_token units. Add missing doc comments for new public items
introduced after rebase (FailedItemError variants, PriceGuard,
HyperliquidProvider, Bytes methods).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kayibal kayibal force-pushed the docs/polish-crate-docs branch from b17e39d to 4281989 Compare April 1, 2026 09:40
Add `RUSTDOCFLAGS="-D warnings" cargo doc` to check.sh so broken doc
links and code blocks are caught locally before CI. Fix unresolved
intra-doc links in price_guard module (use crate-absolute paths) and
a malformed code block in fynd-client lib.rs. Update knowledge docs
with the new check.sh step.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kayibal kayibal merged commit aeb7f3f into main Apr 1, 2026
18 checks passed
@kayibal kayibal deleted the docs/polish-crate-docs branch April 1, 2026 11:32
@propellerci
Copy link
Copy Markdown

propellerci bot commented Apr 1, 2026

This PR is included in version 0.43.1 🎉

@propellerci propellerci bot added the true label Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants