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-protocolArchitecture
Core logic lives under programs/triad-protocol/src/:
| Path | Role |
|---|---|
| lib.rs | Entry 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
| Instruction | Description |
|---|---|
create_market | Create a new prediction market |
create_pool | Create a liquidity pool for a market |
update_market_end | Set the market end timestamp |
update_market_winning_direction | Set the winning outcome (YES/NO) |
update_market_payout | Enable payouts after resolution |
update_market_question | Update the market question text |
collect_market_fee | Collect protocol fees from a market |
Orders & betting
| Instruction | Description |
|---|---|
place_bid_order | Place a limit buy (BET YES/NO) |
place_ask_order | Place a limit sell |
market_bid_order | Place a market buy |
market_ask_order | Place a market sell |
cancel_bid_order | Cancel an active bid |
cancel_ask_order | Cancel an active ask |
create_order_book | Initialize the order book for a market |
close_order_book | Close the order book |
payout_order | Claim winnings for a winning bet |
Customers & users
| Instruction | Description |
|---|---|
deposit | Deposit into the protocol vault |
withdraw | Withdraw from the vault |
create_predictor | Create a predictor account |
create_customer | Register a customer/frontend |
update_customer_fee | Update fee structure for a customer |
Admin & treasury
| Instruction | Description |
|---|---|
transfer_poseidon | Transfer admin rights |
withdraw_poseidon | Withdraw admin funds |
collect_royalty | Collect secondary market royalties |
add_trader_poseidon / remove_trader_poseidon | Manage authorized traders |
update_metadata | Update protocol metadata |
REST API
For REST and data docs:
Content sourced from Triad White Label Docs β Integration.