All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| ListMultiCollateralOrders | Get /loan/multi_collateral/orders | Query multi-currency collateral order list |
| CreateMultiCollateral | Post /loan/multi_collateral/orders | Place multi-currency collateral order |
| GetMultiCollateralOrderDetail | Get /loan/multi_collateral/orders/{order_id} | Query order details |
| ListMultiRepayRecords | Get /loan/multi_collateral/repay | Query multi-currency collateral repayment records |
| RepayMultiCollateralLoan | Post /loan/multi_collateral/repay | Multi-currency collateral repayment |
| ListMultiCollateralRecords | Get /loan/multi_collateral/mortgage | Query collateral adjustment records |
| OperateMultiCollateral | Post /loan/multi_collateral/mortgage | Add or withdraw collateral |
| ListUserCurrencyQuota | Get /loan/multi_collateral/currency_quota | Query user's collateral and borrowing currency quota information |
| ListMultiCollateralCurrencies | Get /loan/multi_collateral/currencies | Query supported borrowing and collateral currencies for multi-currency collateral |
| GetMultiCollateralLtv | Get /loan/multi_collateral/ltv | Query collateralization ratio information |
| GetMultiCollateralFixRate | Get /loan/multi_collateral/fixed_rate | Query currency's 7-day and 30-day fixed interest rates |
| GetMultiCollateralCurrentRate | Get /loan/multi_collateral/current_rate | Query currency's current interest rate |
[]MultiCollateralOrder ListMultiCollateralOrders(ctx, optional)
Query multi-currency collateral order list
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| optional | ListMultiCollateralOrdersOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListMultiCollateralOrdersOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| page | optional.Int32 | Page number | [default to 1] |
| limit | optional.Int32 | Maximum number of records returned in a single list | [default to 10] |
| sort | optional.String | Sort type: `time_desc` - Created time descending (default), `ltv_asc` - Collateral ratio ascending, `ltv_desc` - Collateral ratio descending. | |
| orderType | optional.String | Order type: current - Query current orders, fixed - Query fixed orders, defaults to current orders if not specified |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
func main() {
client := gateapi.NewAPIClient(gateapi.NewConfiguration())
// uncomment the next line if your are testing against testnet
// client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
ctx := context.WithValue(context.Background(),
gateapi.ContextGateAPIV4,
gateapi.GateAPIV4{
Key: "YOUR_API_KEY",
Secret: "YOUR_API_SECRET",
}
)
result, _, err := client.MultiCollateralLoanApi.ListMultiCollateralOrders(ctx, nil)
if err != nil {
if e, ok := err.(gateapi.GateAPIError); ok {
fmt.Printf("gate api error: %s\n", e.Error())
} else {
fmt.Printf("generic error: %s\n", err.Error())
}
} else {
fmt.Println(result)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OrderResp CreateMultiCollateral(ctx, createMultiCollateralOrder)
Place multi-currency collateral order
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| createMultiCollateralOrder | CreateMultiCollateralOrder |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
func main() {
client := gateapi.NewAPIClient(gateapi.NewConfiguration())
// uncomment the next line if your are testing against testnet
// client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
ctx := context.WithValue(context.Background(),
gateapi.ContextGateAPIV4,
gateapi.GateAPIV4{
Key: "YOUR_API_KEY",
Secret: "YOUR_API_SECRET",
}
)
createMultiCollateralOrder := gateapi.CreateMultiCollateralOrder{} // CreateMultiCollateralOrder -
result, _, err := client.MultiCollateralLoanApi.CreateMultiCollateral(ctx, createMultiCollateralOrder)
if err != nil {
if e, ok := err.(gateapi.GateAPIError); ok {
fmt.Printf("gate api error: %s\n", e.Error())
} else {
fmt.Printf("generic error: %s\n", err.Error())
}
} else {
fmt.Println(result)
}
}- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MultiCollateralOrder GetMultiCollateralOrderDetail(ctx, orderId)
Query order details
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| orderId | string | Order ID returned when order is successfully created |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
func main() {
client := gateapi.NewAPIClient(gateapi.NewConfiguration())
// uncomment the next line if your are testing against testnet
// client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
ctx := context.WithValue(context.Background(),
gateapi.ContextGateAPIV4,
gateapi.GateAPIV4{
Key: "YOUR_API_KEY",
Secret: "YOUR_API_SECRET",
}
)
orderId := "12345" // string - Order ID returned when order is successfully created
result, _, err := client.MultiCollateralLoanApi.GetMultiCollateralOrderDetail(ctx, orderId)
if err != nil {
if e, ok := err.(gateapi.GateAPIError); ok {
fmt.Printf("gate api error: %s\n", e.Error())
} else {
fmt.Printf("generic error: %s\n", err.Error())
}
} else {
fmt.Println(result)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]MultiRepayRecord ListMultiRepayRecords(ctx, type_, optional)
Query multi-currency collateral repayment records
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| type_ | string | Operation type: repay - Regular repayment, liquidate - Liquidation | |
| optional | ListMultiRepayRecordsOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListMultiRepayRecordsOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| borrowCurrency | optional.String | Borrowed currency | |
| page | optional.Int32 | Page number | [default to 1] |
| limit | optional.Int32 | Maximum number of records returned in a single list | [default to 10] |
| from | optional.Int64 | Start timestamp for the query | |
| to | optional.Int64 | End timestamp for the query, defaults to current time if not specified |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
func main() {
client := gateapi.NewAPIClient(gateapi.NewConfiguration())
// uncomment the next line if your are testing against testnet
// client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
ctx := context.WithValue(context.Background(),
gateapi.ContextGateAPIV4,
gateapi.GateAPIV4{
Key: "YOUR_API_KEY",
Secret: "YOUR_API_SECRET",
}
)
type_ := "repay" // string - Operation type: repay - Regular repayment, liquidate - Liquidation
result, _, err := client.MultiCollateralLoanApi.ListMultiRepayRecords(ctx, type_, nil)
if err != nil {
if e, ok := err.(gateapi.GateAPIError); ok {
fmt.Printf("gate api error: %s\n", e.Error())
} else {
fmt.Printf("generic error: %s\n", err.Error())
}
} else {
fmt.Println(result)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MultiRepayResp RepayMultiCollateralLoan(ctx, repayMultiLoan)
Multi-currency collateral repayment
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| repayMultiLoan | RepayMultiLoan |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
func main() {
client := gateapi.NewAPIClient(gateapi.NewConfiguration())
// uncomment the next line if your are testing against testnet
// client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
ctx := context.WithValue(context.Background(),
gateapi.ContextGateAPIV4,
gateapi.GateAPIV4{
Key: "YOUR_API_KEY",
Secret: "YOUR_API_SECRET",
}
)
repayMultiLoan := gateapi.RepayMultiLoan{} // RepayMultiLoan -
result, _, err := client.MultiCollateralLoanApi.RepayMultiCollateralLoan(ctx, repayMultiLoan)
if err != nil {
if e, ok := err.(gateapi.GateAPIError); ok {
fmt.Printf("gate api error: %s\n", e.Error())
} else {
fmt.Printf("generic error: %s\n", err.Error())
}
} else {
fmt.Println(result)
}
}- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]MultiCollateralRecord ListMultiCollateralRecords(ctx, optional)
Query collateral adjustment records
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| optional | ListMultiCollateralRecordsOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListMultiCollateralRecordsOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| page | optional.Int32 | Page number | [default to 1] |
| limit | optional.Int32 | Maximum number of records returned in a single list | [default to 10] |
| from | optional.Int64 | Start timestamp for the query | |
| to | optional.Int64 | End timestamp for the query, defaults to current time if not specified | |
| collateralCurrency | optional.String | Collateral currency |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
func main() {
client := gateapi.NewAPIClient(gateapi.NewConfiguration())
// uncomment the next line if your are testing against testnet
// client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
ctx := context.WithValue(context.Background(),
gateapi.ContextGateAPIV4,
gateapi.GateAPIV4{
Key: "YOUR_API_KEY",
Secret: "YOUR_API_SECRET",
}
)
result, _, err := client.MultiCollateralLoanApi.ListMultiCollateralRecords(ctx, nil)
if err != nil {
if e, ok := err.(gateapi.GateAPIError); ok {
fmt.Printf("gate api error: %s\n", e.Error())
} else {
fmt.Printf("generic error: %s\n", err.Error())
}
} else {
fmt.Println(result)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CollateralAdjustRes OperateMultiCollateral(ctx, collateralAdjust)
Add or withdraw collateral
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| collateralAdjust | CollateralAdjust |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
func main() {
client := gateapi.NewAPIClient(gateapi.NewConfiguration())
// uncomment the next line if your are testing against testnet
// client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
ctx := context.WithValue(context.Background(),
gateapi.ContextGateAPIV4,
gateapi.GateAPIV4{
Key: "YOUR_API_KEY",
Secret: "YOUR_API_SECRET",
}
)
collateralAdjust := gateapi.CollateralAdjust{} // CollateralAdjust -
result, _, err := client.MultiCollateralLoanApi.OperateMultiCollateral(ctx, collateralAdjust)
if err != nil {
if e, ok := err.(gateapi.GateAPIError); ok {
fmt.Printf("gate api error: %s\n", e.Error())
} else {
fmt.Printf("generic error: %s\n", err.Error())
}
} else {
fmt.Println(result)
}
}- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]CurrencyQuota ListUserCurrencyQuota(ctx, type_, currency)
Query user's collateral and borrowing currency quota information
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| type_ | string | Currency type: collateral - Collateral currency, borrow - Borrowing currency | |
| currency | string | When it is a collateral currency, multiple currencies can be provided separated by commas; when it is a borrowing currency, only one currency can be provided. |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
func main() {
client := gateapi.NewAPIClient(gateapi.NewConfiguration())
// uncomment the next line if your are testing against testnet
// client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
ctx := context.WithValue(context.Background(),
gateapi.ContextGateAPIV4,
gateapi.GateAPIV4{
Key: "YOUR_API_KEY",
Secret: "YOUR_API_SECRET",
}
)
type_ := "collateral" // string - Currency type: collateral - Collateral currency, borrow - Borrowing currency
currency := "BTC" // string - When it is a collateral currency, multiple currencies can be provided separated by commas; when it is a borrowing currency, only one currency can be provided.
result, _, err := client.MultiCollateralLoanApi.ListUserCurrencyQuota(ctx, type_, currency)
if err != nil {
if e, ok := err.(gateapi.GateAPIError); ok {
fmt.Printf("gate api error: %s\n", e.Error())
} else {
fmt.Printf("generic error: %s\n", err.Error())
}
} else {
fmt.Println(result)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MultiCollateralCurrency ListMultiCollateralCurrencies(ctx, )
Query supported borrowing and collateral currencies for multi-currency collateral
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
func main() {
client := gateapi.NewAPIClient(gateapi.NewConfiguration())
// uncomment the next line if your are testing against testnet
// client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
ctx := context.Background()
result, _, err := client.MultiCollateralLoanApi.ListMultiCollateralCurrencies(ctx)
if err != nil {
if e, ok := err.(gateapi.GateAPIError); ok {
fmt.Printf("gate api error: %s\n", e.Error())
} else {
fmt.Printf("generic error: %s\n", err.Error())
}
} else {
fmt.Println(result)
}
}No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CollateralLtv GetMultiCollateralLtv(ctx, )
Query collateralization ratio information
Multi-currency collateral ratio is fixed, independent of currency
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
func main() {
client := gateapi.NewAPIClient(gateapi.NewConfiguration())
// uncomment the next line if your are testing against testnet
// client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
ctx := context.Background()
result, _, err := client.MultiCollateralLoanApi.GetMultiCollateralLtv(ctx)
if err != nil {
if e, ok := err.(gateapi.GateAPIError); ok {
fmt.Printf("gate api error: %s\n", e.Error())
} else {
fmt.Printf("generic error: %s\n", err.Error())
}
} else {
fmt.Println(result)
}
}No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]CollateralFixRate GetMultiCollateralFixRate(ctx, )
Query currency's 7-day and 30-day fixed interest rates
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
func main() {
client := gateapi.NewAPIClient(gateapi.NewConfiguration())
// uncomment the next line if your are testing against testnet
// client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
ctx := context.Background()
result, _, err := client.MultiCollateralLoanApi.GetMultiCollateralFixRate(ctx)
if err != nil {
if e, ok := err.(gateapi.GateAPIError); ok {
fmt.Printf("gate api error: %s\n", e.Error())
} else {
fmt.Printf("generic error: %s\n", err.Error())
}
} else {
fmt.Println(result)
}
}No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]CollateralCurrentRate GetMultiCollateralCurrentRate(ctx, currencies, optional)
Query currency's current interest rate
Query currency's current interest rate for the previous hour, current interest rate updates hourly
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| currencies | []string | Specify currency name query array, separated by commas, maximum 100 items | |
| optional | GetMultiCollateralCurrentRateOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a GetMultiCollateralCurrentRateOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| vipLevel | optional.String | VIP level, defaults to 0 if not specified | [default to 0] |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
func main() {
client := gateapi.NewAPIClient(gateapi.NewConfiguration())
// uncomment the next line if your are testing against testnet
// client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
ctx := context.Background()
currencies := []string{"[\"BTC\",\"GT\"]"} // []string - Specify currency name query array, separated by commas, maximum 100 items
result, _, err := client.MultiCollateralLoanApi.GetMultiCollateralCurrentRate(ctx, currencies, nil)
if err != nil {
if e, ok := err.(gateapi.GateAPIError); ok {
fmt.Printf("gate api error: %s\n", e.Error())
} else {
fmt.Printf("generic error: %s\n", err.Error())
}
} else {
fmt.Println(result)
}
}No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]