Skip to main content
logo

credit-manager

InstantiateMsg

types.ts
Copy

_18
type Decimal = string
_18
type Uint128 = string
_18
type OracleBaseForString = string
_18
type RedBankBaseForString = string
_18
type SwapperBaseForString = string
_18
type ZapperBaseForString = string
_18
_18
interface InstantiateMsg {
_18
allowed_coins: string[]
_18
max_close_factor: Decimal
_18
max_unlocking_positions: Uint128
_18
oracle: OracleBaseForString
_18
owner: string
_18
red_bank: RedBankBaseForString
_18
swapper: SwapperBaseForString
_18
vault_configs: VaultInstantiateConfig[]
_18
zapper: ZapperBaseForString
_18
}

VaultInstantiateConfig

types.ts
Copy

_4
interface VaultInstantiateConfig {
_4
config: VaultConfig
_4
vault: VaultBaseForString
_4
}

VaultConfig

types.ts
Copy

_6
interface VaultConfig {
_6
deposit_cap: Coin
_6
liquidation_threshold: Decimal
_6
max_ltv: Decimal
_6
whitelisted: boolean
_6
}

Coin

types.ts
Copy

_6
interface VaultConfig {
_6
deposit_cap: Coin
_6
liquidation_threshold: Decimal
_6
max_ltv: Decimal
_6
whitelisted: boolean
_6
}

VaultBaseForString

types.ts
Copy

_3
interface VaultBaseForString {
_3
address: string
_3
}

ExecuteMsg

create_credit_account

Mints NFT representing a credit account for user. User can have many.

types.ts
Copy

_4
type ExecuteMsg =
_4
{
_4
create_credit_account: {}
_4
}

update_credit_account

Update user's position on their credit account.

types.ts
Copy

_7
type ExecuteMsg =
_7
{
_7
update_credit_account: {
_7
account_id: string
_7
actions: Action[]
_7
}
_7
}

Action

types.ts
Copy

_74
type Action =
_74
| {
_74
deposit: Coin
_74
}
_74
| {
_74
withdraw: Coin
_74
}
_74
| {
_74
borrow: Coin
_74
}
_74
| {
_74
repay: ActionCoin
_74
}
_74
| {
_74
enter_vault: {
_74
coin: ActionCoin
_74
vault: VaultBaseForString
_74
}
_74
}
_74
| {
_74
exit_vault: {
_74
amount: Uint128
_74
vault: VaultBaseForString
_74
}
_74
}
_74
| {
_74
request_vault_unlock: {
_74
amount: Uint128
_74
vault: VaultBaseForString
_74
}
_74
}
_74
| {
_74
exit_vault_unlocked: {
_74
id: number
_74
vault: VaultBaseForString
_74
}
_74
}
_74
| {
_74
liquidate_coin: {
_74
debt_coin: Coin
_74
liquidatee_account_id: string
_74
request_coin_denom: string
_74
}
_74
}
_74
| {
_74
liquidate_vault: {
_74
debt_coin: Coin
_74
liquidatee_account_id: string
_74
position_type: VaultPositionType
_74
request_vault: VaultBaseForString
_74
}
_74
}
_74
| {
_74
swap_exact_in: {
_74
coin_in: ActionCoin
_74
denom_out: string
_74
slippage: Decimal
_74
}
_74
}
_74
| {
_74
provide_liquidity: {
_74
coins_in: ActionCoin[]
_74
lp_token_out: string
_74
minimum_receive: Uint128
_74
}
_74
}
_74
| {
_74
withdraw_liquidity: {
_74
lp_token: ActionCoin
_74
}
_74
}
_74
| {
_74
refund_all_coin_balances: {}
_74
}

ActionCoin

types.ts
Copy

_4
interface ActionCoin {
_4
amount: ActionAmount
_4
denom: string
_4
}

ActionAmount

types.ts
Copy

_5
type ActionAmount =
_5
| 'account_balance'
_5
| {
_5
exact: Uint128
_5
}

VaultPositionType

types.ts
Copy

_1
type VaultPositionType = 'u_n_l_o_c_k_e_d' | 'l_o_c_k_e_d' | 'u_n_l_o_c_k_i_n_g'

update_config

Update contract config constants.

types.ts
Copy

_6
type ExecuteMsg =
_6
{
_6
update_config: {
_6
updates: ConfigUpdates
_6
}
_6
}

ConfigUpdates

Used when you want to update fields on Instantiate config.

types.ts
Copy

_10
interface ConfigUpdates {
_10
account_nft?: string | null
_10
allowed_coins?: string[] | null
_10
max_close_factor?: Decimal | null
_10
max_unlocking_positions?: Uint128 | null
_10
oracle?: OracleBaseForString | null
_10
swapper?: SwapperBaseForString | null
_10
vault_configs?: VaultInstantiateConfig[] | null
_10
zapper?: ZapperBaseForString | null
_10
}

update_owner

Manages owner role state.

types.ts
Copy

_4
type ExecuteMsg =
_4
{
_4
update_owner: OwnerUpdate
_4
}

OwnerUpdate

types.ts
Copy

_9
type OwnerUpdate =
_9
| {
_9
propose_new_owner: {
_9
proposed: string
_9
}
_9
}
_9
| 'clear_proposed'
_9
| 'accept_proposed'
_9
| 'abolish_owner_role'

update_nft_config

Update nft contract config.

types.ts
Copy

_6
type ExecuteMsg =
_6
{
_6
update_nft_config: {
_6
updates: NftConfigUpdates
_6
}
_6
}

NftConfigUpdates

types.ts
Copy

_4
interface NftConfigUpdates {
_4
max_value_for_burn?: Uint128 | null
_4
proposed_new_minter?: string | null
_4
}

callback

Internal actions only callable by the contract itself.

types.ts
Copy

_4
type ExecuteMsg =
_4
{
_4
callback: CallbackMsg
_4
}

CallbackMsg

Internal actions made by the contract with pre-validated inputs.

types.ts
Copy

_118
type Addr = string
_118
_118
type CallbackMsg =
_118
| {
_118
withdraw: {
_118
account_id: string
_118
coin: Coin
_118
recipient: Addr
_118
}
_118
}
_118
| {
_118
borrow: {
_118
account_id: string
_118
coin: Coin
_118
}
_118
}
_118
| {
_118
repay: {
_118
account_id: string
_118
coin: ActionCoin
_118
}
_118
}
_118
| {
_118
assert_max_ltv: {
_118
account_id: string
_118
prev_health: Health
_118
}
_118
}
_118
| {
_118
enter_vault: {
_118
account_id: string
_118
coin: ActionCoin
_118
vault: VaultBaseForAddr
_118
}
_118
}
_118
| {
_118
exit_vault: {
_118
account_id: string
_118
amount: Uint128
_118
vault: VaultBaseForAddr
_118
}
_118
}
_118
| {
_118
update_vault_coin_balance: {
_118
account_id: string
_118
previous_total_balance: Uint128
_118
vault: VaultBaseForAddr
_118
}
_118
}
_118
| {
_118
request_vault_unlock: {
_118
account_id: string
_118
amount: Uint128
_118
vault: VaultBaseForAddr
_118
}
_118
}
_118
| {
_118
exit_vault_unlocked: {
_118
account_id: string
_118
position_id: number
_118
vault: VaultBaseForAddr
_118
}
_118
}
_118
| {
_118
liquidate_coin: {
_118
debt_coin: Coin
_118
liquidatee_account_id: string
_118
liquidator_account_id: string
_118
request_coin_denom: string
_118
}
_118
}
_118
| {
_118
liquidate_vault: {
_118
debt_coin: Coin
_118
liquidatee_account_id: string
_118
liquidator_account_id: string
_118
position_type: VaultPositionType
_118
request_vault: VaultBaseForAddr
_118
}
_118
}
_118
| {
_118
swap_exact_in: {
_118
account_id: string
_118
coin_in: ActionCoin
_118
denom_out: string
_118
slippage: Decimal
_118
}
_118
}
_118
| {
_118
update_coin_balance: {
_118
account_id: string
_118
previous_balance: Coin
_118
}
_118
}
_118
| {
_118
provide_liquidity: {
_118
account_id: string
_118
coins_in: ActionCoin[]
_118
lp_token_out: string
_118
minimum_receive: Uint128
_118
}
_118
}
_118
| {
_118
withdraw_liquidity: {
_118
account_id: string
_118
lp_token: ActionCoin
_118
}
_118
}
_118
| {
_118
assert_one_vault_position_only: {
_118
account_id: string
_118
}
_118
}
_118
| {
_118
refund_all_coin_balances: {
_118
account_id: string
_118
}
_118
}

Health

types.ts
Copy

_8
interface Health {
_8
liquidation_health_factor?: Decimal | null
_8
liquidation_threshold_adjusted_collateral: Uint128
_8
max_ltv_adjusted_collateral: Uint128
_8
max_ltv_health_factor?: Decimal | null
_8
total_collateral_value: Uint128
_8
total_debt_value: Uint128
_8
}

QueryMsg

config

Rover contract-level config.

types.ts
Copy

_4
type QueryMsg =
_4
{
_4
config: {}
_4
}

vaults_info

Configs & deposit caps on vaults.

types.ts
Copy

_7
type QueryMsg =
_7
{
_7
vaults_info: {
_7
limit?: number | null
_7
start_after?: VaultBaseForString | null
_7
}
_7
}

allowed_coins

Whitelisted coins.

types.ts
Copy

_7
type QueryMsg =
_7
{
_7
allowed_coins: {
_7
limit?: number | null
_7
start_after?: string | null
_7
}
_7
}

positions

All positions represented by token with value.

types.ts
Copy

_6
type QueryMsg =
_6
{
_6
positions: {
_6
account_id: string
_6
}
_6
}

health

The health of the account represented by token.

types.ts
Copy

_6
type QueryMsg =
_6
{
_6
health: {
_6
account_id: string
_6
}
_6
}

all_coin_balances

Enumerate coin balances for all token positions; start_after accepts (account_id, denom).

types.ts
Copy

_7
type QueryMsg =
_7
{
_7
all_coin_balances: {
_7
limit?: number | null
_7
start_after?: [string, string] | null
_7
}
_7
}

all_debt_shares

Enumerate debt shares for all token positions; start_after accepts (account_id, denom).

types.ts
Copy

_7
type QueryMsg =
_7
{
_7
all_debt_shares: {
_7
limit?: number | null
_7
start_after?: [string, string] | null
_7
}
_7
}

total_debt_shares

Total debt shares issued for Coin.

types.ts
Copy

_4
type QueryMsg =
_4
{
_4
total_debt_shares: string
_4
}

all_total_debt_shares

Enumerate total debt shares for all supported coins; start_after accepts denom string.

types.ts
Copy

_7
type QueryMsg =
_7
{
_7
all_total_debt_shares: {
_7
limit?: number | null
_7
start_after?: string | null
_7
}
_7
}

all_vault_positions

Enumerate all vault positions; start_after accepts (account_id, addr).

types.ts
Copy

_7
type QueryMsg =
_7
{
_7
all_vault_positions: {
_7
limit?: number | null
_7
start_after?: [string, string] | null
_7
}
_7
}

total_vault_coin_balance

Get total vault coin balance in Rover for vault.

types.ts
Copy

_6
type QueryMsg =
_6
{
_6
total_vault_coin_balance: {
_6
vault: VaultBaseForString
_6
}
_6
}

all_total_vault_coin_balances

Enumerate all total vault coin balances; start_after accepts vault addr.

types.ts
Copy

_7
type QueryMsg =
_7
{
_7
all_total_vault_coin_balances: {
_7
limit?: number | null
_7
start_after?: VaultBaseForString | null
_7
}
_7
}

estimate_provide_liquidity

Estimate how many LP tokens received in exchange for coins provided for liquidity.

types.ts
Copy

_7
type QueryMsg =
_7
{
_7
estimate_provide_liquidity: {
_7
coins_in: Coin[]
_7
lp_token_out: string
_7
}
_7
}

estimate_withdraw_liquidity

Estimate coins withdrawn if exchanged for LP tokens.

types.ts
Copy

_6
type QueryMsg =
_6
{
_6
estimate_withdraw_liquidity: {
_6
lp_token: Coin
_6
}
_6
}