Unda
  • Official Unda Documentation
  • General
  • Why KUSD?
  • KUSD subtypes
  • Arbitrage and Liquidation
  • Smart Contract
  • Unda Trader NFTs
Powered by GitBook
On this page
  • Read only methods
  • Writable Methods

Smart Contract

The KUSD smart contract can be found at 1HUwtrx1jFFmfk3jsosUK4588RsX2uLETC. If you don't want to use the Unda frontend you can directly interact with the contract itself through a block explorer.

Read only methods

get_koin_vault: get the balances of a vault. The return object contains kusd_koin (debt) and koin (collateral).

Arguments
Description

owner

the address of the vault

get_koin_vaults: get a list of all addresses with an active vault. Leave all arguments blank to retrieve all vaults.

Arguments
Description

start (optional)

starting address in your list

limit (optional)

maximum amount of vaults you want to retrieve

direction (optional)

ascending or descending

get_koin_protocol_balances: get a list of the balances of all active vaults. Leave all arguments blank to retrieve balances from all vaults.

Arguments
Description

start (optional)

starting address in your list

limit (optional)

maximum amount of vaults you want to retrieve

direction (optional)

ascending or descending

usd_price: calculate the usd value of a vault.

Arguments
Description

kusd_koin (optional, leave empty)

kusd debt of a vault

koin

amount of collateral (koin tokens) in the vault

total_supply: total amount of all KUSD in circulation

balance_of: amount of KUSD debt of a vault

Arguments
Description

owner

the address of the vault

Writable Methods

deposit: deposit Koin tokens as collateral into your vault

Arguments
Description

account

address of your vault (the address of your connected Kondor wallet)

amount

amount of tokens you want to deposit

withdraw: withdraw Koin tokens from your vault

Arguments
Description

account

address of your vault (the address of your connected Kondor wallet)

amount

amount of tokens you want to withdraw

kusd_mint: mint KUSD tokens into your wallet

Arguments
Description

account

address of your vault (the address of your connected Kondor wallet)

amount

amount of tokens you want to mint

repay: repay your KUSD debt and burn the tokens

Arguments
Description

account

address of your vault (the address of your connected Kondor wallet)

amount

amount of tokens you want to repay

liquidate: liquidate a vault below the 150% collateral threshold and receive its collateral (Koin) and debt (KUSD).

Arguments
Description

account

address of your vault (the address of your connected Kondor wallet)

vault

address of the vault you want to liquidate

PreviousArbitrage and LiquidationNextUnda Trader NFTs

Last updated 2 months ago