The Sonar settlement sale program is an Anchor-based Solana program for token sales. It follows the same commitment, cancellation, and settlement lifecycle as the EVM SettlementSale contract, adapted for Solana’s account model.Participants commit SPL tokens during the commitment stage. Clearing mechanics and final allocations are computed offchain by Sonar; accepted amounts and refunds are settled onchain.
For standard sale configurations, Sonar deploys and manages this program for you.
Program ID: 3XxHCh947y1PAMK5y8oecBtaLU7TtTj9r4yMYwzFbJYsSource code: solana/
All program state lives in PDAs. Seeds use raw bytes — not the UUID string representation.
Account
Seeds
Description
SettlementSale
["settlement_sale", sale_uuid]
Top-level sale state
EntityState
["entity_state", sale_pda, entity_id]
Per-entity commitment state
WalletBinding
["wallet_binding", sale_pda, bidder_pubkey]
Binds a wallet to an entity
Vault
["vault", sale_pda]
Holds committed SPL tokens
sale_uuid and entity_id are 16-byte raw UUID values. Entity IDs from the Sonar API may arrive as 0x-prefixed hex or UUID-formatted strings. Strip the 0x prefix; if hyphens are present, parse as a UUID, otherwise decode as raw hex.
Places or updates a bid. Handles first bids and bid increases with the same call.The instruction verifies the purchase permit signature via instruction introspection of the Ed25519 program. The Ed25519 verify instruction must be the immediately preceding instruction in the same transaction.See the integration guide for a complete code example.Arguments:
Per-entity commitment state. One account per entity per sale. Created on the entity’s first bid.
Field
Type
Description
entity_id
[u8; 16]
The sale-specific entity ID
current_amount
u64
Total tokens committed by this entity
current_price
u64
Current bid price
lockup
bool
Whether the entity has opted into lockup
refunded
bool
Whether this entity has been refunded
Use program.account.entityState.fetchNullable(entityStatePDA) to read commitment progress. A null result means no bid has been placed; treat current_amount as zero.
The program follows the same stage progression as the EVM contract:Stage transitions are managed by Sonar. Participants can call place_bid during the Commitment stage, cancel during the Cancellation stage, and claim refunds when available. Settlement and pushed refunds are handled by Sonar.
The SVM program uses authority accounts to control privileged operations. Unlike the EVM contract’s named roles, Solana programs express authority as specific signer accounts verified at instruction time.
Authority
Held By
Operations
permit_signer
Sonar
Signs purchase permits that authorize participation
Stage manager
Sonar
Transitions the sale between stages (Commitment → Cancellation → Settlement → Done)
Settler
Sonar
Writes final allocations on-chain after offchain computation
Refunder
Sonar
Pushes refunds to participants; participants may also claim refunds directly
Solana sales use Ed25519 signatures rather than the ECDSA signatures used by EVM sales. The permit is Borsh-encoded using the PurchasePermitV3 type from the program IDL.The permit_signer field on the SettlementSale account holds the Ed25519 public key used to verify permits. This key is controlled by Sonar.