Documentationβš™οΈ TriadProtocol & SDKIndex

Triad Protocol β€” Developer Guide

The Triad Protocol is built on Solana using the Anchor framework. This page covers setup, architecture, and main instructions for integration.

Prerequisites

Install

yarn add @triadxyz/triad-protocol

Architecture

Core logic lives under programs/triad-protocol/src/:

PathRole
lib.rsEntry point: program ID and instruction wiring
instructions/Protocol operations (markets, orders, users)
state/On-chain accounts: Market, Order, User, Customer, etc.

Main areas

  • Market management: create_market, update_market_*, create_pool
  • Order management: place_bid_order, place_ask_order, cancel_*_order
  • Customers & users: deposit, withdraw, create_predictor

Instructions

Market management

InstructionDescription
create_marketCreate a new prediction market
create_poolCreate a liquidity pool for a market
update_market_endSet the market end timestamp
update_market_winning_directionSet the winning outcome (YES/NO)
update_market_payoutEnable payouts after resolution
update_market_questionUpdate the market question text
collect_market_feeCollect protocol fees from a market

Orders & betting

InstructionDescription
place_bid_orderPlace a limit buy (BET YES/NO)
place_ask_orderPlace a limit sell
market_bid_orderPlace a market buy
market_ask_orderPlace a market sell
cancel_bid_orderCancel an active bid
cancel_ask_orderCancel an active ask
create_order_bookInitialize the order book for a market
close_order_bookClose the order book
payout_orderClaim winnings for a winning bet

Customers & users

InstructionDescription
depositDeposit into the protocol vault
withdrawWithdraw from the vault
create_predictorCreate a predictor account
create_customerRegister a customer/frontend
update_customer_feeUpdate fee structure for a customer

Admin & treasury

InstructionDescription
transfer_poseidonTransfer admin rights
withdraw_poseidonWithdraw admin funds
collect_royaltyCollect secondary market royalties
add_trader_poseidon / remove_trader_poseidonManage authorized traders
update_metadataUpdate protocol metadata

REST API

For REST and data docs:

Triad API Docs β†’


Content sourced from Triad White Label Docs β€” Integration.