package models

import "time"

// KnownBorrower stores every address that has ever interacted with the lending contract.
// The liquidation bot checks ALL known borrowers for isLiquidatable on every tick,
// so accounts whose health factor drops due to oracle price changes are still caught
// even if they haven't had a recent on-chain transaction.
type KnownBorrower struct {
	ID          uint      `gorm:"primaryKey;autoIncrement" json:"id"`
	ChainID     int       `gorm:"uniqueIndex:idx_known_borrower" json:"chain_id"`
	Address     string    `gorm:"size:42;uniqueIndex:idx_known_borrower" json:"address"`
	FirstSeenAt time.Time `json:"first_seen_at"`
	LastSeenAt  time.Time `json:"last_seen_at"`
}

func (KnownBorrower) TableName() string { return "known_borrowers" }
