Machine Trading Protocol/venues

Venue profile: Kamino (kamino), v0

Status
draft
Source
github.com/lgalabru/machine-trading/tree/main/specs

Kamino Lending (klend) is a peer-to-pool money market on Solana, program KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD. It runs several isolated lending markets; each market has one reserve per asset (more for fixed-rate borrowing), and the reserves of one market back each other as collateral.

1. Instruments

Reference Meaning
kamino:money-market:<SYMBOL> The reserve <SYMBOL> names in the table below.
kamino:money-market:<ADDRESS> The reserve at the base58 address <ADDRESS>, in its own lending market.

Named reserves, in Kamino's primary market, the SOL/BTC Market (7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF):

Symbol Reserve address Asset
SOL d4A2prbA2whesmvHaL88BH6Ewn5N4bTSU2Ze8P6Bc4Q SOL (So11111111111111111111111111111111111111112)
USDC D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59 USDC (EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v), variable rate

The same market has other USDC reserves, such as fixed-rate ones, so a symbol names one reserve, never an asset.

2. Account

In each lending market the universe uses, the account is every obligation the agent authority owns in that market, together with the authority's wallet. An obligation's address is a PDA of a tag, an id, the owner, the market and two seed accounts, so one owner can have several.

The wallet holds a supply too when the agent supplies without an obligation: deposit_reserve_liquidity gives the depositor the reserve's collateral token, a claim on the pool, which counts as supplied.

3. Measurements

An obligation stores its deposits, its borrows and their values as of its last refresh: refresh_reserve for every reserve it touches, then refresh_obligation, which accrues interest and reprices. Everything below is read from an obligation refreshed in the slot measured, for example by simulating those instructions; an enforcer MUST NOT read a stale obligation.

4. Liquidation

Liquidation is permissionless. Kamino's docs and the program's max_liquidatable_borrowed_amount agree on its shape:

5. The benchmark's enforcer

No benchmark task enforces this profile yet.