Skip to main content
logo

credit-manager

InstantiateMsg

types.ts
Copy
type Decimal = string
type Uint128 = string
type OracleBaseForString = string
type RedBankBaseForString = string
type SwapperBaseForString = string
type ZapperBaseForString = string

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

VaultInstantiateConfig

types.ts
Copy
interface VaultInstantiateConfig {
config: VaultConfig
vault: VaultBaseForString
}

VaultConfig

types.ts
Copy
interface VaultConfig {
deposit_cap: Coin
liquidation_threshold: Decimal
max_ltv: Decimal
whitelisted: boolean
}

Coin

types.ts
Copy
interface VaultConfig {
deposit_cap: Coin
liquidation_threshold: Decimal
max_ltv: Decimal
whitelisted: boolean
}

VaultBaseForString

types.ts
Copy
interface VaultBaseForString {
address: string
}

ExecuteMsg

create_credit_account

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

types.ts
Copy
type ExecuteMsg =
{
create_credit_account: {}
}

update_credit_account

Update user's position on their credit account.

types.ts
Copy
type ExecuteMsg =
{
update_credit_account: {
account_id: string
actions: Action[]
}
}

Action

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

ActionCoin

types.ts
Copy
interface ActionCoin {
amount: ActionAmount
denom: string
}

ActionAmount

types.ts
Copy
type ActionAmount =
| 'account_balance'
| {
exact: Uint128
}

VaultPositionType

types.ts
Copy
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
type ExecuteMsg =
{
update_config: {
updates: ConfigUpdates
}
}

ConfigUpdates

Used when you want to update fields on Instantiate config.

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

update_owner

Manages owner role state.

types.ts
Copy
type ExecuteMsg =
{
update_owner: OwnerUpdate
}

OwnerUpdate

types.ts
Copy
type OwnerUpdate =
| {
propose_new_owner: {
proposed: string
}
}
| 'clear_proposed'
| 'accept_proposed'
| 'abolish_owner_role'

update_nft_config

Update nft contract config.

types.ts
Copy
type ExecuteMsg =
{
update_nft_config: {
updates: NftConfigUpdates
}
}

NftConfigUpdates

types.ts
Copy
interface NftConfigUpdates {
max_value_for_burn?: Uint128 | null
proposed_new_minter?: string | null
}

callback

Internal actions only callable by the contract itself.

types.ts
Copy
type ExecuteMsg =
{
callback: CallbackMsg
}

CallbackMsg

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

types.ts
Copy
type Addr = string

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

Health

types.ts
Copy
interface Health {
liquidation_health_factor?: Decimal | null
liquidation_threshold_adjusted_collateral: Uint128
max_ltv_adjusted_collateral: Uint128
max_ltv_health_factor?: Decimal | null
total_collateral_value: Uint128
total_debt_value: Uint128
}

QueryMsg

config

Rover contract-level config.

types.ts
Copy
type QueryMsg =
{
config: {}
}

vaults_info

Configs & deposit caps on vaults.

types.ts
Copy
type QueryMsg =
{
vaults_info: {
limit?: number | null
start_after?: VaultBaseForString | null
}
}

allowed_coins

Whitelisted coins.

types.ts
Copy
type QueryMsg =
{
allowed_coins: {
limit?: number | null
start_after?: string | null
}
}

positions

All positions represented by token with value.

types.ts
Copy
type QueryMsg =
{
positions: {
account_id: string
}
}

health

The health of the account represented by token.

types.ts
Copy
type QueryMsg =
{
health: {
account_id: string
}
}

all_coin_balances

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

types.ts
Copy
type QueryMsg =
{
all_coin_balances: {
limit?: number | null
start_after?: [string, string] | null
}
}

all_debt_shares

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

types.ts
Copy
type QueryMsg =
{
all_debt_shares: {
limit?: number | null
start_after?: [string, string] | null
}
}

total_debt_shares

Total debt shares issued for Coin.

types.ts
Copy
type QueryMsg =
{
total_debt_shares: string
}

all_total_debt_shares

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

types.ts
Copy
type QueryMsg =
{
all_total_debt_shares: {
limit?: number | null
start_after?: string | null
}
}

all_vault_positions

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

types.ts
Copy
type QueryMsg =
{
all_vault_positions: {
limit?: number | null
start_after?: [string, string] | null
}
}

total_vault_coin_balance

Get total vault coin balance in Rover for vault.

types.ts
Copy
type QueryMsg =
{
total_vault_coin_balance: {
vault: VaultBaseForString
}
}

all_total_vault_coin_balances

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

types.ts
Copy
type QueryMsg =
{
all_total_vault_coin_balances: {
limit?: number | null
start_after?: VaultBaseForString | null
}
}

estimate_provide_liquidity

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

types.ts
Copy
type QueryMsg =
{
estimate_provide_liquidity: {
coins_in: Coin[]
lp_token_out: string
}
}

estimate_withdraw_liquidity

Estimate coins withdrawn if exchanged for LP tokens.

types.ts
Copy
type QueryMsg =
{
estimate_withdraw_liquidity: {
lp_token: Coin
}
}