API Tham khảo
Tài liệu API toàn diện cho Thị trường Dự đoán CloudBank, bao gồm REST APIs, giao diện hợp đồng thông minh, truy vấn GraphQL và các kênh WebSocket.
Authentication
Xác thực người dùng (EIP-191 Chữ ký)
1. POST /api/v1/auth/nonce → get challenge nonce
2. sign message with wallet → EIP-191 personal_sign
3. POST /api/v1/auth/login → submit signature and obtain JWT
4. Authorization: Bearer {token} → include in subsequent requestsJWT được ký với HS256. Các xác nhận quyền sở hữu bao gồm JWT (địa chỉ ví), HS256 và Subject.
Xác thực quản trị viên
- JWT Người mang: JWT nhận quyền truy cập + làm mới mã thông báo
- Xác thực cơ bản: được sử dụng trong giai đoạn khởi động
Authorization: Basic base64(user:pass) - RBAC: RBAC (toàn quyền) /
superadmin(quyền hạn chế)
REST API
Cơ sở URL: URL
Ví dụ về cURL nhanh (Xác thực/Thị trường/Giao dịch/Ví)
export HOST="https://docs-test.cloudbank.to"
export API="$HOST/api/v1"
export ADDRESS="0xYourWalletAddress"1) Xác thực: nonce + đăng nhập
curl -sS -X POST "$API/auth/nonce" \
-H "Content-Type: application/json" \
-d "{\"address\":\"$ADDRESS\"}"{
"nonce": "7fa3f1d9",
"message": "CloudBank login nonce: 7fa3f1d9",
"expiresAt": "2026-03-06T00:00:00Z"
}Sau khi ký, hãy gửi thông tin đăng nhập ($SIGNATURE và $MESSAGE phải được thay thế bằng dữ liệu chữ ký ví thực tế):
export MESSAGE="CloudBank login nonce: 7fa3f1d9"
export SIGNATURE="0xYourEIP191Signature"
curl -sS -X POST "$API/auth/login" \
-H "Content-Type: application/json" \
-d "{\"address\":\"$ADDRESS\",\"message\":\"$MESSAGE\",\"signature\":\"$SIGNATURE\"}"{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"custodialWalletAddress": "0x4D7E...A9f2",
"expiresAt": "2026-03-06T12:00:00Z"
}export TOKEN="eyJhbGciOi..."2) Thị trường: truy vấn danh sách thị trường
curl -sS "$API/markets?state=TRADING&limit=20&offset=0" \
-H "Authorization: Bearer $TOKEN"{
"items": [
{
"id": "0x2E79B7190c463CD11793520d23F63A3d035A94c2",
"question": "Will BTC close above $80k on Friday?",
"state": "TRADING",
"closeTime": "2026-03-08T12:00:00Z"
}
],
"total": 1,
"limit": 20,
"offset": 0
}3) Giao dịch: gửi lệnh
curl -sS -X POST "$API/orderbook/orders" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"marketId":"0x2E79B7190c463CD11793520d23F63A3d035A94c2",
"outcome":"YES",
"side":"BUY",
"orderType":"LIMIT",
"price":"0.62",
"amount":"100"
}'{
"orderHash": "0x8f7b...c31d",
"status": "open",
"filledAmount": "0",
"createdAt": "2026-03-05T10:00:00Z"
}4) Ví: lấy thông tin + rút tiền
curl -sS "$API/wallet/info" \
-H "Authorization: Bearer $TOKEN"{
"walletAddress": "0x4D7E...A9f2",
"balances": {
"BNB": "0.132",
"USDC": "1250.50"
},
"chainId": 97
}curl -sS -X POST "$API/wallet/withdraw" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"asset":"USDC",
"toAddress":"0xReceiverAddress",
"amount":"25.0"
}'{
"txHash": "0x4b17...9f25",
"asset": "USDC",
"amount": "25.0",
"status": "pending"
}Auth
| Method | Path | Auth | Giới hạn tỷ lệ | Description |
|---|---|---|---|---|
| POST | POST | - | 100/min/IP | Tạo thử thách EIP-191 (địa chỉ -> nonce + tin nhắn) |
| POST | POST | - | 5/min/IP | Xác minh chữ ký và trả lại JWT + CustodialWalletAddress |
POST POST
// Request
{ "address": "0x..." }
// Response
{ "nonce": "abc123", "message": "Sign this message...", "expiresAt": "2026-01-01T00:00:00Z" }POST POST
// Request
{ "address": "0x...", "signature": "0x...", "message": "Sign this message..." }
// Response
{ "token": "eyJ...", "custodialWalletAddress": "0x...", "expiresAt": "2026-01-01T00:00:00Z" }Wallet
| Method | Path | Auth | Giới hạn tỷ lệ | Description |
|---|---|---|---|---|
| GET | GET | JWT | 100/min | Nhận thông tin ví tạm giữ |
| DELETE | DELETE | JWT | 100/min | Xóa ví lưu ký (yêu cầu trạng thái không hoạt động) |
| POST | POST | JWT | 20/min | Ký giao dịch thay mặt (hợp đồng được liệt kê trong danh sách trắng) |
| POST | POST | JWT | 3/min | Rút BNB/USDC (giới hạn hàng ngày) |
POST POST
// Request
{ "to": "0x...", "data": "0x...", "value": "0", "product": "predict" }
// Response
{ "txHash": "0x...", "gasMode": "paymaster", "status": "pending", "createdAt": "..." }POST POST
// Request
{ "asset": "USDC", "toAddress": "0x...", "amount": "100.5" }
// Response
{ "txHash": "0x...", "asset": "USDC", "amount": "100.5", "fee": "0", "gasMode": "user", "status": "pending" }Orderbook
| Method | Path | Auth | Giới hạn tỷ lệ | Description |
|---|---|---|---|---|
| GET | GET | - | 120/min/IP | Nhận độ sâu sổ đặt hàng |
| POST | POST | JWT | 30/min | Gửi đơn đặt hàng |
| POST | POST | JWT | 30/min | Lộ trình kết hợp (AMM + Sổ đặt hàng) |
| DELETE | DELETE | JWT | 30/min | Hủy đơn hàng |
| GET | GET | JWT | 30/min | Nhận trạng thái nhịp tim |
| GET | GET | JWT | - | WebSocket kênh nhịp tim |
GET GET
?marketId={id}&outcomeTokenId={tokenId}&depth=20// Response
{ "market": "0x...", "bids": [{"price": "0.65", "size": "100"}], "asks": [...] }Mời quan hệ
| Method | Path | Auth | Giới hạn tỷ lệ | Description |
|---|---|---|---|---|
| GET | GET | - | 120/min/IP | Truy vấn quan hệ theo người mời |
| POST | POST | JWT | 60/min | Ràng buộc mối quan hệ lời mời |
| GET | GET | JWT | 60/min | Nhận mối quan hệ mời riêng |
Quản trị viên - Xác thực
| Method | Path | Auth | Giới hạn tỷ lệ | Description |
|---|---|---|---|---|
| POST | POST | - | 30/min/IP | Đăng nhập quản trị viên |
| POST | POST | - | 30/min/IP | Làm mới mã thông báo |
Quản trị viên - Người dùng (superadmin)
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | GET | Quản trị viên+SA | Liệt kê tất cả quản trị viên |
| GET | GET | Quản trị viên+SA | Nhận thông tin chi tiết quản trị viên |
| POST | POST | Quản trị viên+SA | Tạo quản trị viên |
| PATCH | PATCH | Quản trị viên+SA | Cập nhật quản trị viên |
| POST | POST | Quản trị viên+SA | Đặt lại mật khẩu |
| POST | POST | Quản trị viên+SA | Ví hoạt động ràng buộc |
| POST | POST | Quản trị viên+SA | Hủy liên kết ví hoạt động |
Quản trị viên — Người dùng giám sát
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | GET | Admin | Truy vấn được phân trang cho người dùng giám hộ |
| GET | GET | Admin | Nhận thông tin người dùng + ví |
| DELETE | DELETE | SA | Xóa vĩnh viễn ví người dùng |
Quản trị viên — Ví hoạt động (superadmin)
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | GET | SA | Liệt kê các ví hoạt động |
| GET | GET | SA | Nhận thông tin chi tiết về ví |
| POST | POST | SA | Tạo ví hoạt động |
| PATCH | PATCH | SA | Cập nhật ví hoạt động |
| POST | POST | Admin | Giao dịch đăng nhập ví hoạt động |
Quản trị viên — Danh sách trắng
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | POST | Admin | Thêm danh sách trắng hợp đồng |
| GET | GET | Admin | Danh sách trắng truy vấn (có thể lọc theo sản phẩm) |
| PATCH | PATCH | Admin | Cập nhật mục nhập danh sách trắng |
| DELETE | DELETE | Admin | Xóa mục nhập danh sách trắng |
Quản trị viên - Mời quan hệ (superadmin)
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | GET | SA | Truy vấn được phân trang (CSV hỗ trợ xuất) |
| POST | POST | SA | Nhập số lượng lớn (<=500 hàng mỗi đợt) |
System
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | GET | - | Kiểm tra sức khỏe (trạng tháiSQL/Redis/BSC) |
| GET | GET | - | Số liệu Prometheus |
Mã lỗi
Tất cả các phản hồi lỗi đều tuân theo định dạng này:
{ "code": "error_code", "message": "Human-readable message", "details": {} }| Code | HTTP Trạng thái | Description |
|---|---|---|
invalid_request | 400 | Tham số yêu cầu không hợp lệ |
invalid_signature | 401 | EIP-191 xác minh chữ ký không thành công |
invalid_nonce | 401 | Nonce không hợp lệ hoặc đã hết hạn |
unauthorized | 401 | Chưa được xác thực hoặc mã thông báo đã hết hạn |
forbidden | 403 | Forbidden |
contract_not_whitelisted | 403 | Hợp đồng không nằm trong danh sách trắng |
insufficient_bnb | 400 | Số dư BNB không đủ |
insufficient_balance | 400 | Số dư không đủ |
daily_limit_exceeded | 429 | Vượt quá giới hạn rút tiền hàng ngày |
not_found | 404 | Không tìm thấy tài nguyên |
rate_limited | 429 | Đã vượt quá giới hạn tỷ lệ |
invite_binding_conflict | 409 | Xung đột mối quan hệ mời |
invite_request_replayed | 409 | Yêu cầu liên kết trùng lặp |
invite_self_not_allowed | 400 | Không được phép tự mời |
internal_error | 500 | Lỗi máy chủ nội bộ |
service_unavailable | 503 | Dịch vụ không có sẵn |
WebSocket
Đặt hàng Heartbeat
URL: URL Auth: Bearer JWT (thông số truy vấn hoặc tiêu đề)
Máy chủ → Máy khách
{ "type": "heartbeat_connected", "status": { ... } }
{ "type": "heartbeat_ack", "status": { ... } }
{ "type": "error", "message": "Error description" }Máy khách → Máy chủ
- Bất kỳ tin nhắn nào cũng có thể kích hoạt nhịp tim duy trì
- Hỗ trợ tiêu chuẩn WebSocket ping/pong
Giao diện hợp đồng thông minh
OptimisticController
Bộ điều khiển thị trường dự đoán nhị phân quản lý các trạng thái vòng đời: TRADING -> PROPOSED -> DISPUTED -> RESOLVED / CANCELLED.
// Read methods
function getQuestion() external view returns (string memory);
function getMetadata() external view returns (string memory);
function getState() external view returns (MarketState);
function getConditionId() external view returns (bytes32);
function getPositionIds() external view returns (uint256[] memory);
function isActive() external view returns (bool);
function canSettle() external view returns (bool);
function getFeatureFlags() external pure returns (uint256);
// Market management (onlyOwner)
function setMetadata(string calldata metadata) external;
function setOracleAskAfter(uint256 newAskAfter) external;
function depositStake() external;
function proposeOutcome(uint8 outcome, bytes calldata data) external;
function settle(bytes calldata data) external;
function cancelAsInvalid() external;
// Open operations
function disputeOutcome(bytes calldata data) external;
function requestOracleQuestion(bytes calldata data) external payable;
function refundOracleQuestion() external;
function proposeOutcomeFromOracle(bytes calldata data) external;Sự kiện:
OutcomeProposed(uint8 indexed outcome, address indexed proposer, uint256 timestamp, bytes32 dataHash)OutcomeDisputed(address indexed disputer, uint256 timestamp, bytes32 dataHash)OracleQuestionRequested(bytes32 indexed oracleQuestionId, uint256 deadline, address indexed requester, uint256 value, bytes32 dataHash)StakeProcessed(address indexed creator, address indexed token, uint256 amount, bool refunded)StateTransition(MarketState indexed from, MarketState indexed to)MarketResolved(uint8 indexed outcome, uint256 timestamp)
BinaryCPMM
Nhà tạo lập thị trường sản phẩm cố định (x*y=k), phí 0%, dựa trên mã thông báo vị trí Gnosis CTF ERC-1155.
// Read methods
function getReserves() external view returns (uint256 yesReserves, uint256 noReserves);
function getPrice(uint256 tokenId) external view returns (uint256 price1e18);
function quote(uint256 tokenIn, uint256 amountIn) public view returns (uint256 amountOut);
// Liquidity
function addLiquidity(uint256 collateralAmount) external returns (uint256 lpOut);
function removeLiquidity(uint256 lpIn) external returns (uint256 yesOut, uint256 noOut);
// Trading
function swap(uint256 tokenIn, uint256 amountIn, uint256 minOut) external returns (uint256 amountOut);
function swapCollateralForOutcome(uint256 outcomeTokenId, uint256 collateralAmount, uint256 minOutcomeOut) external returns (uint256 outcomeOut);
function sellOutcomeForCollateral(uint256 outcomeTokenId, uint256 outcomeIn, uint256 minCollateralOut) external returns (uint256 collateralOut);
function sellAllOutcomeForCollateral(uint256 outcomeTokenId, uint256 minCollateralOut) external returns (uint256 collateralOut);Sự kiện:
LiquidityAdded(address indexed provider, uint256 collateralIn, uint256 lpOut)LiquidityRemoved(address indexed provider, uint256 lpIn, uint256 yesOut, uint256 noOut)Swapped(address indexed trader, uint256 indexed tokenIn, uint256 amountIn, uint256 indexed tokenOut, uint256 amountOut)CollateralSwappedForOutcome(address indexed trader, uint256 collateralIn, uint256 indexed outcomeTokenId, uint256 outcomeOut)OutcomeSoldForCollateral(address indexed trader, uint256 indexed outcomeTokenId, uint256 outcomeIn, uint256 collateralOut)
DCPPFactory
Nhà máy thị trường triển khai thị trường + AMM thông qua EIP-1167 proxy tối thiểu.
// Create market
function createOptimisticMarket(string calldata question, uint256 livenessPeriod, address, uint256, uint8 outcomeSlots) external returns (address market);
function createOptimisticMarket_V2(string calldata question, uint256 livenessPeriod, address, uint256, uint8 outcomeSlots) external returns (address market);
function createOptimisticMarketWithInitialLiquidity(...) external returns (address market, address amm);
function createOptimisticMarketWithInitialLiquidity_V2(...) external returns (address market, address amm);
function createOptimisticMarket_V3(string calldata question, string calldata metadata, ...) public returns (address market, address amm);
function createOptimisticMarket_V4(..., bytes32 key) external returns (address market, address amm);
// Read methods
function getMarketCount() external view returns (uint256);
function getMarketByIndex(uint256 idx) external view returns (address);
// Management (onlyOwner)
function setOracleAdapter(IYesNoOracleAdapter newAdapter) external;
function setMultiOutcomeFactory(address newFactory) external;MultiOutcomeMarket
Trình bao bọc thị trường nhiều tùy chọn bao gồm N thị trường nhị phân độc lập (chế độ một đấu với phần còn lại).
function optionCount() external view returns (uint256);
function getOption(uint256 index) external view returns (string label, address market, address amm, uint256 yesTokenId, uint256 noTokenId);
function proposeWinner(uint8 winnerIndex, bytes calldata data) external; // onlyOwner
function settleWinner(uint8 winnerIndex) external; // onlyOwner
// Oracle flow
function requestWinnerFromOracle(uint256 deadline, bytes calldata data) external payable returns (bytes32 qid);
function proposeWinnerFromOracle(bytes calldata data) external;
function settleWinnerFromOracle() external;SoraOracle
Lời tiên tri Yes/No tối thiểu, được trả lời bởi nhà cung cấp được chỉ định.
function askYesNoQuestion(string calldata question, uint256 deadline) external payable returns (uint256 questionId);
function provideAnswer(uint256 questionId, bool boolAnswer, uint8 confidenceScore, string calldata dataSource) external; // onlyOracleProvider
function getQuestionWithAnswer(uint256 questionId) external view returns (string, uint256, string, bool, AnswerStatus, uint256);
function refundUnansweredQuestion(uint256 questionId) external;CloudBankVerifyingPaymaster
ERC-4337 AA Paymaster với xác thực chữ ký, hạn ngạch hàng ngày và danh sách trắng của người gửi.
function validatePaymasterUserOp(UserOperation calldata userOp, bytes32, uint256 maxCost) external returns (bytes memory context, uint256 validationData);
function postOp(PostOpMode, bytes calldata context, uint256 actualGasCost) external;
function getHash(UserOperation calldata userOp, uint48 validUntil, uint48 validAfter) public view returns (bytes32);
// Management (onlyOwner)
function setVerifyingSigner(address newSigner) external;
function setEnforceSenderAllowlist(bool enabled) external;
function setDailySponsorLimit(uint256 newLimit) external;
function setSenderAllowlist(address sender, bool allowed) external;
function batchSetSenderAllowlist(address[] calldata senders, bool allowed) external;
function deposit() external payable;FactoryRegistry
Sổ đăng ký nhà máy cung cấp một con trỏ ổn định tới địa chỉ nhà máy hiện tại.
function factory() external view returns (address);
function setFactory(address newFactory) external; // onlyOwnerGiao diện chính
// IMarket
interface IMarket {
function getQuestion() external view returns (string memory);
function getState() external view returns (MarketState);
function getConditionId() external view returns (bytes32);
function isActive() external view returns (bool);
function canSettle() external view returns (bool);
function settle(bytes calldata data) external;
}
// IYesNoOracleAdapter
interface IYesNoOracleAdapter {
function ask(string calldata question, uint256 deadline, bytes calldata data) external payable returns (bytes32);
function getAnswer(bytes32 oracleQuestionId) external view returns (bool finalized, uint8 outcome);
function refund(bytes32 oracleQuestionId) external returns (uint256 refunded);
}
// IConditionalTokens (Gnosis CTF)
interface IConditionalTokens {
function prepareCondition(address oracle, bytes32 questionId, uint256 outcomeSlotCount) external;
function reportPayouts(bytes32 questionId, uint256[] calldata payouts) external;
function splitPosition(IERC20 collateralToken, bytes32 parentCollectionId, bytes32 conditionId, uint256[] calldata partition, uint256 amount) external;
function mergePositions(IERC20 collateralToken, bytes32 parentCollectionId, bytes32 conditionId, uint256[] calldata partition, uint256 amount) external;
function redeemPositions(IERC20 collateralToken, bytes32 parentCollectionId, bytes32 conditionId, uint256[] calldata indexSets) external;
}GraphQL (Biểu đồ / Goldsky)
Điểm cuối: https://api.goldsky.com/api/public/project_{id}/subgraphs/cloudbank-bsc-testnet/{version}/gn
Thực thể lược đồ
Market
type Market @entity {
id: ID! # Market contract address
question: String! # Market question
conditionId: Bytes! # CTF condition ID
state: Int! # 0=TRADING, 1=PROPOSED, 2=RESOLVED
amm: Bytes # AMM contract address
yesTokenId: BigInt # YES token ID (ERC-1155)
noTokenId: BigInt # NO token ID (ERC-1155)
creator: Bytes! # Creator address
createdAtTimestamp: BigInt!
totalVolume: BigDecimal! # Total volume (USDC)
metadataUri: String # IPFS metadata URI
category: String # Market category (parsed from IPFS)
isMultiOutcome: Boolean! # Is multi-outcome market
multiOutcomeMarket: MultiOutcomeMarket
optionIndex: Int # Multi-outcome option index
optionLabel: String # Multi-outcome option label
trades: [Trade!]! @derivedFrom(field: "market")
}Trade
type Trade @entity {
id: ID! # txHash-logIndex
market: Market!
amm: Bytes!
trader: Bytes!
user: User!
type: String! # "buy" | "sell"
side: String! # "yes" | "no"
amountIn: BigInt!
amountOut: BigInt!
price: BigDecimal! # amountIn / amountOut
outcomeTokenId: BigInt!
timestamp: BigInt!
blockNumber: BigInt!
txHash: Bytes!
}User
type User @entity {
id: ID! # Address (lowercase)
totalVolume: BigDecimal!
realizedPnL: BigDecimal!
totalTrades: Int!
totalBuys: Int!
totalSells: Int!
totalProfitableSells: Int!
firstTradeTimestamp: BigInt!
lastTradeTimestamp: BigInt!
trades: [Trade!]! @derivedFrom(field: "user")
positions: [UserPosition!]! @derivedFrom(field: "user")
}UserPosition
type UserPosition @entity {
id: ID! # user-market-side
user: User!
market: Market!
side: String! # "yes" | "no"
shares: BigDecimal! # Current holdings
totalBought: BigDecimal!
totalSold: BigDecimal!
costBasis: BigDecimal! # Cost basis
proceeds: BigDecimal! # Cumulative proceeds
isOpen: Boolean!
openedAtTimestamp: BigInt!
lastTradeTimestamp: BigInt!
}MultiOutcomeMarket
type MultiOutcomeMarket @entity {
id: ID!
question: String!
metadataUri: String
creator: Bytes!
optionCount: Int!
options: [Market!]! @derivedFrom(field: "multiOutcomeMarket")
createdAtTimestamp: BigInt!
}Truy vấn phổ biến
Nhận tất cả các thị trường
query GetMarkets {
markets(orderBy: createdAtTimestamp, orderDirection: desc) {
id, question, state, amm, yesTokenId, noTokenId, totalVolume, category
trades(first: 1, orderBy: timestamp, orderDirection: desc) { price, side }
}
}Nhận giao dịch thị trường
query GetMarketTrades($marketId: ID!) {
trades(where: { market: $marketId }, orderBy: timestamp, orderDirection: desc, first: 100) {
id, trader, type, side, amountIn, amountOut, price, timestamp, txHash
}
}Nhận vị trí người dùng
query GetUserPositions($user: ID!) {
user(id: $user) {
positions(where: { isOpen: true }) {
side, shares, costBasis, proceeds
market { id, question, state }
}
}
}Bảng xếp hạng (theo số lượng)
query GetTopTraders($first: Int!) {
users(orderBy: totalVolume, orderDirection: desc, first: $first, where: { totalTrades_gt: 0 }) {
id, totalVolume, realizedPnL, totalTrades, totalProfitableSells
}
}Nhận thị trường đa kết quả
query GetMultiOutcomeMarket($id: ID!) {
multiOutcomeMarket(id: $id) {
id, question, optionCount
options(orderBy: optionIndex) {
id, optionLabel, state, amm, yesTokenId, noTokenId, totalVolume
}
}
}Sự kiện được lập chỉ mục
Biểu đồ con Biểu đồ lắng nghe các sự kiện trên chuỗi sau:
| Contract | Event | Handler | Entity |
|---|---|---|---|
| DCPPFactory | DCPPFactory | DCPPFactory | Market |
| DCPPFactory | DCPPFactory | DCPPFactory | Market |
| MultiOutcomeMarketFactory | MultiOutcomeMarketFactory | MultiOutcomeMarketFactory | MultiOutcomeMarket |
| MultiOutcomeMarketFactory | MultiOutcomeMarketFactory | MultiOutcomeMarketFactory | Market |
| BinaryCPMM (mẫu) | BinaryCPMM | BinaryCPMM | Giao dịch, Người dùng, UserPosition |
| BinaryCPMM (mẫu) | BinaryCPMM | BinaryCPMM | Giao dịch, Người dùng, UserPosition |
| BinaryCPMM (mẫu) | BinaryCPMM | BinaryCPMM | Giao dịch, Người dùng, UserPosition |
Địa chỉ hợp đồng (BSC Testnet)
| Contract | Address |
|---|---|
| FactoryRegistry | FactoryRegistry |
| DCPPFactory | DCPPFactory |
| MultiOutcomeMarketFactory | MultiOutcomeMarketFactory |
| ConditionalTokens (CTF) | ConditionalTokens |
| Mã thông báo thế chấp (USDC) | USDC |
Giới hạn tỷ lệ
Chiến lược nhóm mã thông báo dựa trên Redis với cửa sổ trượt 1 phút, được phân đoạn theo Người dùng ID / Quản trị viên ID / IP.
| Danh mục điểm cuối | Limit | Identifier |
|---|---|---|
| xác thực lần đầu | 100/min | IP |
| Đăng nhập xác thực | 5/min | IP |
| Thông tin ví | 100/min | User |
| ký tên | 20/min | User |
| Withdraw | 3/min | User |
| Mời liên kết | 60/min | User |
| Đã đọc sổ lệnh | 120/min | IP |
| Viết sổ đặt hàng | 30/min | User |
| xác thực của quản trị viên | 30/min | IP |
| Hoạt động quản trị | 120/min | Admin |
| Ký tên quản trị viên | 30/min | Admin |
Khi vượt quá, trả về tiêu đề 429 Too Many Requests + Retry-After.