Antler by Autoflux
HomeAurum ProtocolAPI Reference

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

ErrorModuleMeaning
InsufficientCollateral()CoreOperation would make collateral negative
HealthFactorTooLow(uint256 hf)LendingBorrow or withdraw rejected — HF would breach minimum
NotLiquidatable(address user)LiquidationUser's HF ≥ 1.0 at execution time
StalePrice(address asset, uint64 age)OracleNo fresh price found within staleness window
Unauthorised(address caller)AuthCaller lacks required role
ActivePositions(uint256 vaultId)VaultsCannot close vault with remaining positions
DelegationExpired()VaultsDelegate signature past its expiry block
ParticipantNotEligible(address user)ParticipantsUser not registered or expired for this market

Contract Addresses (Mainnet)

ModuleAddress
Core0xA1b2…C3d4
Auth0xB5e6…F7a8
Lending0xC9b0…D1e2
Liquidation0xD3f4…E5c6
Oracle0xE7d8…F9a0
Participants0xF1b2…A3c4
Payments0xA5d6…B7e8
Vaults0xB9f0…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 definitions
 
interface 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