Velo-Protocol
Search…
Redeeming stable credit

Parameters

Name
Description
Required?
Validation
assetCode
The asset code of price-stable credit that you want to redeem.
Yes
    Already been setup
    Correct format (1-7 alphanumeric characters)
RedeemAmount
The amount of stable credit you which to exchange into VELO token.
Yes
    Must be a positive number greater than 0 and has less than or equal to 7 decimal places
GO SDK
1
package main
2
​
3
import (
4
"context"
5
"github.com/velo-protocol/DRSv2_Evrynet/libs/vclient"
6
"log"
7
)
8
​
9
func main() {
10
​
11
client, err := vclient.NewClient("<evrynet rpc>", "<account private key>", ContractAddress{
12
DrsAddress: "<drs address>",
13
HeartAddress: "<heart address>",
14
})
15
if err != nil {
16
panic(err)
17
}
18
​
19
result, err := client.RedeemStableCredit(context.Background(), &RedeemStableCreditInput{
20
RedeemAmount: "1000",
21
AssetCode: "vUSD",
22
})
23
if err != nil {
24
panic(err)
25
}
26
log.Println("Redeem Stable Credit Transaction Hash: ", result.Tx.Hash().String())
27
log.Println("Asset Code: ", result.Event.AssetCode)
28
log.Println("Stable Credit Amount: ", result.Event.StableCreditAmount)
29
log.Println("Collateral Asset Address: ", result.Event.CollateralAssetAddress)
30
log.Println("Collateral Asset Code: ", result.Event.CollateralAssetCode)
31
log.Println("Collateral Amount: ", result.Event.CollateralAmount)
32
}
33
​
Copied!

What's next?

You have now completed the flow of stable credit. Let's take a look at the price stablisation mechanism.
Last modified 1yr ago
Copy link