Mera
ExecutionInstant confidential swapsClear from encrypted balances in one 150ms slot.Hidden-size limit ordersLock encrypted size in a private escrow PDA.Sealed RFQ block tradesRequest signed quotes without leaking size.
Vault & AuditShielded vault & keysDeposit SOL, SPL, or Token-2022 into a Ring.Viewing key verifierDecrypt and prove a single settled fill.
Docs/Guides
2 min read

Deploying a Custom Ring

Create an institutional Custom Ring, choose Confidential or Anonymous mode, configure an auditor key, and manage allowlist and freeze policies.

Institutional desks, funds, and treasuries deploy Custom Rings to isolate shielded liquidity under their own compliance rules. Creating a Custom Ring writes a RingConfig PDA on mera_core (create_ring), and managing desk wallets writes per-member RingMember PDAs (set_ring_member).

Configuration options

FieldTypeRules
namestring2 to 48 characters (MAX_RING_NAME = 48)
mode`'confidential' \'anonymous'`0 (Confidential: encrypted assets and amounts) or 1 (Anonymous: encrypted counterparties, assets, and balances)
allowlistEnabledbooleanDefault true. When true, only authority and wallets with RingMember.allowed == true && frozen == false can shield or trade in the Ring
auditorPubkeyBase58 Solana Pubkey (optional)Designated auditor public key stored on chain in RingConfig.auditor_pubkey (defaults to 11111111111111111111111111111111 if omitted)

Creating a Custom Ring in /rings

  1. Open Rings and connect the wallet that will act as the Ring authority.
  2. Open the Create Ring drawer.
  3. Enter a Ring name (2 to 48 characters), choose Confidential or Anonymous mode, toggle allowlist enforcement, and optionally paste an auditor Solana public key.
  4. Press Create Ring and sign the transaction. mera_core initializes the RingConfig PDA, increments ProtocolConfig.total_rings, and emits RingCreated. The API automatically adds the authority wallet as an allowed member.
  5. Click Set Active Ring on your new Ring card to route /balance and /trade actions into that Ring.

Managing member allowlists and freezes in /rings

  1. Select your Custom Ring in Rings while connected as its authority wallet.
  2. Enter a counterparty or trader wallet address, set Allowed (true or false) and Frozen (true or false), and submit.
  3. Sign the set_ring_member transaction. mera_core creates or updates the RingMember PDA at seeds ["ring_member", ring_pubkey, member_wallet] and emits RingMemberUpdated.

Deploying and managing a Custom Ring with @mera/sdk

ts
import { createMeraClient, keypairSigner } from '@mera/sdk'

const authoritySigner = keypairSigner(deskAuthorityKeypair)

const mera = createMeraClient({
  apiUrl: 'http://127.0.0.1:36102',
  signer: authoritySigner,
})

// 1. Create an Anonymous institutional Custom Ring with an auditor key
const created = await mera.createRing({
  name: 'Northstar Desk Ring',
  mode: 'anonymous',
  allowlistEnabled: true,
  auditorPubkey: auditorKeypair.publicKey.toBase58(),
})
console.log('Ring created tx:', created.signature, 'slot:', created.slot)

// 2. Look up the newly created Ring ID
const { items: rings } = await mera.getRings()
const deskRing = rings.find((r) => r.name === 'Northstar Desk Ring')!

// 3. Allowlist a trader wallet
await mera.setRingMember(deskRing.ringId, {
  member: traderPubkey,
  allowed: true,
  frozen: false,
})

// 4. Freeze a member wallet immediately if compliance requires it
await mera.setRingMember(deskRing.ringId, {
  member: traderPubkey,
  allowed: true,
  frozen: true,
})

// 5. Inspect Ring policy and member roster
const detail = await mera.getRing(deskRing.ringId)
console.log('Members:', detail.members)

Authorization rules

  • Only RingConfig.authority can call set_ring_member. Any other wallet receives UNAUTHORIZED (401 at the API, 6008 Unauthorized on chain).
  • When allowlistEnabled is true, non-allowlisted wallets attempting to shield, swap, place orders, or request RFQs receive RING_ACCESS_DENIED (403).
  • When a member's frozen flag is true (or RingConfig.frozen is true), actions fail with RING_FROZEN (403 at the API, 6004 RingFrozen on chain).