Red Bank
The Red Bank Contract is the heart of the Mars Protocol's Money Market. It holds all assets deposited to Mars and provides the v1 market interactions through the user's wallet.
Deployments
Neutron: neutron1n97wnm7q6d2hrcna3rqlnyqw2we6k0l8uqvmyqq6gsml92epdu7quugyph
Osmosis: osmo1c3ljch9dfw5kf52nfwpxd2zmj2ese7agnx0p9tenkrryasrle5sqf3ftpg
Types
The types of the Incentives Contract can be found here.
For reference on the Queries and Methods:
type Decimal = string
type Uint128 = string
Queries
config
Returns the Contracts configuration.
config: {}
}
{
data: {
address_provider: string
owner?: string | null
proposed_new_owner?: string | null
}
}
market (outdated)
{
market: {
denom: string
}
}
{
data: {
borrow_index: Decimal
borrow_rate: Decimal
collateral_total_scaled: Uint128
debt_total_scaled: Uint128
denom: string
indexes_last_updated: number
interest_rate_model: {
base: Decimal
optimal_utilization_rate: Decimal
slope_1: Decimal
slope_2: Decimal
}
liquidity_index: Decimal
liquidity_rate: Decimal
reserve_factor: Decimal
}
}
market_v2
{
market_v2: {
denom: string
}
}
{
data: {
borrow_index: Decimal
borrow_rate: Decimal
collateral_total_amount: Uint128
collateral_total_scaled: Uint128
debt_total_amount: Uint128
debt_total_scaled: Uint128
denom: string
indexes_last_updated: number
interest_rate_model: {
base: Decimal
optimal_utilization_rate: Decimal
slope_1: Decimal
slope_2: Decimal
}
liquidity_index: Decimal
liquidity_rate: Decimal
reserve_factor: Decimal
utilization_rate: Decimal
}
}
markets (outdated)
{
markets: {
limit?: number | null
start_after?: string | null
}
}
{
data: {
data: [
{
borrow_index: Decimal
borrow_rate: Decimal
collateral_total_scaled: Uint128
debt_total_scaled: Uint128
denom: string
indexes_last_updated: number
interest_rate_model: {
base: Decimal
optimal_utilization_rate: Decimal
slope_1: Decimal
slope_2: Decimal
}
liquidity_index: Decimal
liquidity_rate: Decimal
reserve_factor: Decimal
},
...
]
}
}
markets_v2
{
markets_v2: {
limit?: number | null
start_after?: string | null
}
}
{
data: {
data: [
{
borrow_index: Decimal
borrow_rate: Decimal
collateral_total_amount: Uint128
collateral_total_scaled: Uint128
debt_total_amount: Uint128
debt_total_scaled: Uint128
denom: string
indexes_last_updated: number
interest_rate_model: {
base: Decimal
optimal_utilization_rate: Decimal
slope_1: Decimal
slope_2: Decimal
}
liquidity_index: Decimal
liquidity_rate: Decimal
reserve_factor: Decimal
},
...
]
meta_data: {
has_more: boolean
}
}
}
scaled_debt_amount
{
scaled_debt_amount: {
amount: Uint128
denom: string
}
}
{
data: Uint123
}
scaled_liquidity_amount
{
scaled_liquidity_amount: {
amount: Uint128
denom: string
}
}
{
data: Uint123
}
underlying_debt_amount
{
underlying_debt_amount: {
amount_scaled: Uint128
denom: string
}
}
{
data: Uint123
}
underlying_liquidity_amount
{
underlying_liquidity_amount: {
amount_scaled: Uint128
denom: string
}
}
{
data: Uint123
}
user_collateral
{
user_collateral: {
account_id?: string | null
denom: string
user: string
}
}
{
data: {
amount: Uint128
amount_scaled: Uint128
denom: string
enabled: boolean
}
}
user_collaterals (outdated)
{
user_collaterals: {
account_id?: string | null
limit?: number | null
start_after?: string | null
user: string
}
}
{
data: [
{
account_id?: string | null
limit?: number | null
start_after?: string | null
user: string
},
...
]
}
user_collaterals_v2
{
user_collaterals_v2: {
account_id?: string | null
limit?: number | null
start_after?: string | null
user: string
}
}
{
data: {
data: [
{
account_id?: string | null
limit?: number | null
start_after?: string | null
user: string
},
...
]
meta_data: {
has_more: boolean
}
}
}
user_debt
{
user_debt: {
denom: string
user: string
}
}
{
data: {
amount: Uint128
amount_scaled: Uint128
denom: string
uncollateralized: boolean
}
}
user_debts
{
user_debts: {
limit?: number | null
start_after?: string | null
user: string
}
}
{
data: [
{
amount: Uint128
amount_scaled: Uint128
denom: string
uncollateralized: boolean
},
...
]
}
user_position
{
user_position: {
account_id?: string | null
user: string
}
}
{
data: {
health_status: 'not_borrowing' | {
borrowing: {
liq_threshold_hf: Decimal
max_ltv_hf: Decimal
}
}
total_collateralized_debt: Uint128
total_enabled_collateral: Uint128
weighted_liquidation_threshold_collateral: Uint128
weighted_max_ltv_collateral: Uint128
}
}
user_position_liquidation_pricing
{
user_position_liquidation_pricing: {
account_id?: string | null
user: string
}
}
{
data: {
health_status: 'not_borrowing' | {
borrowing: {
liq_threshold_hf: Decimal
max_ltv_hf: Decimal
}
}
total_collateralized_debt: Uint128
total_enabled_collateral: Uint128
weighted_liquidation_threshold_collateral: Uint128
weighted_max_ltv_collateral: Uint128
}
}
Methods
borrow
{
borrow: {
amount: Uint128
denom: string
recipient?: string | null
}
}
deposit
{
deposit: {
account_id?: string | null
on_behalf_of?: string | null
}
}
liquidate
{
liquidate: {
collateral_denom: string
recipient?: string | null
user: string
}
}
repay
{
repay: {
on_behalf_of?: string | null
}
}
withdraw
{
withdraw: {
account_id?: string | null
amount?: Uint128 | null
denom: string
liquidation_related?: boolean | null
recipient?: string | null
}
}
Last updated