API ReferenceWallet APIGet Wallet Defi PositionsGet detailed DeFi positions by wallet and protocolGet detailed DeFi positions by wallet and protocolGEThttps://deep-index.moralis.io/api/v2.2/wallets/:address/defi/:protocol/positionsFetch detailed DeFi positions for a given wallet and protocol.PATH PARAMSaddressstringrequiredWallet addressprotocolstringrequiredThe protocol to queryuniswap-v2uniswap-v3pancakeswap-v2pancakeswap-v3quickswap-v2quickswap-v3sushiswap-v2aave-v2aave-v3aave-lidofraxswap-v1fraxswap-v2lidomakerdaoeigenlayerpendleetherfirocketpoolsparkfitakara-lendneverlandkintsuQUERY PARAMSchainstringThe chain to queryeth0x1sepolia0xaa36a7polygon0x89bsc0x38bsc testnet0x61avalanche0xa86afantom0xfacronos0x19arbitrum0xa4b1chiliz0x15b38chiliz testnet0x15b32gnosis0x64gnosis testnet0x27d8base0x2105base sepolia0x14a34optimism0xaholesky0x4268polygon amoy0x13882linea0xe708moonbeam0x504moonriver0x505moonbase0x507linea sepolia0xe705flow0x2ebflow-testnet0x221ronin0x7e4ronin-testnet0x7e5lisk0x46flisk-sepolia0x106apulse0x171sei-testnet0x530sei0x531monad0x8fResponses200Returns the defi positions by protocol for the wallet address.400Bad Request404Not Found429Too Many Requests500Internal Server ErrorAPI KEYTest Live APIcURLNode.jsPythonGoPHPcurl --request GET \ --url 'https://deep-index.moralis.io/api/v2.2/wallets/0xd100d8b69c5ae23d6aa30c6c3874bf47539b95fd/defi/uniswap-v3/positions?chain=eth' \ --header 'accept: application/json' \ --header 'X-API-Key: YOUR_API_KEY' // Node.js v18+ has native fetch support// No additional dependencies requiredconst options = { method: 'GET', headers: { accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY' },};fetch('https://deep-index.moralis.io/api/v2.2/wallets/0xd100d8b69c5ae23d6aa30c6c3874bf47539b95fd/defi/uniswap-v3/positions?chain=eth', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));# Dependencies to install:# $ python -m pip install requestsimport requestsurl = "https://deep-index.moralis.io/api/v2.2/wallets/0xd100d8b69c5ae23d6aa30c6c3874bf47539b95fd/defi/uniswap-v3/positions?chain=eth"headers = { "Accept": "application/json", "X-API-Key": "YOUR_API_KEY"}response = requests.request("GET", url, headers=headers)print(response.text)package mainimport ( "fmt" "net/http" "io")func main() { url := "https://deep-index.moralis.io/api/v2.2/wallets/0xd100d8b69c5ae23d6aa30c6c3874bf47539b95fd/defi/uniswap-v3/positions?chain=eth" req, _ := http.NewRequest("GET", url, payload) req.Header.Add("Accept", "application/json") req.Header.Add("X-API-Key", "YOUR_API_KEY") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body))}<?php// Dependencies to install:// $ composer require guzzlehttp/guzzlerequire_once('vendor/autoload.php');$client = new \GuzzleHttp\Client();$response = $client->request('GET', 'https://deep-index.moralis.io/api/v2.2/wallets/0xd100d8b69c5ae23d6aa30c6c3874bf47539b95fd/defi/uniswap-v3/positions?chain=eth', [ 'headers' => [ 'Accept' => 'application/json', 'X-API-Key' => 'YOUR_API_KEY', ],]);echo $response->getBody();Response Example200 Returns the defi positions by protocol for the wallet address.{ "protocol_name": "Uniswap v2", "protocol_id": "uniswap-v2", "protocol_url": "https://app.uniswap.org/pools/v2", "protocol_logo": "https://cdn.moralis.io/defi/uniswap.png", "total_usd_value": 47754.14278954011, "total_unclaimed_usd_value": "", "positions": [ { "label": "liquidity", "tokens": [ { "token_type": "defi-token", "name": "Wrapped Ether", "symbol": "WETH", "contract_address": "0x06012c8cf97bead5deae237070f9587f8e7a266d", "decimals": "18", "logo": "https://cdn.moralis.io/tokens/0x0000000000085d4780b73119b644ae5ecd22b376.png", "thumbnail": "https://cdn.moralis.io/tokens/0x0000000000085d4780b73119b644ae5ecd22b376.png", "balance": "1000000", "balance_formatted": "1.000000", "usd_price": "1000000", "usd_value": "1000000" } ], "address": "0x06012c8cf97bead5deae237070f9587f8e7a266d", "balance_usd": "1000000", "total_unclaimed_usd_value": "1000000" } ]}