ohtrade문서
거래 앱 열기 ↗

프로토콜 관리 권한과 종료

> Updated reference (English); translation pending.

The protocol separates normal account exit from a whole-protocol wind-down. An individual can close settled, unused account state through rent management while trading remains open for everyone else.

Operator controls

Authorized roles manage keeper identities, operational limits, market configuration and emergency actions. A keeper publishes prices and submits permitted execution; the administrator manages the applicable roles and settings. The auction relayer is a separate identity from every price keeper.

Market settings can change for future opens. Existing positions retain the terms saved when they opened. Operators can pause new opens and use the defined market-retirement or equity-settlement procedures for remaining positions.

The program is upgradeable while its upgrade authority is retained. An upgrade changes executable rules for later interactions. Review deployment information and published updates alongside these Docs.

The exit sequence

  1. Stop new activity and resolve open positions, pending requests and sell orders.
  2. Collect execution obligations and apply the eligible debt repayment resources.
  3. Settle ordinary rewards and referral matching, and return user balances and staking principal through the exit paths.
  4. Fix final LP distribution rights and process the remaining account refunds.
  5. Close eligible protocol accounts and return their rent to the recorded payers.

System-owned stakes leave before final LP sharing. They do not join the user distribution. User final-distribution rights remain recorded even when their principal has already been returned through an exit action.

If no user is staked

When OH has been issued but there is no user stake at wind-down, the protocol opens a 24-hour OH registration window. Registered amounts share the final user LP allocation pro rata. The window accepts exact remaining OH, including small and fractional balances.

OH registered in this window remains in custody until registration closes. After the deadline, principal can be returned through the applicable exit path without reducing its recorded final-distribution weight.

If nobody registers before the window closes, the remaining final LP is assigned to the fixed administrator beneficiary after prior obligations are handled. Later changes of administrator cannot redirect an already fixed beneficiary.

Unpaid debt and the seven-day fallback

After an exit request has been open for seven days, the remaining defined steps can be advanced by other callers. Before final debt settlement, positions and pending collateral must be cleared and the legally available repayment sources exhausted.

The final procedure pays available money in FIFO order and preserves already funded credits across batches. Only the unfunded remainder can be written off after eligible repayment assets have been exhausted. For example, with 150 USDC and two consecutive 100 USDC claims, the first receives 100 and the second receives 50; only the latter's remaining 50 is written off. The caller cannot choose a later creditor ahead of the queue head.

This is a terminal settlement rule. Normal operation continues to use FIFO repayment and the ordinary reserve protections described in the pools.

Rent at the end

Protocol account refunds follow the recorded rent payer and account dependencies. User wallet token accounts and the standard OH mint follow their own Solana account rules. Closing the ProgramData account is a final authority-controlled action after protocol shutdown; keeping upgrade authority is necessary for that refund path.

Local V11 implementation

This V11 build supports fresh deployments only. Its changed account discriminators and layouts must be decoded with the matching release's sdk/idl/perp.json and SDK; legacy accounts cannot be reinterpreted or upgraded in place by this build. The intent wire version is separate from the account ABI.

Holding upgrade authority does not make incompatible accounts migratable. A fresh V11 deployment does not erase or settle obligations of the old deployment. Preserve its user balances, FIFO claims, income-time reward ownership and historical records; resolve them through that deployment's supported settlement and exit paths. Do not close old program or data accounts merely because a new program is available.

V11 로컬 구현

이 V11 빌드는 신규 배포만 지원합니다. 계정 구분자와 구조가 바뀌므로 같은 릴리스의 sdk/idl/perp.json 및 SDK로 읽어야 하며, 기존 계정을 재해석하거나 제자리 업그레이드할 수 없습니다. Intent 메시지 버전과 계정 ABI는 별개입니다.

업그레이드 권한이 있어도 호환되지 않는 계정을 이전할 수는 없습니다. 신규 V11 배포는 기존 의무를 지우거나 정산하지 않습니다. 잔액, FIFO 채권, 수입 발생 시 보상 귀속과 기록을 보존하고 기존 배포가 지원하는 정산·종료 경로를 사용해야 합니다. 새 프로그램이 있다는 이유만으로 기존 프로그램·데이터 계정을 닫지 마세요.

← 이전
입출금과 내부 잔액
다음 →
앱이나 거래 Agent 만들기