strategiesByPair()

CarbonController.sol
   function strategiesByPair(
        Token token0,
        Token token1,
        uint256 startIndex,
        uint256 endIndex
    ) external view returns (Strategy[] memory)

This function is used to obtain a list of strategies for the specified token pair.

Function Arguments

Name
Type
Description

token0

Token

The address of the first token in the pair

token1

Token

The address of the second token in the pair

startIndex

uint256

Index of first strategy to view

endIndex

uint256

Index of last strategy to view

Returns

This function returns a list of strategy objects containing details for strategies from the specified token pair.

Example

strategiesByPairl(
 0x514910771AF9Ca656af840dff83E8264EcF986CA, //token0
 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE, //token1
 0, //startIndex
 25, //endIndex
)

// returns
// [(Strategy), (Strategy), (Strategy)]

// struct Strategy {
//    uint256 id;
//    address owner;
//    Token[2] tokens;
//    Order[2] orders;
// }

// Order objects:
//        [
//            Order({
//                y: uint128,
//                z: uint128,
//                A: uint64,
//                B: uint64
//            }),
//            Order({
//                y: uint128),
//                z: uint128,
//                A: uint64,
//                B: uint64
//            })
//        ]

Last updated