OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Anchor Comp

Anchor Comp is a Rust library that provides Anchor-compatible account types and cross-program invocation helpers for integrating non-Anchor Solana programs into Anchor-based Solana programs.

Independent OpenViST project profile, based on linked sources.

Anchor Comp — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when an Anchor-based Solana program needs typed wrappers or CPI helpers for a Solana program that was not written with Anchor.

Who it is for

  • Rust developers building Solana programs with Anchor.
  • Teams integrating non-Anchor Solana program interfaces, including the Mango Markets v3 example shown in the README.

Documented uses

  • Represent a non-Anchor program with an Anchor-compatible typed program account.
  • Assemble typed CPI accounts and invoke a Mango Markets v3 perpetual-order instruction from a Rust Solana program.
  • Use the repository’s v3 SplGovernanceV3 wrapper.
Before you choose

Requirements & limits

  • The README’s worked CPI example targets Mango Markets v3 and a perpetual-order instruction.
  • The documented dependency uses version 0.1.0 from the Git repository and offers development and production feature selections alongside no-entrypoint.
  • The README identifies SplGovernanceV3 in v3 contents; the detailed usage example is for Mango Markets v3.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Add anchor-comp to a Rust Solana program

Configure a Rust Solana program to use anchor-comp for Anchor-compatible CPI integration.

Before you start

  • A Rust Solana program using Anchor.

Steps

  1. Add the documented anchor-comp Git dependency to the program's Cargo.toml.

  2. Choose the documented development or production feature alongside no-entrypoint.

Expected outcome

The program's dependency configuration includes anchor-comp, ready for CPI integration in its Rust code.

Guide limitations

  • The example demonstrates a Mango Markets v3 CPI; it does not provide a complete runnable program or deployment procedure.
Source-based practical guide

Construct a Mango Markets v3 perp-order CPI context

Follow the README's example structure for invoking `place_perp_order2` from a Rust Solana instruction.

Before you start

  • A Rust Solana program configured to use anchor-comp.
  • Anchor instruction accounts for the Mango program, Mango group and account, owner, cache, perp market, bids, asks, and event queue.

Steps

  1. Import anchor_comp::mango_markets_v3 and MangoMarketV3, and declare the Mango program account as `Program

  2. Build a mango_markets_v3::PlacePerpOrder2 account struct by converting the instruction's corresponding account fields with to_account_info().

  3. Create a CpiContext from the Mango program account and the CPI accounts.

  4. Call mango_markets_v3::place_perp_order2 with that context and the documented order arguments; the example applies .with_signer(depository_pda_signer) to the context.

Expected outcome

The instruction follows the documented pattern for assembling and issuing a Mango Markets v3 perp-order CPI.

Guide limitations

  • The example contains ellipses and references variables and account fields it does not define, so it is not a complete standalone implementation.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
18 October 2026
Original website title
UXDProtocol/anchor-comp · Official homepage title · retained in its source language