Skip to content

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 requests

JWT đượ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í)

bash
export HOST="https://docs-test.cloudbank.to"
export API="$HOST/api/v1"
export ADDRESS="0xYourWalletAddress"

1) Xác thực: nonce + đăng nhập

bash
curl -sS -X POST "$API/auth/nonce" \
  -H "Content-Type: application/json" \
  -d "{\"address\":\"$ADDRESS\"}"
json
{
  "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$MESSAGE phải được thay thế bằng dữ liệu chữ ký ví thực tế):

bash
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\"}"
json
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "custodialWalletAddress": "0x4D7E...A9f2",
  "expiresAt": "2026-03-06T12:00:00Z"
}
bash
export TOKEN="eyJhbGciOi..."

2) Thị trường: truy vấn danh sách thị trường

bash
curl -sS "$API/markets?state=TRADING&limit=20&offset=0" \
  -H "Authorization: Bearer $TOKEN"
json
{
  "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

bash
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"
  }'
json
{
  "orderHash": "0x8f7b...c31d",
  "status": "open",
  "filledAmount": "0",
  "createdAt": "2026-03-05T10:00:00Z"
}

4) Ví: lấy thông tin + rút tiền

bash
curl -sS "$API/wallet/info" \
  -H "Authorization: Bearer $TOKEN"
json
{
  "walletAddress": "0x4D7E...A9f2",
  "balances": {
    "BNB": "0.132",
    "USDC": "1250.50"
  },
  "chainId": 97
}
bash
curl -sS -X POST "$API/wallet/withdraw" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "asset":"USDC",
    "toAddress":"0xReceiverAddress",
    "amount":"25.0"
  }'
json
{
  "txHash": "0x4b17...9f25",
  "asset": "USDC",
  "amount": "25.0",
  "status": "pending"
}

Auth

MethodPathAuthGiới hạn tỷ lệDescription
POSTPOST-100/min/IPTạo thử thách EIP-191 (địa chỉ -> nonce + tin nhắn)
POSTPOST-5/min/IPXác minh chữ ký và trả lại JWT + CustodialWalletAddress

POST POST

json
// Request
{ "address": "0x..." }
// Response
{ "nonce": "abc123", "message": "Sign this message...", "expiresAt": "2026-01-01T00:00:00Z" }

POST POST

json
// Request
{ "address": "0x...", "signature": "0x...", "message": "Sign this message..." }
// Response
{ "token": "eyJ...", "custodialWalletAddress": "0x...", "expiresAt": "2026-01-01T00:00:00Z" }

Wallet

MethodPathAuthGiới hạn tỷ lệDescription
GETGETJWT100/minNhận thông tin ví tạm giữ
DELETEDELETEJWT100/minXóa ví lưu ký (yêu cầu trạng thái không hoạt động)
POSTPOSTJWT20/minKý giao dịch thay mặt (hợp đồng được liệt kê trong danh sách trắng)
POSTPOSTJWT3/minRút BNB/USDC (giới hạn hàng ngày)

POST POST

json
// Request
{ "to": "0x...", "data": "0x...", "value": "0", "product": "predict" }
// Response
{ "txHash": "0x...", "gasMode": "paymaster", "status": "pending", "createdAt": "..." }

POST POST

json
// Request
{ "asset": "USDC", "toAddress": "0x...", "amount": "100.5" }
// Response
{ "txHash": "0x...", "asset": "USDC", "amount": "100.5", "fee": "0", "gasMode": "user", "status": "pending" }

Orderbook

MethodPathAuthGiới hạn tỷ lệDescription
GETGET-120/min/IPNhận độ sâu sổ đặt hàng
POSTPOSTJWT30/minGửi đơn đặt hàng
POSTPOSTJWT30/minLộ trình kết hợp (AMM + Sổ đặt hàng)
DELETEDELETEJWT30/minHủy đơn hàng
GETGETJWT30/minNhận trạng thái nhịp tim
GETGETJWT-WebSocket kênh nhịp tim

GET GET

?marketId={id}&outcomeTokenId={tokenId}&depth=20
json
// Response
{ "market": "0x...", "bids": [{"price": "0.65", "size": "100"}], "asks": [...] }

Mời quan hệ

MethodPathAuthGiới hạn tỷ lệDescription
GETGET-120/min/IPTruy vấn quan hệ theo người mời
POSTPOSTJWT60/minRàng buộc mối quan hệ lời mời
GETGETJWT60/minNhận mối quan hệ mời riêng

Quản trị viên - Xác thực

MethodPathAuthGiới hạn tỷ lệDescription
POSTPOST-30/min/IPĐăng nhập quản trị viên
POSTPOST-30/min/IPLàm mới mã thông báo

Quản trị viên - Người dùng (superadmin)

MethodPathAuthDescription
GETGETQuản trị viên+SALiệt kê tất cả quản trị viên
GETGETQuản trị viên+SANhận thông tin chi tiết quản trị viên
POSTPOSTQuản trị viên+SATạo quản trị viên
PATCHPATCHQuản trị viên+SACập nhật quản trị viên
POSTPOSTQuản trị viên+SAĐặt lại mật khẩu
POSTPOSTQuản trị viên+SAVí hoạt động ràng buộc
POSTPOSTQuản trị viên+SAHủy liên kết ví hoạt động

Quản trị viên — Người dùng giám sát

MethodPathAuthDescription
GETGETAdminTruy vấn được phân trang cho người dùng giám hộ
GETGETAdminNhận thông tin người dùng + ví
DELETEDELETESAXóa vĩnh viễn ví người dùng

Quản trị viên — Ví hoạt động (superadmin)

MethodPathAuthDescription
GETGETSALiệt kê các ví hoạt động
GETGETSANhận thông tin chi tiết về ví
POSTPOSTSATạo ví hoạt động
PATCHPATCHSACập nhật ví hoạt động
POSTPOSTAdminGiao dịch đăng nhập ví hoạt động

Quản trị viên — Danh sách trắng

MethodPathAuthDescription
POSTPOSTAdminThêm danh sách trắng hợp đồng
GETGETAdminDanh sách trắng truy vấn (có thể lọc theo sản phẩm)
PATCHPATCHAdminCập nhật mục nhập danh sách trắng
DELETEDELETEAdminXóa mục nhập danh sách trắng

Quản trị viên - Mời quan hệ (superadmin)

MethodPathAuthDescription
GETGETSATruy vấn được phân trang (CSV hỗ trợ xuất)
POSTPOSTSANhập số lượng lớn (<=500 hàng mỗi đợt)

System

MethodPathAuthDescription
GETGET-Kiểm tra sức khỏe (trạng tháiSQL/Redis/BSC)
GETGET-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:

json
{ "code": "error_code", "message": "Human-readable message", "details": {} }
CodeHTTP Trạng tháiDescription
invalid_request400Tham số yêu cầu không hợp lệ
invalid_signature401EIP-191 xác minh chữ ký không thành công
invalid_nonce401Nonce không hợp lệ hoặc đã hết hạn
unauthorized401Chưa được xác thực hoặc mã thông báo đã hết hạn
forbidden403Forbidden
contract_not_whitelisted403Hợp đồng không nằm trong danh sách trắng
insufficient_bnb400Số dư BNB không đủ
insufficient_balance400Số dư không đủ
daily_limit_exceeded429Vượt quá giới hạn rút tiền hàng ngày
not_found404Không tìm thấy tài nguyên
rate_limited429Đã vượt quá giới hạn tỷ lệ
invite_binding_conflict409Xung đột mối quan hệ mời
invite_request_replayed409Yêu cầu liên kết trùng lặp
invite_self_not_allowed400Không được phép tự mời
internal_error500Lỗi máy chủ nội bộ
service_unavailable503Dị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

json
{ "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.

solidity
// 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.

solidity
// 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.

solidity
// 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).

solidity
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.

solidity
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.

solidity
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.

solidity
function factory() external view returns (address);
function setFactory(address newFactory) external;  // onlyOwner

Giao diện chính

solidity
// 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

graphql
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

graphql
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

graphql
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

graphql
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

graphql
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

graphql
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

graphql
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

graphql
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)

graphql
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ả

graphql
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:

ContractEventHandlerEntity
DCPPFactoryDCPPFactoryDCPPFactoryMarket
DCPPFactoryDCPPFactoryDCPPFactoryMarket
MultiOutcomeMarketFactoryMultiOutcomeMarketFactoryMultiOutcomeMarketFactoryMultiOutcomeMarket
MultiOutcomeMarketFactoryMultiOutcomeMarketFactoryMultiOutcomeMarketFactoryMarket
BinaryCPMM (mẫu)BinaryCPMMBinaryCPMMGiao dịch, Người dùng, UserPosition
BinaryCPMM (mẫu)BinaryCPMMBinaryCPMMGiao dịch, Người dùng, UserPosition
BinaryCPMM (mẫu)BinaryCPMMBinaryCPMMGiao dịch, Người dùng, UserPosition

Địa chỉ hợp đồng (BSC Testnet)

ContractAddress
FactoryRegistryFactoryRegistry
DCPPFactoryDCPPFactory
MultiOutcomeMarketFactoryMultiOutcomeMarketFactory
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ốiLimitIdentifier
xác thực lần đầu100/minIP
Đăng nhập xác thực5/minIP
Thông tin ví100/minUser
ký tên20/minUser
Withdraw3/minUser
Mời liên kết60/minUser
Đã đọc sổ lệnh120/minIP
Viết sổ đặt hàng30/minUser
xác thực của quản trị viên30/minIP
Hoạt động quản trị120/minAdmin
Ký tên quản trị viên30/minAdmin

Khi vượt quá, trả về tiêu đề 429 Too Many Requests + Retry-After.