Balanced crosschain deployment

Balanced cross chain deployment

The launch of balanced first crosschain integrations is close to ready. I’ve prepared the launch steps which involves a few votes from the community. This also includes a few other choices that could get feedback in this post.
Main onces are rate limiting in dex, global debt ceiling for bnUSD and bnUSD cap for archway.

Another thing open for discussion is if we should add some bribes to sARCH/bnUSD pool.

Note: This launch does not add sArch to loans only the DEX while we wait for sArch to stablize in CEX. All steps are not complete and might change slighlty for mainnet.

Step 1: Prepare new contract names in governance.

Description:

Add all new contracts names needed by our cross chain efforts. The xCall contract which is already live. We also add two new contracts which for now are placeholders to simplify deployment process. These contracts will be deployed later and then given to governance.

Timeline:

This is the first step and will have to be finished before the rest of deployment can continue.

Actions:

[
    {
        "address": "cx44250a12074799e26fdeee75648ae47e2cc84219",
        "method": "addExternalContract",
        "parameters": [
            {
                "type": "String",
                "value": "Native XCall"
            },
            {
                "type": "Address",
                "value": "cxa07f426062a1384bdd762afa6a87d123fbc81c75"
            }
        ]
    },
    {
        "address": "cx44250a12074799e26fdeee75648ae47e2cc84219",
        "method": "addExternalContract",
        "parameters": [
            {
                "type": "String",
                "value": "Balanced Asset Manager"
            },
            {
                "type": "Address",
                "value": ""
            }
        ]
    },
    {
        "address": "cx44250a12074799e26fdeee75648ae47e2cc84219",
        "method": "addExternalContract",
        "parameters": [
            {
                "type": "String",
                "value": "Balanced XCall Manager"
            },
            {
                "type": "Address",
                "value": ""
            }
        ]
    }
]

Step 2: Deploy new contracts

Description:

A few new contracts will be added to the balanced eco system. The balanced AssetManager, xCall Manager on ICON and the spoke AssetManager and bnUSD on archway. Since these are new contracts they will be deployed and configured before transferring ownership to governance.

Timeline:

Can be done as soon as step one has passed and executed.

Actions

  • Deploy Asset Manager to ICON
  • Deploy Asset Manager to Archway
  • Add the archway Asset Manager to ICON contract
  • Add the sARCH token to ICON
  • Deploy xCallManager to ICON
  • Set xCall protocols for archway to default
  • Deploy bnUSD on archway
  • Give ownership to governance
  • Create the pool sARCH/bnUSD

Step 3: Upgrade the daofund

Description:

To allow balanced to help pay for some xCall fees to make the UX better balanced will initially sponsor some fees when sending xCalls. This also requires us to unstake some sICX from our fund.

Timeline:

Can be done as soon as step one has passed and executed.

Actions

[
    {
        "address": "cx44250a12074799e26fdeee75648ae47e2cc84219",
        "method": "deployTo",
        "parameters": [
            {
                "type": "Address",
                "value": "cx835b300dcfe01f0bdb794e134a0c5628384f4367"
            },
            {
                "type": "bytes",
                "value": ""
            },
            {
                "type": "String",
                "value": "[{\"type\":\"String\",\"value\":\"cx44250a12074799e26fdeee75648ae47e2cc84219\"}]"
            }
        ]
    },

    {
        "address": "cx835b300dcfe01f0bdb794e134a0c5628384f4367",
        "method": "disburse",
        "parameters": [
            {
                "type": "Address",
                "value": "cx2609b924e33ef00b648a409245c7ea394c467824"
            },
            {
                "type": "Address",
                "value": "cxa0af3165c08318e988cb30993b3048335b94af6c"
            },
            {
                "type": "int",
                "value": "10000000000000000000000"
            },
            {
                "type": "bytes",
                "value": "7B226D6574686F64223A225F737761705F696378222C22706172616D73223A7B7D7D"
            }
        ]
    },
    {
        "address": "cx835b300dcfe01f0bdb794e134a0c5628384f4367",
        "method": "setXCallFeePermission",
        "parameters": [
            {
                "type": "Address",
                "value": "cx88fd7df7ddff82f7cc735c871dc519838cb235bb"
            },
            {
                "type": "String",
                "value": "archway-1"
            },
            {
                "type": "boolean",
                "value": true
            }
        ]
    },
    {
        "address": "cx835b300dcfe01f0bdb794e134a0c5628384f4367",
        "method": "setXCallFeePermission",
        "parameters": [
            {
                "type": "Address",
                "value": "cx21e94c08c03daee80c25d8ee3ea22a20786ec231"
            },
            {
                "type": "String",
                "value": "archway-1"
            },
            {
                "type": "boolean",
                "value": true
            }
        ]
    },
    {
        "address": "cx835b300dcfe01f0bdb794e134a0c5628384f4367",
        "method": "setXCallFeePermission",
        "parameters": [
            {
                "type": "Address",
                "value": "<AssetManager>"
            },
            {
                "type": "String",
                "value": "archway-1"
            },
            {
                "type": "boolean",
                "value": true
            }
        ]
    },
]

Step 4: Upgrade Balanced router

Description:

To allow user to trade directly via xCall we have extended the functionality of the router to route swaps via xCall. After this vote is done trading will be fully enabled. Thus i also propose we add the sArch pool as votable and add 5 Weeks of 3k Baln bribes.

Timeline:

Should preferably be executed after steps 1-4

Actions

[
    {
        "address": "cx44250a12074799e26fdeee75648ae47e2cc84219",
        "method": "deployTo",
        "parameters": [
            {
                "type": "Address",
                "value": "cx21e94c08c03daee80c25d8ee3ea22a20786ec231"
            },
            {
                "type": "bytes",
                "value": ""
            },
            {
                "type": "String",
                "value": "[{\"type\":\"String\",\"value\":\"cx44250a12074799e26fdeee75648ae47e2cc84219\"}]"
            }
        ]
    },
    {
        "address": "cx8dc674ce709c518bf1a6058a2722a59f94b6fb7f",
        "method": "addDataSource",
        "parameters": [
        {
            "type": "int",
            "value": "X"
        },
        {
            "type": "String",
            "value": "sARCH/bnUSD"
        }
        ]
    },
    {
        "address": "cx10d59e8103ab44635190bd4139dbfd682fa2d07e",
        "method": "createDataSource",
        "parameters": [
        {
            "type": "String",
            "value": "sARCH/bnUSD"
        },
        {
            "type": "Address",
            "value": "cx8dc674ce709c518bf1a6058a2722a59f94b6fb7f"
        },
        {
            "type": "int",
            "value": "1"
        }
        ]
    }
]

Step 5: Upgrade bnUSD to as crosschain token

Description:

Upgrade the Balanced dollar to be able to communicate with bnusd contracts on other chains. For this we also want to set limits on the exposure for each chain. For archway we propose to start with a $300k initially. We are also introducing a global debt ceiling which we propose to keep at $5M.

Timeline:

Can be done as soon as step one has passed and executed.

Actions

[
    {
        "address": "cx44250a12074799e26fdeee75648ae47e2cc84219",
        "method": "deployTo",
        "parameters": [
            {
                "type": "Address",
                "value": "cx88fd7df7ddff82f7cc735c871dc519838cb235bb"
            },
            {
                "type": "bytes",
                "value": ""
            },
            {
                "type": "String",
                "value": "[{\"type\":\"String\",\"value\":\"cx44250a12074799e26fdeee75648ae47e2cc84219\"}]"
            }
        ]
    },
    {
        "address": "cx88fd7df7ddff82f7cc735c871dc519838cb235bb",
        "method": "addChain",
        "parameters": [
            {
                "type": "String",
                "value": "archway-1/...."
            },
            {
                "type": "int",
                "value": "300000000000000000000000"
            }
        ]
    }
      {
        "address": "cx88fd7df7ddff82f7cc735c871dc519838cb235bb",
        "method": "setDebtCeiling",
        "parameters": [
            {
                "type": "int",
                "value": "5000000000000000000000000"
            }
        ]
    }
]

Step 6: Upgrade Balanced rewards

Description:

To allow cross chain users to be able to earn rewards. While this for now mainly applies to Loans this upgrade is needed before any of our datasource contracts are updated (Dex, Loans, StakedLP).

Timeline:

Should preferably be executed after steps 1-4

Actions

[
    {
        "address": "cx44250a12074799e26fdeee75648ae47e2cc84219",
        "method": "deployTo",
        "parameters": [
            {
                "type": "Address",
                "value": "cx10d59e8103ab44635190bd4139dbfd682fa2d07e"
            },
            {
                "type": "bytes",
                "value": ""
            },
            {
                "type": "String",
                "value": "[{\"type\":\"String\",\"value\":\"cx44250a12074799e26fdeee75648ae47e2cc84219\"}]"
            }
        ]
    }
]

Step 7: Upgrade Balanced dex

Description:

To allow users to supply LP directly from their archway address without a bridging transaction first we need to update the Dex contract. This will also apply the rate limit functionality that we did for Loans and stability fund.
I propose the same limits: 15% per token per day.
However for this upgrade we added some additional features where it has to be enabled for each token we want to protect and also a minimum limits for when the floor should not apply.
The tokens i suggest we protect is:

  • ICX
  • sICX
  • bnUSD
  • sARCH
  • BALN

Timeline:

Should preferably be executed after steps 1-4

Actions

[
    {
        "address": "cx44250a12074799e26fdeee75648ae47e2cc84219",
        "method": "deployTo",
        "parameters": [
            {
                "type": "Address",
                "value": "cx10d59e8103ab44635190bd4139dbfd682fa2d07e"
            },
            {
                "type": "bytes",
                "value": ""
            },
            {
                "type": "String",
                "value": "[{\"type\":\"String\",\"value\":\"cx44250a12074799e26fdeee75648ae47e2cc84219\"}]"
            }
        ]
    },
  {
    "address": "cxa09dbb60dcb62fffbd232b6eae132d730a2aafa6",
    "method": "setFloorPercentage",
    "parameters": [
        { 
            "type": "int", 
            "value": "1500" 
        }
    ],
  },
  {
    "address": "cxa09dbb60dcb62fffbd232b6eae132d730a2aafa6",
    "method": "setTimeDelayMicroSeconds",
    "parameters": [
        { 
            "type": "int", 
            "value": "86400000000" 
        }
    ],
  },

]
4 Likes

In the future the adding of a new chain should just be 1 vote.
And to enable crosschain loans the contract needs to be updated then also crosshcain collateral can be added with 1 vote.

4 Likes

Great work, well done!

4 Likes

Awesome grind, congrats. Plan feels good.

5 Likes

Its finally time! Do it deploy deploy deploy

5 Likes

:fire: And so it got deployed

2 Likes