Skip to Content

Red Bank

The Red Bank contract is at the heart of Amber Finance’s money market functionality, inherited from Mars Protocol. It holds all deposited assets and provides v1-style market interactions directly through the user’s wallet.


Deployment

  • Neutron: neutron1n97wnm7q6d2hrcna3rqlnyqw2we6k0l8uqvmyqq6gsml92epdu7quugyph

Types

type Decimal = string type Uint128 = string

Queries

config

Returns the contract’s configuration.

{ config: { } }

Response:

{ data: { address_provider: string owner?: string | null proposed_new_owner?: string | null } }

market (outdated)

{ market: { denom: string } }

market_v2

{ market_v2: { denom: string } }

Returns detailed information about the specific market, including interest model and indexes.

markets (outdated)

{ markets: { limit?: number | null start_after?: string | null } }

markets_v2

{ markets_v2: { limit?: number | null start_after?: string | null } }

Returns: A list of all markets and their parameters.

scaled_debt_amount

{ scaled_debt_amount: { amount: Uint128 denom: string } }

scaled_liquidity_amount

{ scaled_liquidity_amount: { amount: Uint128 denom: string } }

underlying_debt_amount

{ underlying_debt_amount: { amount_scaled: Uint128 denom: string } }

underlying_liquidity_amount

{ underlying_liquidity_amount: { amount_scaled: Uint128 denom: string } }

user_collateral

{ user_collateral: { account_id?: string | null denom: string user: string } }

user_collaterals (outdated)

{ user_collaterals: { 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 } }

user_debt

{ user_debt: { denom: string user: string } }

user_debts

{ user_debts: { limit?: number | null start_after?: string | null user: string } }

user_position

{ user_position: { account_id?: string | null user: string } }

user_position_liquidation_pricing

{ user_position_liquidation_pricing: { account_id?: string | null user: string } }

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 } }

This documentation reflects the Mars Protocol Red Bank contract as deployed by Amber Finance on Neutron.

Last updated on