Collateral health check

GO SDK
GO SDK
package main
import (
"context"
spec "github.com/velo-protocol/DRSv1/grpc"
"github.com/velo-protocol/DRSv1/libs/client"
"log"
)
func main() {
// Init Velo SDK From Stellar Account Secret Key
client, err := vclient.NewDefaultTestNetClient("testnet-drsv1-0.velo.org", "<YOUR SECRET KEY>")
if err != nil {
log.Println(err)
return
}
defer func() {
_ = client.Close()
}()
// Using Velo SDK Get Collateral Health Check Operation
getCollateralHealthCheck, err := client.GetCollateralHealthCheck(context.Background(), &spec.GetCollateralHealthCheckRequest{})
if err != nil {
log.Println(err)
return
}
log.Println("Asset Code: ", getCollateralHealthCheck.AssetCode)
// Asset Code: vTHB
log.Println("Asset Issuer: ", getCollateralHealthCheck.AssetIssuer)
// Asset Issuer: GDVGQLQQWOYQCYASYWH2BB6Q7YQAZJQWB2JVA3QTJYZOGFO5HBQULPVE
log.Println("Required Amount: ", getCollateralHealthCheck.RequiredAmount)
// Required Amount: 100
log.Println("Pool Amount: ", getCollateralHealthCheck.PoolAmount)
// Pool Amount: 200
}

Error

SDK
SDK

Description

Message

Response code

Cannot parse XDR

The XDR message cannot be decoded

3

Source account not found in user table or does not have permission to perform minting price-stable credit

The signer is not found or does not have sufficient permission to perform mint price-stable credit

7

Signature and source account does not match

The signature and source account does not match

16

Source account is blank

sourceAccount for the transaction must not be blank

3

Source account format is incorrect

invalid sourceAccount format

3

Cannot contact Stellar

internal server error

13

Cannot get price of pegged currency

cannot get price of pegged currency: no valid price in price account ${account}

9

Cannot get account details

fail to get account detail of ${account}

9

What's next?

If you know the collateral pool is not in the correct state, it time to rebalance!