Rebalance basket

Once a user has minted a basket NFT it can then start to lock DRB tokens to it and start giving allocations to protocols. It does so by calling the following function in our game contract:

function rebalanceBasket(
  uint256 _basketId, 
  int256[][] memory _deltaAllocations
) external onlyBasketOwner(_basketId) nonReentrant

Where _basketId is the id refering to the NFT the user has minted, _deltaAllocations are the deltas in allocations where the first index refers to the chainId and the second index refers to the protocolId. The allocations are set by locking DRB tokens, where the decimals are in 10^18. Hence, 1 DRB token lets the user set 1 allocation by inputting 10^18.

Last updated