Skip to main content

Contract Interactions Overview

The Intuition protocol's smart contracts manage complex state involving Atoms, Triples, and their associated vaults. When interacting with these primitives, we recommend retrieving state data directly from the EthMultiVault contract.

Key Concepts

Multicall Operations

Batch multiple read-only contract calls into a single request to reduce RPC calls and improve performance.

State Management

Retrieve comprehensive vault information including assets, share prices, and user positions.

Configuration Access

Access global protocol configuration including fee structures and minimum deposits.

Implementation Approach

We utilize multicall operations that batch multiple read-only contract calls into a single request. This approach significantly reduces RPC calls and provides data you'll need for contract interactions, such as the atomCost that is referenced in the contract interaction guides.

Core Multicall Pattern

// Core multicall configuration
const coreContractConfigs = [
{
  ...multiVaultContract,
  functionName: 'vaults',
  args: [vid],
},
{
  ...multiVaultContract, 
  functionName: 'currentSharePrice',
  args: [vid],
},
// ... additional calls
]

// Execute multicall
const resp: MulticallResponse[] = await publicClient.multicall({
contracts: coreContractConfigs,
})

Available Interactions

Create Atom

Learn how to create new atoms and manage their associated vaults.

Create Triple

Understand how to create triples and manage their relationships.

Deposit & Return

Manage deposits and withdrawals from vaults with proper fee handling.

Retrieve Vault Details

Get comprehensive vault information including assets, prices, and positions.

Prerequisites

Before diving into contract interactions, ensure you have:

  • Basic understanding of Intuition's core concepts (Atoms, Triples, Vaults)
  • Familiarity with Ethereum development and smart contract interactions
  • Knowledge of multicall patterns and batch operations
  • Access to the Intuition SDK and development environment

Next Steps

Explore the specific interaction guides to learn how to:

  • Create and manage atoms and triples
  • Handle deposits and withdrawals
  • Retrieve vault state information
  • Implement proper error handling and validation

Each guide provides detailed implementation examples and best practices for working with Intuition's smart contracts.