Lens - Pool - Curve

This API retrieves information about all of the actions that occurred for a specific liquidity pool on the protocol within a certain timespan.

🚧

Time Range Limit

The maximum time range (difference between endDate and startDate) is 60 days.

📘

Not specifying startDate and endDate

If the startDate and endDate query parameters are not provided, the API will return data from the current date - 30 days.

So if the date-time today is 2022-12-20T00:00:00, then the first object in payload.data would start from at least 2022-11-20T00:00:00.

👍

Supported Pools

This endpoint only supports Curve v1 pools. Crypto pools (Curve v2) and factory pools (metapools) are not supported.

Understanding Actions in Curve

There are many different types of actions in Curve, as you'll see in the action property for each item of the payload.data array. The guide below will help you understand the possible actions.

Swap

The tokens bought and sold are identified by tokenBoughtAddress and tokenSoldAddress. The amount of the tokens bought and sold are identified by tokenBoughtAmountNormalized and tokenSoldAmountNormalized.

In this case, 2464.268 USDT was exchanged for 2460.88 USDC.

{
	"blockNumber": 15066172,
	"transactionHash": "0xdb8a64a3e6e1262e0ba133c3b876a57fbc3e3e912f1da26c733e95837a423b72",
	"logIndex": 109,
	"timestamp": 1656806423000,
	"factoryAddress": "0x90e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f5",
	"poolAddress": "0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
	"event": "TokenExchange(index_topic_1 address buyer, int128 sold_id, uint256 tokens_sold, int128 bought_id, uint256 tokens_bought)",
	"action": "Swap",
	"walletAddress": "0x3b43b655cc979dbf8a0d06219d91608b983bc02a",
	"buyer": "0x3b43b655cc979dbf8a0d06219d91608b983bc02a",
	"tokenSoldAmount": "2464268350",
	"tokenBoughtAmount": "2460886693",
	"tokenAddresses": [
	  "0x6b175474e89094c44da98b954eedeac495271d0f",
	  "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
	  "0xdac17f958d2ee523a2206206994597c13d831ec7"
	],
	"tokenDecimals": [
	  18,
	  6,
	  6
	],
	"tokenSymbols": [
	  "DAI",
	  "USDC",
	  "USDT"
	],
	"numCoins": 3,
	"tokenSoldName": "Tether USD",
	"tokenBoughtName": "USD Coin",
	"tokenSoldSymbol": "USDT",
	"tokenSoldAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
	"tokenBoughtSymbol": "USDC",
	"tokenBoughtAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
	"tokenSoldAmountNormalized": "2464.2683500",
	"tokenBoughtAmountNormalized": "2460.8866930"
}
propertytype
blockNumbernumber
transactionHashstring
logIndexnumber
timestampstring | number
factoryAddressstring
poolAddressstring
eventstring
actionstring
walletAddressstring
buyerstring
tokenSoldAmountstring
tokenBoughtAmountstring
tokenAddressesstring []
tokenDecimalsnumber[]
tokenSymbolsstring[]
numCoinsnumber
tokenSoldNamestring
tokenBoughtNamestring
tokenSoldSymbolstring
tokenBoughtSymbolstring
tokenSoldAmountNormalizedstring
tokenBoughtAmountNormalizedstring

AddLiquidity

Using tokenSymbols and tokenAmountsNormalized we see that 5070.082 USDT was added to the liquidity pool at poolAddress. 0 DAI and 0 USDC were added.

{
	"blockNumber": 15066257,
	"transactionHash": "0xd5f60ef754bce1c20603434efe33bbb1fb2c2f67bb102cc8929d247ba594f6b9",
	"logIndex": 429,
	"timestamp": 1656807532000,
	"factoryAddress": "0x90e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f5",
	"poolAddress": "0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
	"event": "AddLiquidity(index_topic_1 address provider, uint256[3] token_amounts, uint256[3] fees, uint256 invariant, uint256 token_supply)",
	"action": "AddLiquidity",
	"walletAddress": "0x7bfee91193d9df2ac0bfe90191d40f23c773c060",
	"fees": [
	  "32239721365765604",
	  "32865",
	  "65191"
	],
	"provider": "0xed279fdd11ca84beef15af5d39bb4d4bee23f0ca",
	"invariant": "1024035759750197045519941896",
	"tokenSupply": "1002295842769406838984438840",
	"tokenAmounts": [
	  "0",
	  "0",
	  "5007082498"
	],
	"feesNormalized": [
	  "0.0322397213657656040",
	  "0.0328650",
	  "0.0651910"
	],
	"tokenSupplyNormalized": "1002295842.7694068389844388400",
	"tokenAmountsNormalized": [
	  "0",
	  "0",
	  "5007.0824980"
	],
	"tokenAddresses": [
	  "0x6b175474e89094c44da98b954eedeac495271d0f",
	  "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
	  "0xdac17f958d2ee523a2206206994597c13d831ec7"
	],
	"tokenDecimals": [
	  18,
	  6,
	  6
	],
	"tokenSymbols": [
	  "DAI",
	  "USDC",
	  "USDT"
	],
	"numCoins": 3
}
propertytype
blockNumbernumber
transactionHashstring
logIndexnumber
timestampstring | number
factoryAddressstring
poolAddressstring
eventstring
actionstring
walletAddressstring
feesstring[]
providerstring
invariantstring
tokenSupplystring
tokenAmountsstring[]
feesNormalizedstring[]
tokenSupplyNormalizedstring
tokenAmountsNormalizedstring []
tokenAddressesstring []
tokenDecimalsnumber[]
tokenSymbolsstring[]
numCoinsnumber

RemoveLiquidity

In Curve, there are three unique methods of removing liquidity.

What are the differences between the three methods?

RemoveLiquidity(...) - Withdraw tokenAmountsNormalized of the tokens in the liquidity pool. Each entry/value in tokenAmountsNormalized maps to exactly one token in tokenSymbols. In other words, 2369.71 DAI, 6989.62 USDC and 7271.21 USDT were removed from the liquidity pool.

RemoveLiquidityOne(...) - Withdraw tokenAmountNormalized of only one token in the liquidity pool.

RemoveLiquidityImbalance(...) - Withdraw an imbalanced amount of the tokens in the liquidity pool. The amounts of tokens withdrawn is denoted in tokenAmountsNormalized. Each entry/value in tokenAmountsNormalized maps to exactly one token in tokenSymbols. In other words, 292.92 DAI, 804.98 USDC and 883.29 USDT were removed from the liquidity pool.

{
	"blockNumber": 12538978,
	"transactionHash": "0x161feff90453a6213ccc6f9983ef15e175a939ba43e33b0ccb9e8ca89b74f8c7",
	"logIndex": 327,
	"timestamp": "2021-05-31 00:38:36 000",
	"factoryAddress": "0x90e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f5",
	"poolAddress": "0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
	"event": "RemoveLiquidity(index_topic_1 address provider, uint256[3] token_amounts, uint256[3] fees, uint256 token_supply)",
	"action": "RemoveLiquidity",
	"walletAddress": "0xb94fb3cc45c11b3e1dffbc12490537a78306f1fe",
	"fees": [
	  "0",
	  "0",
	  "0"
	],
	"provider": "0xa79828df1850e8a3a3064576f380d90aecdd3359",
	"tokenSupply": "1222576109977577774990655593",
	"tokenAmounts": [
	  "2369717089046478622112",
	  "6989623610",
	  "7271218614"
	],
	"feesNormalized": [
	  "0",
	  "0",
	  "0"
	],
	"tokenSupplyNormalized": "1222576109.9775777749906555930",
	"tokenAmountsNormalized": [
	  "2369.7170890464786221120",
	  "6989.6236100",
	  "7271.2186140"
	],
	"tokenAddresses": [
	  "0x6b175474e89094c44da98b954eedeac495271d0f",
	  "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
	  "0xdac17f958d2ee523a2206206994597c13d831ec7"
	],
	"tokenDecimals": [
	  18,
	  6,
	  6
	],
	"tokenSymbols": [
	  "DAI",
	  "USDC",
	  "USDT"
	],
	"numCoins": 3
}
{
  "blockNumber": 15066187,
  "transactionHash": "0xbeec1726f2298afba5718bbf47057e5f6534a36076d6f690ccc834cd0fe052b7",
  "logIndex": 512,
  "timestamp": 1656806664000,
  "factoryAddress": "0x90e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f5",
  "poolAddress": "0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
  "event": "RemoveLiquidityOne(index_topic_1 address provider, uint256 token_amount, uint256 coin_amount)",
  "action": "RemoveLiquidity",
  "walletAddress": "0x514e494c86f9249cfdc0e072f71f71a97cf33e65",
  "provider": "0x514e494c86f9249cfdc0e072f71f71a97cf33e65",
  "tokenAmount": "118035363826950809008",
  "redeemedTokenAmount": "120499827706830559650",
  "tokenAmountNormalized": "118.0353638269508090080",
  "tokenAddresses": [
    "0x6b175474e89094c44da98b954eedeac495271d0f",
    "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    "0xdac17f958d2ee523a2206206994597c13d831ec7"
  ],
  "tokenDecimals": [
    18,
    6,
    6
  ],
  "tokenSymbols": [
    "DAI",
    "USDC",
    "USDT"
  ],
  "numCoins": 3,
  "redeemedTokenName": "Dai Stablecoin",
  "redeemedTokenSymbol": "DAI",
  "redeemedTokenAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
  "redeemedTokenAmountNormalized": "120.4998277068305596500"
}
{
	"blockNumber": 12539428,
	"transactionHash": "0xc7ec5750c45d0465ebe723806ef4cd1ae02912e8ed8619857afdbdcb207cb56c",
	"logIndex": 127,
	"timestamp": "2021-05-31 02:19:00 000",
	"factoryAddress": "0x90e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f5",
	"poolAddress": "0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
	"event": "RemoveLiquidityImbalance(index_topic_1 address provider, uint256[3] token_amounts, uint256[3] fees, uint256 invariant, uint256 token_supply)",
	"action": "RemoveLiquidity",
	"walletAddress": "0x5132972aec6cb1611442d1ec1762dfb760f32572",
	"fees": [
	  "1456603360417224",
	  "5135",
	  "3677"
	],
	"provider": "0x8b947d8448cffb89ef07a6922b74fbabac219795",
	"invariant": "1243798309407644640197906294",
	"tokenSupply": "1222617861733978403866472471",
	"tokenAmounts": [
	  "292926230095826348249",
	  "804985128",
	  "883299920"
	],
	"feesNormalized": [
	  "0.0014566033604172240",
	  "0.0051350",
	  "0.0036770"
	],
	"tokenSupplyNormalized": "1222617861.7339784038664724710",
	"tokenAmountsNormalized": [
	  "292.9262300958263482490",
	  "804.9851280",
	  "883.2999200"
	],
	"tokenAddresses": [
	  "0x6b175474e89094c44da98b954eedeac495271d0f",
	  "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
	  "0xdac17f958d2ee523a2206206994597c13d831ec7"
	],
	"tokenDecimals": [
	  18,
	  6,
	  6
	],
	"tokenSymbols": [
	  "DAI",
	  "USDC",
	  "USDT"
	],
	"numCoins": 3
}

📘

Mapping "action"

All the methods of removing liquidity are mapped to "action": "RemoveLiquidity".

You can retrieve all the different liquidity removal events with action=RemoveLiquidity in the query parameters.

RemoveLiquidity(...)

propertytype
blockNumbernumber
transactionHashstring
logIndexnumber
timestampstring | number
factoryAddressstring
poolAddressstring
eventstring
actionstring
walletAddressstring
feesstring[]
providerstring
tokenSupplystring
tokenAmountsstring[]
feesNormalizedstring[]
tokenSupplyNormalizedstring
tokenAmountsNormalizedstring []
tokenAddressesstring []
tokenDecimalsnumber[]
tokenSymbolsstring[]
numCoinsnumber

RemoveLiquidityOne(...)

propertytype
blockNumbernumber
transactionHashstring
logIndexnumber
timestampstring | number
factoryAddressstring
poolAddressstring
eventstring
actionstring
walletAddressstring
providerstring
tokenAmountstring
tokenAmountNormalizedstring
tokenAddressesstring []
tokenDecimalsnumber[]
tokenSymbolsstring[]
numCoinsnumber
redeemedTokenNamestring
redeemedTokenSymbolstring
redeemedTokenAddressstring
redeemedTokenAmountstring
redeemedTokenAmountNormalizedstring

RemoveLiquidityImbalance(...)

propertytype
blockNumbernumber
transactionHashstring
logIndexnumber
timestampstring | number
factoryAddressstring
poolAddressstring
eventstring
actionstring
walletAddressstring
feesstring[]
providerstring
invariantstring
tokenSupplystring
tokenAmountsstring[]
feesNormalizedstring[]
tokenSupplyNormalizedstring
tokenAmountsNormalizedstring []
tokenAddressesstring []
tokenDecimalsnumber[]
tokenSymbolsstring[]
numCoinsnumber
Language
Credentials
Header
Click Try It! to start a request and see the response here!