Lending (lending)
Lending protocol positions, deposits, borrows, and liquidations.
18 queryable tables. Every table supports the standard Hasura query arguments — where, order_by, limit, offset, distinct_on — plus an _aggregate field.
Access: Team and Premium (Playground on lower plans)
Tables
account_health_resultborrow_eventcollateral_toggle_eventdeposit_eventevent_signatureflash_loan_eventliquidation_eventpositionprotocolrate_swap_eventrepay_eventreservereserve_candlereserve_data_eventreserve_statetoken_transfer_eventwatermarkwithdraw_event
account_health_result
| Column | Postgres type | GraphQL type |
|---|---|---|
user_evm_address | bytea | bytea |
total_collateral_usd | numeric | numeric |
total_debt_usd | numeric | numeric |
liquidation_threshold_usd | numeric | numeric |
health_factor | numeric | numeric |
query GetAccountHealthResult {
lending_account_health_result(limit: 10) {
user_evm_address
total_collateral_usd
total_debt_usd
liquidation_threshold_usd
}
}
borrow_event
| Column | Postgres type | GraphQL type |
|---|---|---|
consensus_timestamp | bigint | bigint |
log_index | integer | Int |
reserve_token_id | bigint | bigint |
user_evm_address | bytea | bytea |
on_behalf_of_evm_address | bytea | bytea |
amount | numeric | numeric |
amount_decimal | numeric | numeric |
rate_mode | smallint | smallint |
borrow_rate_ray | numeric | numeric |
referral | integer | Int |
payer_account_id | bigint | bigint |
transaction_hash | bytea | bytea |
inserted_at | timestamptz | timestamptz |
query GetBorrowEvent {
lending_borrow_event(limit: 10) {
consensus_timestamp
log_index
reserve_token_id
user_evm_address
}
}
collateral_toggle_event
| Column | Postgres type | GraphQL type |
|---|---|---|
consensus_timestamp | bigint | bigint |
log_index | integer | Int |
reserve_token_id | bigint | bigint |
user_evm_address | bytea | bytea |
enabled | boolean | Boolean |
payer_account_id | bigint | bigint |
transaction_hash | bytea | bytea |
inserted_at | timestamptz | timestamptz |
query GetCollateralToggleEvent {
lending_collateral_toggle_event(limit: 10) {
consensus_timestamp
log_index
reserve_token_id
user_evm_address
}
}
deposit_event
| Column | Postgres type | GraphQL type |
|---|---|---|
consensus_timestamp | bigint | bigint |
log_index | integer | Int |
reserve_token_id | bigint | bigint |
user_evm_address | bytea | bytea |
on_behalf_of_evm_address | bytea | bytea |
amount | numeric | numeric |
amount_decimal | numeric | numeric |
referral | integer | Int |
payer_account_id | bigint | bigint |
transaction_hash | bytea | bytea |
inserted_at | timestamptz | timestamptz |
query GetDepositEvent {
lending_deposit_event(limit: 10) {
consensus_timestamp
log_index
reserve_token_id
user_evm_address
}
}
event_signature
| Column | Postgres type | GraphQL type |
|---|---|---|
topic0 | bytea | bytea |
event_name | text | String |
emitter_kind | text | String |
signature | text | String |
query GetEventSignature {
lending_event_signature(limit: 10) {
topic0
event_name
emitter_kind
signature
}
}
flash_loan_event
| Column | Postgres type | GraphQL type |
|---|---|---|
consensus_timestamp | bigint | bigint |
log_index | integer | Int |
reserve_token_id | bigint | bigint |
target_evm_address | bytea | bytea |
initiator_evm_address | bytea | bytea |
amount | numeric | numeric |
amount_decimal | numeric | numeric |
premium | numeric | numeric |
premium_decimal | numeric | numeric |
referral | integer | Int |
payer_account_id | bigint | bigint |
transaction_hash | bytea | bytea |
inserted_at | timestamptz | timestamptz |
query GetFlashLoanEvent {
lending_flash_loan_event(limit: 10) {
consensus_timestamp
log_index
reserve_token_id
target_evm_address
}
}
liquidation_event
| Column | Postgres type | GraphQL type |
|---|---|---|
consensus_timestamp | bigint | bigint |
log_index | integer | Int |
collateral_reserve_token_id | bigint | bigint |
debt_reserve_token_id | bigint | bigint |
user_evm_address | bytea | bytea |
debt_to_cover | numeric | numeric |
debt_to_cover_decimal | numeric | numeric |
liquidated_collateral_amount | numeric | numeric |
liquidated_collateral_amount_decimal | numeric | numeric |
liquidator_evm_address | bytea | bytea |
receive_atoken | boolean | Boolean |
payer_account_id | bigint | bigint |
transaction_hash | bytea | bytea |
inserted_at | timestamptz | timestamptz |
query GetLiquidationEvent {
lending_liquidation_event(limit: 10) {
consensus_timestamp
log_index
collateral_reserve_token_id
debt_reserve_token_id
}
}
position
| Column | Postgres type | GraphQL type |
|---|---|---|
user_evm_address | bytea | bytea |
reserve_token_id | bigint | bigint |
account_id | bigint | bigint |
atoken_scaled | numeric | numeric |
variable_debt_scaled | numeric | numeric |
used_as_collateral | boolean | Boolean |
first_event_timestamp | bigint | bigint |
last_event_timestamp | bigint | bigint |
collateral_toggle_timestamp | bigint | bigint |
updated_at | timestamptz | timestamptz |
query GetPosition {
lending_position(limit: 10) {
user_evm_address
reserve_token_id
account_id
atoken_scaled
}
}
protocol
| Column | Postgres type | GraphQL type |
|---|---|---|
protocol | text | String |
lending_pool_id | bigint | bigint |
lending_pool_evm_address | text | String |
configurator_id | bigint | bigint |
configurator_evm_address | text | String |
addresses_provider_id | bigint | bigint |
addresses_provider_evm_address | text | String |
oracle_id | bigint | bigint |
oracle_evm_address | text | String |
data_provider_id | bigint | bigint |
data_provider_evm_address | text | String |
genesis_timestamp | bigint | bigint |
is_active | boolean | Boolean |
query GetProtocol {
lending_protocol(limit: 10) {
protocol
lending_pool_id
lending_pool_evm_address
configurator_id
}
}
rate_swap_event
| Column | Postgres type | GraphQL type |
|---|---|---|
consensus_timestamp | bigint | bigint |
log_index | integer | Int |
reserve_token_id | bigint | bigint |
user_evm_address | bytea | bytea |
rate_mode | smallint | smallint |
payer_account_id | bigint | bigint |
transaction_hash | bytea | bytea |
inserted_at | timestamptz | timestamptz |
query GetRateSwapEvent {
lending_rate_swap_event(limit: 10) {
consensus_timestamp
log_index
reserve_token_id
user_evm_address
}
}
repay_event
| Column | Postgres type | GraphQL type |
|---|---|---|
consensus_timestamp | bigint | bigint |
log_index | integer | Int |
reserve_token_id | bigint | bigint |
user_evm_address | bytea | bytea |
repayer_evm_address | bytea | bytea |
amount | numeric | numeric |
amount_decimal | numeric | numeric |
payer_account_id | bigint | bigint |
transaction_hash | bytea | bytea |
inserted_at | timestamptz | timestamptz |
query GetRepayEvent {
lending_repay_event(limit: 10) {
consensus_timestamp
log_index
reserve_token_id
user_evm_address
}
}
reserve
| Column | Postgres type | GraphQL type |
|---|---|---|
reserve_token_id | bigint | bigint |
protocol | text | String |
underlying_evm_address | text | String |
atoken_id | bigint | bigint |
atoken_evm_address | text | String |
variable_debt_token_id | bigint | bigint |
variable_debt_token_evm_address | text | String |
stable_debt_token_id | bigint | bigint |
stable_debt_token_evm_address | text | String |
interest_rate_strategy_evm_address | text | String |
decimals | bigint | bigint |
symbol | text | String |
name | text | String |
ltv | integer | Int |
liquidation_threshold | integer | Int |
liquidation_bonus | integer | Int |
reserve_factor | integer | Int |
borrow_cap | numeric | numeric |
supply_cap | numeric | numeric |
borrowing_enabled | boolean | Boolean |
stable_borrowing_enabled | boolean | Boolean |
is_frozen | boolean | Boolean |
reserve_active | boolean | Boolean |
is_tracked | boolean | Boolean |
initialized_timestamp | bigint | bigint |
query GetReserve {
lending_reserve(limit: 10) {
reserve_token_id
protocol
underlying_evm_address
atoken_id
}
}
reserve_candle
| Column | Postgres type | GraphQL type |
|---|---|---|
reserve_token_id | bigint | bigint |
period | text | String |
timestamp_range | int8range | int8range |
open_supply_apr | numeric | numeric |
high_supply_apr | numeric | numeric |
low_supply_apr | numeric | numeric |
close_supply_apr | numeric | numeric |
open_variable_borrow_apr | numeric | numeric |
high_variable_borrow_apr | numeric | numeric |
low_variable_borrow_apr | numeric | numeric |
close_variable_borrow_apr | numeric | numeric |
close_liquidity_index_ray | numeric | numeric |
close_variable_borrow_index_ray | numeric | numeric |
deposit_volume | numeric | numeric |
withdraw_volume | numeric | numeric |
borrow_volume | numeric | numeric |
repay_volume | numeric | numeric |
liquidation_count | integer | Int |
flash_loan_count | integer | Int |
num_rate_updates | integer | Int |
query GetReserveCandle {
lending_reserve_candle(limit: 10) {
reserve_token_id
period
timestamp_range
open_supply_apr
}
}
reserve_data_event
| Column | Postgres type | GraphQL type |
|---|---|---|
consensus_timestamp | bigint | bigint |
log_index | integer | Int |
reserve_token_id | bigint | bigint |
liquidity_rate_ray | numeric | numeric |
stable_borrow_rate_ray | numeric | numeric |
variable_borrow_rate_ray | numeric | numeric |
liquidity_index_ray | numeric | numeric |
variable_borrow_index_ray | numeric | numeric |
payer_account_id | bigint | bigint |
transaction_hash | bytea | bytea |
inserted_at | timestamptz | timestamptz |
query GetReserveDataEvent {
lending_reserve_data_event(limit: 10) {
consensus_timestamp
log_index
reserve_token_id
liquidity_rate_ray
}
}
reserve_state
| Column | Postgres type | GraphQL type |
|---|---|---|
reserve_token_id | bigint | bigint |
liquidity_rate_ray | numeric | numeric |
stable_borrow_rate_ray | numeric | numeric |
variable_borrow_rate_ray | numeric | numeric |
liquidity_index_ray | numeric | numeric |
variable_borrow_index_ray | numeric | numeric |
total_atoken_scaled | numeric | numeric |
total_variable_debt_scaled | numeric | numeric |
supply_apr | numeric | numeric |
variable_borrow_apr | numeric | numeric |
last_event_timestamp | bigint | bigint |
updated_at | timestamptz | timestamptz |
query GetReserveState {
lending_reserve_state(limit: 10) {
reserve_token_id
liquidity_rate_ray
stable_borrow_rate_ray
variable_borrow_rate_ray
}
}
token_transfer_event
| Column | Postgres type | GraphQL type |
|---|---|---|
consensus_timestamp | bigint | bigint |
log_index | integer | Int |
token_id | bigint | bigint |
reserve_token_id | bigint | bigint |
token_kind | text | String |
event_kind | text | String |
from_evm_address | bytea | bytea |
to_evm_address | bytea | bytea |
value | numeric | numeric |
value_scaled | numeric | numeric |
index_ray | numeric | numeric |
payer_account_id | bigint | bigint |
transaction_hash | bytea | bytea |
inserted_at | timestamptz | timestamptz |
query GetTokenTransferEvent {
lending_token_transfer_event(limit: 10) {
consensus_timestamp
log_index
token_id
reserve_token_id
}
}
watermark
| Column | Postgres type | GraphQL type |
|---|---|---|
job_name | text | String |
last_processed_ns | bigint | bigint |
updated_at | timestamptz | timestamptz |
query GetWatermark {
lending_watermark(limit: 10) {
job_name
last_processed_ns
updated_at
}
}
withdraw_event
| Column | Postgres type | GraphQL type |
|---|---|---|
consensus_timestamp | bigint | bigint |
log_index | integer | Int |
reserve_token_id | bigint | bigint |
user_evm_address | bytea | bytea |
to_evm_address | bytea | bytea |
amount | numeric | numeric |
amount_decimal | numeric | numeric |
payer_account_id | bigint | bigint |
transaction_hash | bytea | bytea |
inserted_at | timestamptz | timestamptz |
query GetWithdrawEvent {
lending_withdraw_event(limit: 10) {
consensus_timestamp
log_index
reserve_token_id
user_evm_address
}
}