chordDocs

Protocol

Accounts and addresses

Program ID, PDAs and the seeds that derive them.

#Program

Program IDDosESkyr8zE6V98GyS5VkStkknYkeVJzUxYx6AMKT2od
FrameworkAnchor 0.31.1
TokensClassic SPL Token program only

#Addresses

Every Chord account is a program-derived address. Seeds are UTF-8 literals and raw 32-byte keys; integers are little-endian u64.

AccountSeedsHolds
Config"config"Authority, auctioneer, treasury, chain domain, bond size
Settlement"settlement", configNothing. It is the delegate your allowance names.
Solver"solver", config, solver ownerBonded and locked lamports
Batch"batch", config, batch idPair, windows, price, budgets, reserves, status
Vault A, Vault B"vault-a" or "vault-b", batchThe batch’s token vaults
User"user", config, ownerThe owner’s nonce floor
Receipt"receipt", config, owner, nonceCumulative sold and bought, digest, batch, cancelled flag
Market"market", config, mint A, mint BWindow lengths, order cap, enabled
Stake pool"stake-pool", configCHORD mint, governance, solver minimum, cooldown, totals
Stake vault"stake-vault", stake poolEvery staked and cooling CHORD
Stake"stake", stake pool, ownerActive and cooling stake, cooldown end, recent deposits
Voter weight record"voter-weight", stake pool, ownerThe weight spl-governance reads for one action
TypeScript
import { PublicKey } from "@solana/web3.js";

const program = new PublicKey("DosESkyr8zE6V98GyS5VkStkknYkeVJzUxYx6AMKT2od");
const [config] = PublicKey.findProgramAddressSync([Buffer.from("config")], program);
const [settlement] = PublicKey.findProgramAddressSync([Buffer.from("settlement"), config.toBuffer()], program);

#The config

There is one config per deployment. Only the program’s upgrade authority can create it, once, and its fields never change afterwards:

FieldMeaning
authorityThe upgrade authority that initialized it
auctioneerThe collector key that co-signs commits and creates batches
treasuryWhere slashed bonds go
chain_domainSHA-256 of the cluster’s genesis hash, bound into every signature
bond_lamportsThe bond locked per committed batch

#Receipts are permanent

A receipt is written the first time a nonce fills or is cancelled, and never closed. It is the record that makes replay impossible: a nonce with a receipt can only ever continue the order it was bound to. Receipts and batch accounts hold rent for as long as they exist.