Skip to main content

Overview

The Global Configuration manages program-wide settings including the admin address, fee wallet, protocol fees, and global pause state. These instructions are primarily admin-only operations.

Account Structure

PDA Seeds: ["global_config"]

Instructions

init_global_config

Initialize the program’s global configuration. This is a one-time operation called immediately after deployment.

Parameters

Required Accounts

Behavior

  • Creates the GlobalConfig PDA account
  • Sets caller as admin
  • Sets program to paused by default
  • Validates protocol_fees_bps is within range

Access Control

Access: Permissionless (one-time only) The first caller becomes the admin. Subsequent calls will fail as the account already exists.

Example


update_global_config

Update program-wide configuration settings.

Parameters

Required Accounts

Behavior

  • Updates only the fields provided (non-None values)
  • Validates protocol_fees_bps if provided

Access Control

Access: Admin only

Example


set_new_admin

Propose a new admin address (first step of two-step transfer).

Parameters

Required Accounts

Behavior

  • Sets pending_new_admin to proposed address
  • Current admin remains in control
  • Can be called multiple times to change proposed admin

Access Control

Access: Current admin only

Example


confirm_new_admin

Accept the admin role (second step of two-step transfer).

Required Accounts

Behavior

  • Verifies caller matches pending_new_admin
  • Updates admin to new address
  • Clears pending_new_admin

Access Control

Access: Pending new admin only

Example


claim_fees

Claim accumulated protocol fees from a fee vault.

Parameters

Required Accounts

Behavior

  • Requires program to be unpaused
  • Transfers all tokens from the program_authority-owned fee-vault ATA to the fee wallet
  • Fee vault remains open for future fee collection
  • Anyone can call, but fees always go to configured fee_wallet

Access Control

Access: Permissionless
While anyone can trigger fee claims, the fees are always sent to the fee_wallet configured in GlobalConfig, not to the caller.

Example


Error Codes


Next: Asset Configuration

Learn about per-token NAV configuration and asset management