Errors
Every error the agora program can refuse a transaction with, its code, its message and the instructions that raise it.
A refused instruction fails the whole transaction and moves nothing. The program's errors are Anchor custom errors, numbered from 6000. In a failed transaction's logs, the code belongs to the first Program AwiCVSwQj1KaBBfyNmpkMhB2Dj6LdKdhaSqzd47NNsmw failed line; the API reports it by name in programError.name (a refused build) or error.program.name (a failed transaction), and the app shows the name beside what failed.
| Code | Hex | Name | Message | Raised by |
|---|---|---|---|---|
| 6000 | 0x1770 | Overflow | An amount exceeds the register's numeric range. | deposit, withdraw, issue, post_offer, cancel_offer, take_offer, post_repo_offer, cancel_repo_offer, take_repo_offer, repay_repo, settle_default, pay_income, claim_income |
| 6001 | 0x1771 | ZeroAmount | The amount must be positive. | deposit, withdraw, issue, post_offer, take_offer, post_repo_offer, take_repo_offer, pay_income |
| 6002 | 0x1772 | InsufficientFreeUnits | The account has insufficient free units. | post_offer, take_offer, take_repo_offer |
| 6003 | 0x1773 | InsufficientFreeCash | The account has insufficient free cash. | deposit, withdraw, post_offer, take_offer, post_repo_offer, repay_repo, pay_income |
| 6004 | 0x1774 | InsufficientLockedCash | The account has insufficient locked cash. | cancel_offer, take_offer, cancel_repo_offer, take_repo_offer |
| 6005 | 0x1775 | InsufficientLockedUnits | The account has insufficient locked units. | cancel_offer, take_offer |
| 6006 | 0x1776 | InsufficientPledgedUnits | The account has insufficient pledged units. | repay_repo, settle_default |
| 6007 | 0x1777 | SelfTrade | The maker cannot take their own offer. | take_offer, take_repo_offer |
| 6008 | 0x1778 | OfferTooSmall | The requested fill exceeds the available offer. | take_offer, take_repo_offer |
| 6009 | 0x1779 | WrongAccount | The account does not belong to this operation. | deposit, withdraw, issue, post_offer, cancel_offer, take_offer, post_repo_offer, cancel_repo_offer, take_repo_offer, repay_repo, settle_default, claim_income |
| 6010 | 0x177a | NotAdmitted | This wallet needs an admitted member account. | deposit, withdraw, list_instrument, post_offer, take_offer, post_repo_offer, take_repo_offer |
| 6011 | 0x177b | InvalidId | The offer or repo ID differs from the member counter. | post_offer, post_repo_offer, take_repo_offer |
| 6012 | 0x177c | InvalidFeeAccount | The fee destination must be the recipient's cash ATA. | take_offer |
| 6013 | 0x177d | TermOutOfRange | Repo terms run from one hour to 365 days. | post_repo_offer |
| 6014 | 0x177e | RepoNotMatured | The repo has not reached maturity. | settle_default |
| 6015 | 0x177f | RepoMatured | The repo has reached maturity. | repay_repo |
| 6016 | 0x1780 | RepoNotActive | The repo is no longer active. | repay_repo, settle_default |
| 6017 | 0x1781 | InvalidRepoAmount | The available cash must cover at least one collateral unit. | post_repo_offer |
| 6018 | 0x1782 | FeeAboveCap | The settlement fee exceeds 50 basis points. | update_config |
| 6019 | 0x1783 | WrongUpgradeAuthority | The signer must be the program upgrade authority. | initialize |
| 6020 | 0x1784 | WrongAdmin | The signer must be the ledger admin. | update_config |
| 6021 | 0x1785 | WrongOperator | The admission needs the ledger operator's signature. | admit |
| 6022 | 0x1786 | WrongRole | The member must hold the issuer role. | list_instrument |
| 6023 | 0x1787 | NotIssuer | Only the instrument's issuer may perform this action. | issue, pay_income |
| 6024 | 0x1788 | BadCode | Instrument codes must contain 1 to 12 uppercase letters or digits. | list_instrument |
| 6025 | 0x1789 | BadName | Names must contain text and fit in 80 UTF-8 bytes. | admit, list_instrument |
| 6026 | 0x178a | BadMaturity | Bond maturity must be in the future. | list_instrument |
| 6027 | 0x178b | BadCashMint | Cash must use a six-decimal SPL mint. | initialize |
| 6028 | 0x178c | NoUnitsOutstanding | The instrument has no units outstanding. | pay_income |
| 6029 | 0x178d | NothingToClaim | The position has no whole cash atoms to claim. | claim_income |
| 6030 | 0x178e | InvalidCashAccount | The wallet cash account must be its associated token account. | deposit, withdraw |
| 6031 | 0x178f | UnsetAddress | Authority and fee recipient addresses must be set. | initialize, update_config |
What to do
| Error | What to do |
|---|---|
NotAdmitted | Get admitted first. |
InsufficientFreeCash, InsufficientFreeUnits | Free the balance: deposit, or cancel an offer that locks it. Locked and pledged balances don't count. |
InsufficientLockedCash, InsufficientLockedUnits, InsufficientPledgedUnits | The register no longer matches the offer or repo built against. Read it again and rebuild. |
OfferTooSmall | Someone filled or took part of the offer. Read the book or repo offers again. |
InvalidId | Another offer or repo of yours landed first. Build again; the API reads the new counter. A stale id can also fail as "already in use" in the System program. |
SelfTrade | Take someone else's offer. |
RepoMatured | The repo can only be defaulted now. |
RepoNotMatured | Wait for maturity; the time left is on the repo. |
NothingToClaim | No whole cash atom has accrued since the last claim. |
WrongRole, NotIssuer | The action is the instrument issuer's. |
BadCode, BadName, BadMaturity, TermOutOfRange, InvalidRepoAmount, ZeroAmount | Fix the input named in the message. |
Refusals only the API makes
A few builds are refused by the API before the program could see them. They arrive as CHAIN_REFUSED with the name in programError.name:
| Name | Meaning |
|---|---|
AdmissionNotApproved | The operator must approve this admission request before the wallet builds it. |
InstrumentAlreadyListed | The register already has an instrument under this code. |
An offer, repo offer or repo the API can't find is NOT_FOUND, with no program error.
Other errors
Errors from Anchor's account checks, the System program and SPL Token come before these: see Framework errors. The API's own error codes, for requests refused before a transaction exists, are in API errors.