Logo

indigo

UnofficialPreliminary, reverse-engineered version published by the tx3 team for testing and exploration. It is not endorsed by the original protocol authors. Do not use in mainnet. • v2.0.0

About this Protocol

Synthetic assets (iAssets) on Cardano via CDPs, Stability Pools, and INDY staking

Parties

The participants involved in this protocol's transactions.

cdpscriptCDP Spend validator holding CDP UTxOs (user collateral + CDP NFT).
cdpuseraddrPer-user CDP output address: CdpScript payment + user's staking credential.
collectorscriptCollector validator that accumulates protocol fees.
stabilitypoolscriptStability Pool validator holding iAsset deposits and pool state.
userThe end user interacting with the Indigo protocol.
stakingscriptINDY Staking validator holding staked INDY tokens and reward state.
cdpcreatorscriptCDP Creator validator that holds the CDP_CREATOR auth tokens.

Environment

Configuration values required to execute this protocol's transactions.

cdp_creator_nameCDP creator auth token asset name (hex of "CDP_CREATOR")./$defs/Bytes
cdp_creator_policy_idMinting policy for the CDP_CREATOR auth token./$defs/Bytes
cdp_creator_refReference UTxO carrying the CDP creator validator script./$defs/UtxoRef
cdp_nft_mint_refReference UTxO carrying the CDP NFT minting policy script./$defs/UtxoRef
cdp_nft_nameCDP NFT asset name (hex of "CDP")./$defs/Bytes
cdp_nft_policy_idMinting policy for the per-CDP authentication NFT./$defs/Bytes
cdp_spend_refReference UTxO carrying the CDP spend validator script./$defs/UtxoRef
collector_refReference UTxO carrying the Collector validator script./$defs/UtxoRef
iasset_mint_refReference UTxO carrying the iAsset minting policy script./$defs/UtxoRef
iasset_policy_idMinting policy for synthetic iAssets (iUSD, iBTC, iETH, iSOL, ...)./$defs/Bytes
indy_nameINDY token asset name (hex of "INDY")./$defs/Bytes
indy_policy_idMinting policy for the INDY governance/staking token./$defs/Bytes
stability_pool_refReference UTxO carrying the Stability Pool validator script./$defs/UtxoRef
staking_manager_nft_nameStaking manager NFT asset name (hex of "STAKING_MANAGER_NFT")./$defs/Bytes
staking_manager_nft_policy_idMinting policy for the singleton STAKING_MANAGER_NFT./$defs/Bytes
staking_position_mint_refReference UTxO carrying the STAKING_POSITION minting policy script./$defs/UtxoRef
staking_position_nameStaking position NFT asset name (hex of "STAKING_POSITION")./$defs/Bytes
staking_position_policy_idMinting policy for STAKING_POSITION NFTs (minted/burned per position)./$defs/Bytes
staking_refReference UTxO carrying the INDY Staking validator script./$defs/UtxoRef

Transactions

The transactions defined in this protocol, with their parameters, inputs, and outputs.

adjust_cdp_burn

Adjust a CDP by burning iAssets to repay debt, optionally withdrawing collateral.

Diagram

adjust_cdp_burnaccumulatorburn_amountcdp_manager_utxocdp_utxocollateral_changecollector_utxoiasset_config_utxoiasset_namenew_collateralnew_minted_totaloracle_utxoowner_pkhstaking_utxotimestamp_ms user cdpuseraddr collectorscript stakingscript user source cdp_input staking_input collector_input cdp_output output 3 output 2 output 4

Parameters

accumulatorIntCurrent interest accumulator value to snapshot on the CDP.
burn_amountIntiAsset amount to burn (positive value; sent as negative on-chain).
cdp_manager_utxoUtxoRefReference UTxO with the CDP manager configuration datum.
cdp_utxoUtxoRefExisting CDP UTxO to adjust.
collateral_changeIntSigned collateral change in lovelace (negative withdraws to the user).
collector_utxoUtxoRefCurrent Collector UTxO to consume for continuity.
iasset_config_utxoUtxoRefReference UTxO with the iAsset configuration datum.
iasset_nameBytesiAsset asset name held by this CDP.
new_collateralIntNew collateral (lovelace) to record on the CDP datum.
new_minted_totalIntNew total minted iAsset amount to record on the CDP datum.
oracle_utxoUtxoRefOracle reference UTxO providing the iAsset price feed.
owner_pkhBytesOwner payment public key hash (28 bytes).
staking_utxoUtxoRefCompanion Staking UTxO required by the on-chain validator.
timestamp_msIntPOSIX time (ms) used by the validator's time check.

Inputs

cdp_inputscript
staking_inputscript
collector_inputscript
sourceuserwallet

Outputs

cdpuseraddryesno
stakingscriptyesno
collectorscriptyesno
usernono

create_sp_account

Submit a Stability Pool account creation request, depositing iAssets for batching.

Diagram

create_sp_accountcollector_utxodeposit_amountiasset_nameowner_pkhsp_snapshot_dsp_snapshot_epochsp_snapshot_psp_snapshot_ssp_snapshot_scalesp_utxo user collectorscript stabilitypoolscript user source sp_input collector_input output 2 sp_output output 3

Parameters

collector_utxoUtxoRefCurrent Collector UTxO to consume for continuity.
deposit_amountIntiAsset amount to deposit into the Stability Pool.
iasset_nameBytesiAsset asset name being deposited into the pool.
owner_pkhBytesOwner payment public key hash (28 bytes).
sp_snapshot_dIntStability pool snapshot D value to record on the updated pool datum.
sp_snapshot_epochIntStability pool snapshot epoch to record on the updated pool datum.
sp_snapshot_pIntStability pool snapshot P value to record on the updated pool datum.
sp_snapshot_sIntStability pool snapshot S value to record on the updated pool datum.
sp_snapshot_scaleIntStability pool snapshot scale to record on the updated pool datum.
sp_utxoUtxoRefCurrent Stability Pool UTxO to consume for continuity.

Inputs

sp_inputscript
collector_inputscript
sourceuserwallet

Outputs

stabilitypoolscriptyesno
collectorscriptyesno
usernono

adjust_staking

Add or remove INDY from an existing staking position.

Diagram

adjust_stakingadjust_amountindy_asset_nameindy_policy_idowner_pkhposition_utxo user stakingscript user source position_input output 1 output 2

Parameters

adjust_amountIntSigned INDY amount delta (positive adds stake, negative removes).
indy_asset_nameBytesINDY asset name (passed explicitly to override env in tests).
indy_policy_idBytesINDY minting policy ID (passed explicitly to override env in tests).
owner_pkhBytesOwner payment public key hash (28 bytes).
position_utxoUtxoRefExisting Staking Position UTxO to adjust.

Inputs

position_inputscript
sourceuserwallet

Outputs

stakingscriptyesno
usernono

create_cdp

Open a new CDP: deposit ADA collateral and mint a CDP NFT plus iAsset debt.

Diagram

create_cdpcdp_manager_utxocollateral_lovelacecollector_utxocreator_utxoiasset_config_utxoiasset_nameinterest_accumulatormint_amountoracle_utxoowner_pkhtimestamp_ms user cdpcreatorscript cdpuseraddr collectorscript user source collector_input creator_input output 2 cdp_output output 3 output 4

Parameters

cdp_manager_utxoUtxoRefReference UTxO with the CDP manager configuration datum.
collateral_lovelaceIntADA collateral to lock in the CDP, in lovelace.
collector_utxoUtxoRefCurrent Collector UTxO to consume for continuity.
creator_utxoUtxoRefCurrent CDP Creator UTxO carrying the CDP_CREATOR auth token.
iasset_config_utxoUtxoRefReference UTxO with the iAsset configuration datum.
iasset_nameBytesiAsset asset name to mint (e.g. hex of "iUSD").
interest_accumulatorIntCurrent global interest accumulator value to snapshot on the new CDP.
mint_amountIntAmount of iAsset tokens to mint against the deposited collateral.
oracle_utxoUtxoRefOracle reference UTxO providing the iAsset price feed.
owner_pkhBytesOwner payment public key hash (28 bytes).
timestamp_msIntPOSIX time (ms) used by the validator's time check.

Inputs

collector_inputscript
creator_inputscript
sourceuserwallet

Outputs

cdpuseraddryesno
cdpcreatorscriptyesno
collectorscriptyesno
usernono

adjust_cdp_mint

Adjust a CDP by minting additional iAssets, increasing the CDP's debt.

Diagram

adjust_cdp_mintaccumulatoradditional_mintcdp_manager_utxocdp_utxocollector_utxoiasset_config_utxoiasset_namenew_collateralnew_minted_totaloracle_utxoowner_pkhstaking_utxotimestamp_ms user cdpuseraddr collectorscript stakingscript user source cdp_input staking_input collector_input cdp_output output 3 output 2 output 4

Parameters

accumulatorIntCurrent interest accumulator value to snapshot on the CDP.
additional_mintIntAdditional iAsset amount to mint on top of the current debt.
cdp_manager_utxoUtxoRefReference UTxO with the CDP manager configuration datum.
cdp_utxoUtxoRefExisting CDP UTxO to adjust.
collector_utxoUtxoRefCurrent Collector UTxO to consume for continuity.
iasset_config_utxoUtxoRefReference UTxO with the iAsset configuration datum.
iasset_nameBytesiAsset asset name held by this CDP.
new_collateralIntNew collateral (lovelace) to record on the CDP datum.
new_minted_totalIntNew total minted iAsset amount to record on the CDP datum.
oracle_utxoUtxoRefOracle reference UTxO providing the iAsset price feed.
owner_pkhBytesOwner payment public key hash (28 bytes).
staking_utxoUtxoRefCompanion Staking UTxO required by the on-chain validator.
timestamp_msIntPOSIX time (ms) used by the validator's time check.

Inputs

cdp_inputscript
staking_inputscript
collector_inputscript
sourceuserwallet

Outputs

cdpuseraddryesno
stakingscriptyesno
collectorscriptyesno
usernono

adjust_sp_account

Submit a Stability Pool account adjustment request to change the deposit size.

Diagram

adjust_sp_accountacc_snapshot_dacc_snapshot_epochacc_snapshot_pacc_snapshot_sacc_snapshot_scaleaccount_utxocollector_utxodeposit_changeiasset_nameoutput_addrowner_pkh user collectorscript stabilitypoolscript user source account_input collector_input output 2 account_output output 3

Parameters

acc_snapshot_dIntAccount snapshot D value to preserve on the updated account datum.
acc_snapshot_epochIntAccount snapshot epoch to preserve on the updated account datum.
acc_snapshot_pIntAccount snapshot P value to preserve on the updated account datum.
acc_snapshot_sIntAccount snapshot S value to preserve on the updated account datum.
acc_snapshot_scaleIntAccount snapshot scale to preserve on the updated account datum.
account_utxoUtxoRefExisting Account UTxO to attach the adjustment request to.
collector_utxoUtxoRefCurrent Collector UTxO to consume for continuity.
deposit_changeIntSigned iAsset amount delta requested (positive deposits, negative withdraws).
iasset_nameBytesiAsset asset name held by this SP account.
output_addrBytesRecipient address (raw bytes) for any funds returned by the batcher.
owner_pkhBytesOwner payment public key hash (28 bytes).

Inputs

account_inputscript
collector_inputscript
sourceuserwallet

Outputs

stabilitypoolscriptyesno
collectorscriptyesno
usernono

create_staking

Open a new INDY staking position and mint its authenticating STAKING_POSITION NFT.

Diagram

create_stakingcurrent_snapshot_adaindy_amountmanager_utxoold_total_stakeowner_pkh user stakingscript user source manager_input manager_output position_output change_output

Parameters

current_snapshot_adaIntCurrent managerSnapshot.snapshotAda value used to seed the position snapshot.
indy_amountIntINDY token amount to stake into the new position.
manager_utxoUtxoRefCurrent Staking Manager UTxO whose totalStake will be updated.
old_total_stakeIntCurrent StakingManagerContent.totalStake value, read off-chain.
owner_pkhBytesOwner payment public key hash (28 bytes).

Inputs

manager_inputscript
sourceuserwallet

Outputs

stakingscriptyesno
stakingscriptyesno
usernono

unstake

Close a staking position entirely and withdraw all INDY plus accumulated ADA rewards.

Diagram

unstakeowner_pkhposition_utxo user user source position_input output 1

Parameters

owner_pkhBytesOwner payment public key hash (28 bytes).
position_utxoUtxoRefStaking Position UTxO to consume and close.

Inputs

position_inputscript
sourceuserwallet

Outputs

usernono

close_cdp

Close a CDP: burn all outstanding iAsset debt and the CDP NFT, recover collateral.

Diagram

close_cdpburn_amountcdp_manager_utxocdp_utxocollector_utxoiasset_config_utxoiasset_nameoracle_utxoowner_pkhpool_iassetsp_snapshot_dsp_snapshot_epochsp_snapshot_psp_snapshot_ssp_snapshot_scalestability_pool_utxostaking_utxotimestamp_ms user collectorscript stabilitypoolscript stakingscript user source cdp_input collector_input sp_input staking_input output 2 sp_output output 1 output 4

Parameters

burn_amountIntOutstanding iAsset debt to burn to fully close the CDP.
cdp_manager_utxoUtxoRefReference UTxO with the CDP manager configuration datum.
cdp_utxoUtxoRefCDP UTxO to close.
collector_utxoUtxoRefCurrent Collector UTxO to consume for continuity.
iasset_config_utxoUtxoRefReference UTxO with the iAsset configuration datum.
iasset_nameBytesiAsset asset name held by this CDP.
oracle_utxoUtxoRefOracle reference UTxO providing the iAsset price feed.
owner_pkhBytesOwner payment public key hash (28 bytes).
pool_iassetBytesiAsset asset name carried by the Stability Pool state.
sp_snapshot_dIntStability pool snapshot D value to record on the updated pool datum.
sp_snapshot_epochIntStability pool snapshot epoch to record on the updated pool datum.
sp_snapshot_pIntStability pool snapshot P value to record on the updated pool datum.
sp_snapshot_sIntStability pool snapshot S value to record on the updated pool datum.
sp_snapshot_scaleIntStability pool snapshot scale to record on the updated pool datum.
stability_pool_utxoUtxoRefCurrent Stability Pool UTxO to consume for continuity.
staking_utxoUtxoRefCurrent Staking UTxO to consume for continuity.
timestamp_msIntPOSIX time (ms) used by the validator's time check.

Inputs

cdp_inputscript
collector_inputscript
sp_inputscript
staking_inputscript
sourceuserwallet

Outputs

stakingscriptnono
collectorscriptyesno
stabilitypoolscriptyesno
usernono

close_sp_account

Submit a Stability Pool account close request for batcher processing.

Diagram

close_sp_accountacc_snapshot_dacc_snapshot_epochacc_snapshot_pacc_snapshot_sacc_snapshot_scaleaccount_utxocollector_utxoiasset_nameoutput_addrowner_pkh user collectorscript stabilitypoolscript user source account_input collector_input output 2 account_output output 3

Parameters

acc_snapshot_dIntAccount snapshot D value to preserve on the updated account datum.
acc_snapshot_epochIntAccount snapshot epoch to preserve on the updated account datum.
acc_snapshot_pIntAccount snapshot P value to preserve on the updated account datum.
acc_snapshot_sIntAccount snapshot S value to preserve on the updated account datum.
acc_snapshot_scaleIntAccount snapshot scale to preserve on the updated account datum.
account_utxoUtxoRefExisting Account UTxO to attach the close request to.
collector_utxoUtxoRefCurrent Collector UTxO to consume for continuity.
iasset_nameBytesiAsset asset name held by this SP account.
output_addrBytesRecipient address (raw bytes) where the batcher will return the deposit.
owner_pkhBytesOwner payment public key hash (28 bytes).

Inputs

account_inputscript
collector_inputscript
sourceuserwallet

Outputs

stabilitypoolscriptyesno
collectorscriptyesno
usernono

Profiles

Pre-configured sets of environment and party values for different deployment targets.

mainnet
cdpscriptaddr1wyyqtkz5rken7jzptp076np606r79lmsrqjrqw8sdn4kvrqewrkdgparty
cdpcreatorscriptaddr1wyy3pau5vxn37arc9hx52rezkrpv4sc6kqmtvmyjry64mxgefqrn0party
stabilitypoolscriptaddr1wxywq2vsrptrm5gvfpsdnu6wmft0mdmlxqk6pcucqcs9xhqxh5ct9party
stakingscriptaddr1wx3r0yl49yteuzwwlv7r0lr2uzq7p6v7nxl9ek645qy5rfgwwzxw6party
collectorscriptaddr1wyr4927ktgxfswlmrjwr3qxvvvkqnxar4ke0uvr6ld9mm8qrzhplwparty
cdp_creator_name4344505f43524541544f52env
cdp_creator_policy_id735b37149eb0c2a5fb590bd60e39fe90ae3a96b6065b05d7aca99ebbenv
cdp_creator_refb30b10cee01675b02a269c66fa9a420f4766a71b0ebbdd87c6eefbe22b48c59b#0env
cdp_nft_mint_refc0a4c2ad340da8686c723a21b0a029aefee650fcaf5ef964742f499efb7c21f8#0env
cdp_nft_name434450env
cdp_nft_policy_id708f5e6d597fc038d09a738d7be32edd6ea779d6feb32a53668d9050env
cdp_spend_ref00430c1c2d2c57974069db6597184c8129a934ef0de6c701178bda822fd25a8a#0env
collector_reff0b4faf71b4ea83fa1a41eadd97d060863576adfc026b11e1fff106ca79e9956#0env
iasset_mint_ref99329591f444f68ed4a33ed664c146fbf278cf9202067974cfa1a26d09a34107#0env
iasset_policy_idf66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b69880env
indy_name494e4459env
indy_policy_id533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0env
stability_pool_ref3356e6602d13e4fcc6563ca2c664b054d528cfe899f32258935d3e886f0d52a4#0env
staking_manager_nft_name5354414b494e475f4d414e414745525f4e4654env
staking_manager_nft_policy_id24b458412c2a7f9acb9c53c7ec4325b36806912ed56d2f91bfcf4d26env
staking_position_mint_ref71dc6b81e8832192bb28ecbc6a4f71b6e0dc0407c708f169020804371450b4e7#0env
staking_position_name5354414b494e475f504f534954494f4eenv
staking_position_policy_idfd0d72fafee1d230a74c31ac503a192abd5b71888ae3f94128c1e634env
staking_refb54cb6d920a3fe7cf59a562d3184688ad6a7cbd11b1e9dfdf13f8804541e11a1#0env
Back to all Protocols