GP 10: Reallocate previous Kyberswap inventory
Last updated
Last updated
Proposal confirmed and executed in the following transactions:
Ethereum
Safe transaction
Ethereum tx:
BNB Smart Chain
Safe transaction
BNB tx:
Following GP 9, an emergency proposal to remove inventory from Kyberswap pairs on Mainnet and BNB chain, adjustments and reallocation of funds are proposed in this GP. The result will be a redistribution to several Uniswap pools and removal of some BOB from inventory. The overall decrease of total supply after this proposal is -3m BOB (52.5m β 49.5m).
Move Kyberswap USDT/BOB 0.008% inventory funds into Uniswap V3 USDT/BOB 0.01% inventory (2,000,000 BOB).
Remove 2,000,000 BOB from Kyberswap USDC/BOB 0.008% inventory as the Uniswap V3 USDC/BOB inventory already holds a sufficient amount of funds.
Move Kyberswap USDT/BOB 0.008% inventory funds into Uniswap V3 USDT/BOB 0.01% inventory (2,000,000 BOB)
Move Kyberswap USDC/BOB 0.008% inventory funds into Uniswap V3 USDC/BOB 0.01% inventory (2,000,000 BOB)
Remove 1,000,000 BOB from Kyberswap BUSD/BOB 0.008% inventory, as BUSD is being gradually deprecated.
Moving funds between inventory pairs requires several system swap transactions throughout the execution, since the funds are stored and allocated in different proportions (this is a limitation of existing AMM protocols like Uniswap or Kyberswap).
To facilitate the swaps in this proposal, customized 1inch limit orders using a separate one-time helper contract are constructed. Following successful proposal execution, 1inch resolvers or other BOB counterparties will asynchronously fill the orders.
Since the proposal consists of changes on 2 different networks, there are 2 different transactions explained below.
Action 1
Action 2
Action 3
During simulations, this action results in 1,999,985 BOB + 0 USDT allocated into the inventory position. However exact amounts might change with Uniswap pool state changes. The helper contract will make sure to create two 1-to-1 limit orders for the remaining funds. During the initial simulations, this action resulted in 15 USDT β 15 BOB limit order being created.
Once the limit order is filled, swapped tokens will be automatically and atomically added into the existing inventory position. This will happen asynchronously following proposal execution.
Action 4
Action 5
Action 6
Remove 2,000,000 BOB (18 decimals) from prior Kyberswap BOB/USDC 0.008% inventory (send to null address).
Part of the removed funds effectively come from Action 5.
Action 1
Remove 1,000,000 BOB (18 decimals) from prior Kyberswap BOB/BUSD 0.008% inventory (send to Null address).
Action 2
Action 3
Action 4
Action 5
During the initial proposal simulations, this action results in all 2,000,000 BOB + 0 USDT being allocated into inventory position. However exact amounts might change with Uniswap pool state changes. Helper contract will make sure to create two 1-to-1 limit orders for the remaining funds.
Action 6
During the initial proposal simulations, this action results in all 1,891,800 BOB + 7,435 USDC being allocated into inventory position. However exact amounts might change with Uniswap pool state changes. The helper contract will make sure to create two 1-to-1 limit orders for the remaining funds. During the initial proposal simulations, this action resulted in 100,765 USDC β 100,765 BOB limit order being created.
Once the limit order is filled, swapped tokens will be automatically and atomically added into the existing inventory position. This will happen asynchronously after the proposal execution.
Verify logic of helper contracts facilitating inventory minting and limit orders execution:
Transaction in the Safe on Mainnet contains 6 actions:
Approve 1,999,985 BOB (18 decimals) for inventory allocation into Uniswap V3 BOB/USDT 0.01% inventory pair through the helper contract counterparty.
Approve 15 USDT (6 decimals) for inventory allocation into Uniswap V3 BOB/USDT 0.01% inventory pair through the helper contract counterparty
Mint part of the inventory BOB/USDT position through the helper contract counterparty. The action is executed by calling mint
on the helper contract
See for simulation examples.
Approve 38,190.381903 USDC (6 decimals) to the BobSwap contract for conversion to BOB.
Convert 38,190.381903 USDC (6 decimals) into 38,190 BOB (18 decimals) through BobSwap . A commission of 0.381903 USDC is paid for this swap to BobSwap.
The action is executed by calling buy
on the BobSwap contract.
Transaction in the Safe on BNB Chain contains 6 actions:
Approve 2,000,000 BOB (18 decimals) for inventory allocation into Uniswap V3 BOB/USDT 0.01% inventory pair through the helper contract counterparty
Approve 108,200 USDC (6 decimals) for inventory allocation into Uniswap V3 BOB/USDC 0.01% inventory pair through the helper contract counterparty.
Approve 1,891,800 BOB (18 decimals) for inventory allocation into Uniswap V3 BOB/USDC 0.01% inventory pair through the helper contract counterparty
Mint part of the inventory BOB/USDT position through the helper contract counterparty. The action is executed by calling mint
on the helper contract
Once the limit order is filled, swapped tokens will be automatically and atomically added into the existing inventory position. This will happen asynchronously after the proposal execution. See for simulation example.
Mint part of the inventory BOB/USDC position through the helper contract counterparty. The action is executed by calling mint
on the helper contract
See for the simulation example.
Inventory LPs validity can be verified using the following simulation test -
Mainnet BOB/USDT inventory minter
BNB BOB/USDT inventory minter -
BNB BOB/USDC inventory minter -
Extra notes on Uniswap-related math: