Skip to main content

Installation

Install the Fraction SDK using your preferred package manager:

Quick Start

Initialize Client

Create Revenue Split Configuration

Execute Distribution

API Reference

Client Class

Constructor

string
RPC endpoint URL (defaults to mainnet-beta)
PublicKey
Transaction fee payer (only required for versioned transactions)

Methods

State Queries

Advanced Usage

Low-Level Instructions

For advanced users who need fine-grained control over transaction building:

Treasury Management

Calculate and manage treasury accounts:

Examples

Enterprise Revenue Distribution

Multi-Token Distribution

Dynamic Updates

Error Handling

Common Validation Errors

The SDK implements client-side validation with clear error messages:

Error Handling Pattern

Type Definitions

Core Types

Basis Points (BPS): Share allocations use basis points where 10,000 BPS = 100%. For example, 4000 BPS = 40%.

Configuration Derivation

Program IDL

The complete Interface Description Language (IDL) for the Fraction protocol:
Program Address: The Fraction protocol is deployed at Ck2PtB73t36kjk4mLUztwsBV9jvq7q3mGfSNmQevwFgg. This IDL can be used with Anchor clients or other Solana development tools for direct program interaction.

Best Practices

Share Distribution: Always ensure participant shares sum to exactly 10,000 BPS (100%) to avoid validation errors.
Agent Selection: Choose reliable agents for distribution triggers. Consider using services like Clockwork for automated scheduling.
Authority Security: The authority can update configurations and should use secure key management practices.
Multi-Token Support: The same configuration can distribute different SPL tokens - just call claimAndDistribute with different mint addresses.