Shield V2
HomeTrade
  • Overview
  • Shield perpetual options
    • Basics
    • Mechanism
  • Getting started
    • Guides
    • FAQs
      • About Shield
      • About Trading
      • About Pools
  • Developers
    • Trading API References
      • Overview
        • Smart Contracts Overview
      • Interfaces
        • 1. Deposit Funds
        • 2. Withdraw Funds
        • 3. Check Funds
        • 4. Deposit DAI into Public Pool
        • 5. Withdraw DAI from Public Pool
        • 6. Check Funds on Public Pool
        • 7. Deposit DAI to Private Pool
        • 8. Withdraw DAI from Private Pool
        • 9. Check Funds on Private Pool
        • 10. Check Details on a Certain Order
        • 11. Get Funding Fee Rate of an Option Transaction
      • "How-To" Instructions
        • How to monitor opening and closing orders?
      • Addendum
        • Full ABI on Shield Protocol V1
        • References
  • Additionals
    • Audits
    • Lightpaper
    • Pricing Method Paper
    • Privacy Policy
    • Terms of Use
Powered by GitBook
On this page
  • Description
  • User Interface
  • Function Description
  • ABI Description
  • Examples
  • Calling Examples
  • HTTP Request Example
  • Send a call request to get public pool info
  1. Developers
  2. Trading API References
  3. Interfaces

6. Check Funds on Public Pool

Previous5. Withdraw DAI from Public PoolNext7. Deposit DAI to Private Pool

Last updated 2 years ago

Description

Check detailed information on fund deposited in public liquidity pool.

TBD: Narratives

User Interface

Function Description

Item

Description

Contract Address

Public pool contract (referenced by Smart Contract Overview section)

Contract Name

SLDDAIPools1.sol

Function

function getLPAmountInfo() public view returns(uint256 deposit,uint256 availabe,uint256 locked)

Function Selector

0x53ac2d24

Invocation Type

Ethereum Call

Passing Parameters

None

Return Value

Total deposited amount; available amount; locked amount

ABI Description

{
	"inputs": [],
	"name": "getLPAmountInfo",
	"outputs": [{
		"internalType": "uint256",
		"name": "deposit",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "availabe",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "locked",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}

Examples

Calling Examples

// This example is written by using Web3.js
// More details on Web3.js could be found here - https://web3js.readthedocs.io/

var Web3 = require('web3');
const BigNumber = require('bignumber.js');

// BSC Mainnet: https://bsc-dataseed.binance.org
// BSC Testnet: https://data-seed-prebsc-1-s1.binance.org:8545
const  web3 = new Web3("https://data-seed-prebsc-1-s1.binance.org:8545");

const CONTRACT_ADDRESS = "Replace with public pool contract address";
const ABI = [{
	"inputs": [],
	"name": "getLPAmountInfo",
	"outputs": [{
		"internalType": "uint256",
		"name": "deposit",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "availabe",
		"type": "uint256"
	}, {
		"internalType": "uint256",
		"name": "locked",
		"type": "uint256"
	}],
	"stateMutability": "view",
	"type": "function"
}];

var contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);

contract.methods.getLPAmountInfo().call({
}, function(error, result){
    if(!error) {
      console.log('Response:', result);
    } else {
      console.log(error);
    }
});
# This example is written by using Web3.py
# More details on Web3.py could be found here - https://web3py.readthedocs.io/

HTTP Request Example

Send a call request to get public pool info

POST (BSC Mainnet) https://bsc-dataseed.binance.org/

Make a contract call to get deposited funds details of Shield Protocol V1. More details on how to make a contract call request via BSC RPC could be found here, https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction

Request Body

Name
Type
Description

jsonrpc

string

"2.0"

method

string

"eth_call"

params

array

the signed transaction data coerced into string array, for instance,

id

number

request sequence id, you could use timestamp as id

{
    "jsonrpc": "2.0",
    "id": 1234,
    "result": "0x0000000000000000000000000000000000000000000dc85f59edd89161ce451a0000000000000000000000000000000000000000000ab0e0c62a28d4f38d151a00000000000000000000000000000000000000000003177e93c3afbc6e413000"
}

Request Body Example:

{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0x0000000000000000000000000000000000000000",
            "to": "0x67360e519b0d7f4f4f257e22253cac1cd5c8ef12",
            "data": "0x53ac2d24"
        },
        "latest"
    ],
    "id": 1234
}

CURL Example:

curl --location --request POST 'https://data-seed-prebsc-1-s1.binance.org:8545' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0x0000000000000000000000000000000000000000",
            "to": "0x67360e519b0d7f4f4f257e22253cac1cd5c8ef12",
            "data": "0x53ac2d24"
        },
        "latest"
    ],
    "id": 1234
}'