Skip to content

feat: Dr. Fraudsworth TradingVenue integration#2

Open
MetalLegBob wants to merge 1 commit intoTitan-Pathfinder:mainfrom
MetalLegBob:drfraudsworth-integration
Open

feat: Dr. Fraudsworth TradingVenue integration#2
MetalLegBob wants to merge 1 commit intoTitan-Pathfinder:mainfrom
MetalLegBob:drfraudsworth-integration

Conversation

@MetalLegBob
Copy link
Copy Markdown

Summary

  • Replace Raydium example with Dr. Fraudsworth DeFi protocol implementation
  • 6 venue instances covering 8 swap directions: 2 taxed SOL pools (CRIME/SOL, FRAUD/SOL) + 4 fixed-rate vault conversions (CRIME/FRAUD <-> PROFIT)
  • Mainnet-ready: all addresses hardcoded, validated against live mainnet data + devnet TX execution

Architecture

Swaps route through the Tax Program (not the AMM directly). Tax is deducted (3-14% dynamic, epoch-dependent), then CPI into the constant-product AMM. Full CPI chain: Tax -> AMM -> Token-2022 -> Transfer Hook.

Key Details

Feature Detail
Token standard Token-2022 with Transfer Hook (whitelist), no Transfer Fee extension
Tax rates Dynamic per epoch (3-14%), read from EpochState
LP fee 1% (100 bps)
Vault rate Fixed 100:1 (CRIME/FRAUD:PROFIT)
Min output floor 50% of expected (protocol-enforced)
ALT Protocol-wide ALT provided via AddressLookupTableTrait
Quote speed < 100μs average (pure integer math, zero heap allocation)

Test Plan

  • 21 tests in fork (8 construction + 13 quoting/parity/speed)
  • 171 tests in standalone crate (full validation suite)
  • 300 random log-uniform samples — zero delta vs on-chain math
  • Monotonicity verified (100-step fine granularity)
  • Mainnet RPC validation — real pool/epoch data
  • Devnet TX execution — full CPI chain success (tx)
  • Clippy clean, zero warnings
  • Secret audit — zero secrets, safe for public repo

Programs

Program Address
Tax Program 43fZGRtmEsP7ExnJE1dbTbNjaP1ncvVmMPusSeksWGEj
AMM 5JsSAL3kJDUWD4ZveYXYZmgm1eVqueesTZVdAvtZg8cR
Conversion Vault 5uawA6ehYTu69Ggvm3LSK84qFawPKxbWgfngwj15NRJ
Transfer Hook CiQPQrmQh6BPhb9k7dFnsEs5gKPgdrvNKFc5xie5xVGd

🤖 Generated with Claude Code

Replace Raydium example with Dr. Fraudsworth DeFi protocol implementation.

6 venue instances covering 8 swap directions:
- 2 SolPoolVenue (CRIME/SOL, FRAUD/SOL) — taxed constant-product AMM
- 4 VaultVenue (CRIME<->PROFIT, FRAUD<->PROFIT) — fixed 100:1 rate

Key features:
- Dynamic tax rates (3-14%) from on-chain EpochState
- Token-2022 with Transfer Hook (whitelist), no Transfer Fee extension
- Protocol-wide ALT for v0 transaction compression
- 50% minimum output floor enforced on-chain
- Sub-100us quoting (pure integer math, zero heap allocation)

21 tests (8 construction + 13 quoting/parity/speed)
Validated against real mainnet data and devnet TX execution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant