Vault Liquidity
List Connected Vaults
The operator vaults a market takes liquidity through, read from the chain
GET
/
lending-external-securities-v2
/
api
/
markets
/
{marketId}
/
connected-vaults
curl "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/connected-vaults" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/connected-vaults`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const offerable = data.vaults.filter(
(v: { depositable: boolean; depositsPaused: boolean | null; assetMatches: boolean | null }) =>
v.depositable && v.depositsPaused === false && v.assetMatches === true
);
{
"success": true,
"data": {
"useVaultLiquidity": true,
"vaults": [
{
"id": "cmssh8t2u0003cghxkx1w1fwd",
"published": true,
"vaultAddress": "0x4d0cfe39a3431b145d1a1393d901a36d459a1b13",
"name": "Trusset Prime Demo Vault",
"symbol": "TPV",
"assetAddress": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"assetMatches": true,
"assetDecimals": 6,
"depositsPaused": false,
"sharePrice": "1.024318",
"totalAssets": "302500.0",
"identityRegistryAddress": "0xef244c4bd4d71bd9a30edf6edef7ccc72642291a",
"registered": true,
"drawCap": "500000.0",
"providerApproved": true,
"positionValue": "120000.0",
"own": false,
"depositable": true,
"depositRefusal": null,
"riskDisclosure": "Deposits fund secured loans on the operator's lending markets. Redemptions depend on market utilization and can fill partially.",
"riskDisclosureUrl": "https://example.com/vault-risk-disclosure.pdf"
}
]
}
}
{
"success": true,
"data": {
"useVaultLiquidity": false,
"vaults": []
}
}
{
"success": false,
"error": {
"code": "VAULTS_UNREADABLE",
"message": "The vaults connected to this market could not be read from the chain. Retry in a moment."
}
}
Lists the vaults this market takes liquidity through. That is every vault the market admin registered, plus every vault with an active liquidity provider position recorded on this market. The figures are read from the chain, so an issuer that deployed the market sees the set its lender of record connected.
A current market takes outside money only through such a vault. Use this list to offer a client the vaults it can fund the market through, then build the transactions with Deposit to Vault and Redeem from Vault.
A market whose implementation predates vault liquidity answers
useVaultLiquidity: false and an empty vaults list.
Path Parameters
string
required
Which vaults take a deposit
A vault your own instance operates always takes a deposit through this market. Any other vault takes one only when its operator has published it on your network with a risk disclosure.depositable gives the answer and depositRefusal gives the reason in words. Redemptions are not restricted this way.
The operator’s riskDisclosure and riskDisclosureUrl are returned only for your own vault or a published one. Show them next to the deposit control.
Response Fields
object
Show child attributes
Show child attributes
boolean
The market switch for just-in-time draws.
false also on a market whose implementation predates vault liquidity. null when it could not be read.array
One entry per connected vault. A vault that does not answer keeps its entry, with
null in the fields that could not be read.Show child attributes
Show child attributes
string
The vault’s Trusset ID.
null when no operator on Trusset has a record of this vault.string
The vault contract, lowercased.
string
Vault name, read from the chain, with the stored record as fallback.
string
Share token symbol, read the same way.
string
The asset the vault holds, lowercased.
boolean
Whether that asset is the market’s settlement token (stablecoin).
null when either could not be read.integer
Decimals of the vault’s asset, which are also the decimals of its shares. Falls back to the market’s borrow asset decimals when the vault does not answer.
boolean
true when the vault operator has paused deposits. Redemptions stay open.string
Value of one share in the vault’s asset, as a decimal string.
"1.0" for an empty vault.string
The vault’s idle funds plus its value in every market it funds, in the vault’s asset.
string
The vault’s own register, which it examines its depositors against.
null when the vault names none: such a vault examines them against the provider register it adopted from its markets.boolean
Whether the vault is on this market’s draw list.
string
The cap the vault operator set for this market, as a decimal string in the vault’s asset.
"0.0" means the vault has not consented to draws. Unlike Get Vault Liquidity, this is not in base units.boolean
Whether the market admits the vault as a direct liquidity provider. On a current market it equals
registered.string
The vault’s liquidity provider position in this market, as a decimal string in the market’s borrow asset.
string
Present when the vault is a pocket of a vault group: the group’s Trusset ID.
string
Present with
groupId: the group’s name, or null.boolean
Whether the operator has published the vault on your instance’s network.
boolean
Whether your instance operates the vault.
boolean
Whether Deposit to Vault builds a deposit into this vault for your instance.
string
Why no deposit is offered, in words.
null when depositable is true.string
The operator’s risk disclosure text.
null unless the vault is your own or published.string
Link to the operator’s risk disclosure, on the same terms.
The answer is held for up to 60 seconds per market. A deposit or redemption confirmed through this market clears it. A registration made through this API or a new draw cap does not, so either can take up to a minute to show here.
curl "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/connected-vaults" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/connected-vaults`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const offerable = data.vaults.filter(
(v: { depositable: boolean; depositsPaused: boolean | null; assetMatches: boolean | null }) =>
v.depositable && v.depositsPaused === false && v.assetMatches === true
);
{
"success": true,
"data": {
"useVaultLiquidity": true,
"vaults": [
{
"id": "cmssh8t2u0003cghxkx1w1fwd",
"published": true,
"vaultAddress": "0x4d0cfe39a3431b145d1a1393d901a36d459a1b13",
"name": "Trusset Prime Demo Vault",
"symbol": "TPV",
"assetAddress": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"assetMatches": true,
"assetDecimals": 6,
"depositsPaused": false,
"sharePrice": "1.024318",
"totalAssets": "302500.0",
"identityRegistryAddress": "0xef244c4bd4d71bd9a30edf6edef7ccc72642291a",
"registered": true,
"drawCap": "500000.0",
"providerApproved": true,
"positionValue": "120000.0",
"own": false,
"depositable": true,
"depositRefusal": null,
"riskDisclosure": "Deposits fund secured loans on the operator's lending markets. Redemptions depend on market utilization and can fill partially.",
"riskDisclosureUrl": "https://example.com/vault-risk-disclosure.pdf"
}
]
}
}
{
"success": true,
"data": {
"useVaultLiquidity": false,
"vaults": []
}
}
{
"success": false,
"error": {
"code": "VAULTS_UNREADABLE",
"message": "The vaults connected to this market could not be read from the chain. Retry in a moment."
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
NO_MARKET_ADDRESS | 400 | The market has no on-chain address recorded |
MISSING_MARKET_ID | 400 | marketId is longer than 100 characters |
MARKET_NOT_FOUND | 404 | No market with this ID on your instance |
VAULTS_UNREADABLE | 503 | The market’s vault list could not be read from the chain. Retry shortly |
⌘I
curl "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/connected-vaults" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/connected-vaults`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const offerable = data.vaults.filter(
(v: { depositable: boolean; depositsPaused: boolean | null; assetMatches: boolean | null }) =>
v.depositable && v.depositsPaused === false && v.assetMatches === true
);
{
"success": true,
"data": {
"useVaultLiquidity": true,
"vaults": [
{
"id": "cmssh8t2u0003cghxkx1w1fwd",
"published": true,
"vaultAddress": "0x4d0cfe39a3431b145d1a1393d901a36d459a1b13",
"name": "Trusset Prime Demo Vault",
"symbol": "TPV",
"assetAddress": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"assetMatches": true,
"assetDecimals": 6,
"depositsPaused": false,
"sharePrice": "1.024318",
"totalAssets": "302500.0",
"identityRegistryAddress": "0xef244c4bd4d71bd9a30edf6edef7ccc72642291a",
"registered": true,
"drawCap": "500000.0",
"providerApproved": true,
"positionValue": "120000.0",
"own": false,
"depositable": true,
"depositRefusal": null,
"riskDisclosure": "Deposits fund secured loans on the operator's lending markets. Redemptions depend on market utilization and can fill partially.",
"riskDisclosureUrl": "https://example.com/vault-risk-disclosure.pdf"
}
]
}
}
{
"success": true,
"data": {
"useVaultLiquidity": false,
"vaults": []
}
}
{
"success": false,
"error": {
"code": "VAULTS_UNREADABLE",
"message": "The vaults connected to this market could not be read from the chain. Retry in a moment."
}
}
