Obric v3 IDL
obric-v3Obric v3 is the latest oracle-based DEX with enhanced capital efficiency through MarginFi bank integration. Adds lending/borrowing capabilities on top of oracle-driven concentrated liquidity trading.
Instructions
Account Types
Integration Examples
Use the Obric v3 IDL in your application with these code examples for TypeScript, Rust, and Python.
import { Connection, PublicKey } from "@solana/web3.js";
import { Program, AnchorProvider, Idl } from "@coral-xyz/anchor";
// Load the Obric v3 IDL
import idl from "./obric v3.json";
const PROGRAM_ID = new PublicKey("<Obric v3_PROGRAM_ID>");
// Set up the provider and program
const connection = new Connection("https://api.mainnet-beta.solana.com");
const provider = new AnchorProvider(connection, wallet, {
commitment: "confirmed",
});
const program = new Program(idl as Idl, provider);
// Fetch and decode an account
const accountData = await program.account.obric_v3
.fetch(accountPublicKey);
console.log("Account data:", accountData);
// Build and send an instruction
const tx = await program.methods
.initialize(/* ...args */)
.accounts({
/* ...required accounts */
})
.rpc();
console.log("Transaction signature:", tx);IDL JSON Preview
{
"version": "0.1.0",
"name": "obric_solana_v3",
"instructions": [
{
"name": "createPair",
"accounts": [
{
"name": "tradingPair",
"isMut": true,
"isSigner": false
},
{
"name": "mintX",
"isMut": false,
"isSigner": false
},
{
"name": "mintY",
"isMut": false,
"isSigner": false
},
{
"name": "mintLp",
"isMut": true,
"isSigner": false
},
{
"name": "marginfiBankX",
"isMut": false,
...Frequently Asked Questions
What is the Obric v3 IDL?
The Obric v3 IDL (Interface Definition Language) is a JSON schema that defines the on-chain program interface for the Obric v3 smart contract on Solana. It describes all available instructions, account structures, events, and custom types that developers need to interact with the Obric v3 program. This IDL contains 8 instructions, 2 account types, 0 events, and 0 type definitions.
How do I use the Obric v3 IDL in my project?
Download the JSON file and import it in your project. With TypeScript, use the @coral-xyz/anchor package to create a Program instance. In Rust, use anchor-client. For Python, use anchorpy. See the integration examples above for complete code snippets in all three languages.
What is the Obric v3 program address on Solana?
The Obric v3 program identifier is obric-v3. Refer to the official obric documentation for the latest deployed program address.
What version of the Obric v3 IDL is this?
This is version 0.1.0 of the Obric v3 IDL. IDL versions correspond to specific program deployments and may be updated as the protocol evolves. Always verify compatibility with the on-chain program version before integrating.