API Reference
Complete function signatures, events, and error codes for all Aurum modules.
Path: api-reference
Third-party documentation. This is independently authored analysis of the public Aurum Protocol codebase — not the official docs, and not reviewed or endorsed by the Aurum Protocol team.
API Reference
This page is the canonical reference for every public function, event, and custom error in the Aurum Protocol. Addresses for each network are available in the deployment registry.
Error Codes
| Error | Module | Meaning |
|---|---|---|
InsufficientCollateral() | Core | Operation would make collateral negative |
HealthFactorTooLow(uint256 hf) | Lending | Borrow or withdraw rejected — HF would breach minimum |
NotLiquidatable(address user) | Liquidation | User's HF ≥ 1.0 at execution time |
StalePrice(address asset, uint64 age) | Oracle | No fresh price found within staleness window |
Unauthorised(address caller) | Auth | Caller lacks required role |
ActivePositions(uint256 vaultId) | Vaults | Cannot close vault with remaining positions |
DelegationExpired() | Vaults | Delegate signature past its expiry block |
ParticipantNotEligible(address user) | Participants | User not registered or expired for this market |
Contract Addresses (Mainnet)
| Module | Address |
|---|---|
| Core | 0xA1b2…C3d4 |
| Auth | 0xB5e6…F7a8 |
| Lending | 0xC9b0…D1e2 |
| Liquidation | 0xD3f4…E5c6 |
| Oracle | 0xE7d8…F9a0 |
| Participants | 0xF1b2…A3c4 |
| Payments | 0xA5d6…B7e8 |
| Vaults | 0xB9f0…C1a2 |
Examples
Enumerate all events for a user
Enumerate all events for a user
typescript
const filter = lending.filters.Borrowed(userAddress);const events = await lending.queryFilter(filter, fromBlock, toBlock);events.forEach(e => {console.log(e.blockNumber,"Borrowed", ethers.formatEther(e.args.amount),e.args.asset);});
STATUSexample
Query the Borrowed event log to reconstruct a user's full borrow history.
Interface
Interface
typescript
// AurumSDK convenience wrapper — full type definitionsinterface AurumSDK {core: ICoreSDK;auth: IAuthSDK;lending: ILendingSDK;liquidation: ILiquidationSDK;oracle: IOracleSDK;participants: IParticipantsSDK;payments: IPaymentsSDK;vaults: IVaultsSDK;}interface ICoreSDK {getVault(user: string): Promise<Vault>;healthFactor(user: string): Promise<bigint>;}interface ILendingSDK {deposit(asset: string, amount: string): Promise<void>;withdraw(asset: string, amount: string): Promise<void>;borrow(asset: string, amount: string): Promise<void>;repay(asset: string, amount: string | "max"): Promise<void>;borrowRate(asset: string): Promise<bigint>; // 1e18 = 100% APR}interface IVaultsSDK {open(): Promise<number>;close(vaultId: number): Promise<void>;deposit(vaultId: number, asset: string, amount: string): Promise<void>;withdraw(vaultId: number, asset: string, amount: string): Promise<void>;getAssets(vaultId: number): Promise<[string[], bigint[]]>;}
STATUSinterface
