Oauth API
Overview
Authorized APP registration
The registration is represented by a series of key-value pairs, which is normally encoded as an object in a YAML file. It has the following structure:
Oauth APP Registration
Oauth APP Registration
Name | Type | Description |
---|---|---|
app_logo |
string |
Required: The logo URL for the authorized APP. |
app_name |
string |
Required: The name for the authorized APP. |
app_url |
string |
Required: The URL for the authorized APP. |
redirect_uri |
string |
Required: The callback address after authorization is successful. |
Examples
{}
client_id and client_secret are returned after successful registration:
client_id: "6C75636B795F736F6369616C73776170"
client_secret: "f4cde0ad-1f6c-48bb-a70a-7c116140012a"
Authorization flow chart
access_token processing for different devices
IM supports multi-terminal login, including mobile terminal and web terminal. web terminal also has different browser login. In IM, different devices generate different access_token. If you log out of a device, only the access_token of the device is deleted. If you log out of all devices, all access_tokens are deleted
Authorization API
Oauth API contains client oauth api and server oauth api; client oauth api is provided to call from frontend, server oauth api is provided to call from backend.
Sending.me Step for authorizing the APP
-
Get client_id and client_secret through product collaboration: See Authorized APP registration
-
Show sending.me authorization link:
{sending.me}/#/login/auth?client_id={client_id}&redirect_uri={redirect_uri}- [Alpha]. https://app-alpha.sending.me
- [Prod]. https://app.sending.me
Here is an example of an alpha environment
client_id: "6C75636B795F736F6369616C73776170" redirect_uri: "https://lucky.socialswap.com"
The concatenated link is: https://app-alpha.sending.me/#/login/auth?client_id=6C75636B795F736F6369616C73776170&redirect_uri=https://lucky.socialswap.com
-
Click button Authorize will callback with the authorization code:
#Here is an example of an alpha environment
https://lucky.socialswap.com/create?authorization_code=9a35372a-0ebe-4afa-b3ba-a717aa6b8755&client_id=6C75636B795F736F6369616C73776170
-
Get the authorization code in exchange for the token:
See The app server obtains the token
sending.me Server interface
- [Alpha]. https://hs-alpha.sending.me
- [Prod]. https://hs.sending.me
#Here is an example of an alpha environment https://hs-alpha.sending.me/_api/client/r0/oauth/token
Client Oauth
Client OAuth Flow
- register Dapp, Dapp backend developers would register Dapp to SDM by contacting SDM developers.
- return client_id, client_secret of the registered dapp.
- open auth web:
# Description: SDM Auth Web # # client_id: dapp's client id # redirect_uri: dapp's origin uri # state: dapp's origin params, which is optional https://app.sending.me/#/login/auth?client_id={client_id}&redirect_uri={redirect_uri}&state={Dapp_original_params(optional)}
- fetch dappInfo: call api: fetch dapp info to get dapp’s basic info.
- return dapp’s basic info.
- user authorize: user can confirm or deny authorization.
- return authorization_code: When the user confirms, the web will redirect to redirect_uri with
authorization_code
andstate
. - pass authorization_code to backend.
- fetch access_token: call api: fetch access_token to fetch
access_token
. - return
access_token
. - fetch user_info: call api: fetch user_info to fetch user basic info.
- return user basic info.
Client OAuth API
API1. Fetch dapp info
GET
/_api/client/r0/oauth/app/info
Gets information about the authorized APP.
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
redirect_uri |
string |
Required: Registered authorized client callback address |
Responses
Status | Description |
---|---|
200 |
The information of the authorized APP. |
200 response
{
"app_logo": "https://lucky.socialswap.com/logo.svg",
"app_name": "lucky",
"app_url": "https://lucky.socialswap.com"
}
API2. Fetch authorization code
GET
/_api/client/r0/oauth/authorize
Obtain authorization code.
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
redirect_uri |
string |
Required: Registered authorized client callback address |
response_type |
enum |
Required: Value MUST be set to “code”. One of: |
Responses
Status | Description |
---|---|
200 |
Obtain authorization code. |
200 response
{
"authorization_code": "53ddd55b-c1c9-49b8-b623-0951351171ab"
}
API3. Fetch access token
GET
/_api/client/r0/oauth/token
The APP server obtains access token.
Rate-limited: | No |
---|---|
Requires authentication: | No |
Request
Request parameters
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
client_secret |
string |
Required: secret of the registered authorized client |
code |
string |
Required: the authorization code |
grant_type |
enum |
Required: the grant_type is authorization_code in this api One of: |
redirect_uri |
string |
Required: Registered authorized client callback address |
Responses
Status | Description |
---|---|
200 |
Returns the access token and expiration time. |
200 response
{
"access_token": "WfahChSreaLpRdEEhEEZShha",
"expires_in": 604800
}
API4. Get user info
GET
/_api/client/r0/oauth/get_user_info
Gets information about the user info.
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
The access token |
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
Responses
Status | Description |
---|---|
200 |
The information of the user info. |
200 response
{
"avatar_url": "mxc://localhost:8080/2022-12-08_QPyibipqjwhQqGDI",
"blockchain": "Ethereum",
"displayname": "#bug555",
"medium": "did",
"network": "devnet",
"user_id": "@0x2be8ee0128c73d5d7033e7ce3d209814e0732972:localhost:8080",
"wallet_address": "0x2Be8ee0128C73d5D7033E7CE3d209814E0732972"
}
API5. Get room members list
GET
/_api/client/r0/oauth/get_room_members
Get the list of members(include power level) for this room. and the owner of the room.
curl --location '{homeserver}/_api/client/r0/oauth/get_room_members?client_id={client_id}&room_id={room_id} \
--header 'Authorization: Bearer {access-token}'
curl --location '{homeserver}/_api/client/r0/oauth/get_room_members?client_id={client_id}&room_id={room_id} \
--header 'Authorization: Bearer {access-token}'
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
Required: The access token |
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
room_id |
string |
Required: room id |
Responses
Status | Description |
---|---|
200 |
A list of members of the room and the owner of the room |
200 response
{
"members": [
{
"avatar_url": "https://static.sending.me/beam/120/@0x00bb58c7d86ff59db312e2e676fda8820502f697:localhost:8080?colors=02D69E,BC39FF,2C96FF,FF9A1C,106EEC\u0026\u0026square=true",
"blockchain": "Ethereum",
"display_name": "connor zhang",
"user_id": "@0x00bb58c7d86ff59db312e2e676fda8820502f697:localhost:8080",
"user_level": 100,
"wallet_address": "0x00bb58C7d86Ff59DB312E2E676fDa8820502f697"
},
{
"avatar_url": "https://static.sending.me/beam/120/@0xd1bfe1aa011255fc45f15929c2aa3a652cce38ec:localhost:8080?colors=02D69E,BC39FF,2C96FF,FF9A1C,106EEC\u0026\u0026square=true",
"blockchain": "Ethereum",
"display_name": "yhzhang-test",
"user_id": "@0xd1bfe1aa011255fc45f15929c2aa3a652cce38ec:localhost:8080",
"user_level": 100,
"wallet_address": "0xd1bFe1aa011255fC45F15929C2aa3A652ccE38EC"
},
{
"avatar_url": "https://static.sending.me/beam/120/@0x6c33126d15f86d37cedc9f5a5f069dcd46b7c7e6:localhost:8080?colors=02D69E,BC39FF,2C96FF,FF9A1C,106EEC\u0026\u0026square=true",
"blockchain": "Ethereum",
"display_name": "yhzhang-test",
"user_id": "@0x6c33126d15f86d37cedc9f5a5f069dcd46b7c7e6:localhost:8080",
"user_level": 50,
"wallet_address": "0x6c33126D15F86d37CEdc9f5a5F069DCD46B7C7E6"
}
],
"owner": "@0xd1bfe1aa011255fc45f15929c2aa3a652cce38ec:localhost:8080",
"total": 3
}
API6. Send room messages
GET
/_api/client/r0/oauth/send/m.room.message
send messages to a room.
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
The access token |
Request body
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
content |
object |
Required: Message structure |
room_id |
string |
Required: id of the room |
Request body example
{
"client_id": "6C75636B795F736F6369616C73776170",
"content": {
"body": "https://app-alpha.sending.me",
"msgtype": "m.text"
},
"room_id": "!tuKKVwEACyWeqdBRwN:localhost:8080"
}
Responses
Status | Description |
---|---|
200 |
return the event id. |
200 response
{
"event_id": "$WaBQ5gTwTorRX-34HQCfKeM4kD3x3_-e2RSOrp9TyDA"
}
API7. Whether the user is in a room
GET
/_api/client/r0/oauth/user_in_room
Whether the user is in a room.
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
Required: The access token |
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
room_id |
string |
Required: room id |
Responses
Status | Description |
---|---|
200 |
return the boolean value of user_in_room. |
200 response
{
"user_in_room": false
}
API8. Get contact information based on wallet_address (paging)
GET
/_api/client/r0/oauth/contacts
Get contact information based on wallet_address (paging).
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
Required: The access token |
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
limit |
integer |
Quantity per page (default - 100) |
offset |
integer |
Paging shift (default - 0) |
wallet_address |
string |
the wallet address for user |
Responses
Status | Description |
---|---|
200 |
return contact list. |
200 response
{
"contacts": [
{
"avatar_url": "https://hs-alpha.sending.me/_api/media/r0/thumbnail/hs-alpha.sending.me/0x5a4ffe4896673da1c95e165f24030640f7016771_17?width=48\u0026height=48",
"displayname": "6081.bnb",
"user_id": "@0x0f83535ba873602491d261538173a064b80ee266:hs-alpha.sending.me",
"wallet_address": "0x0F83535BA873602491D261538173A064B80eE266"
},
{
"avatar_url": "https://hs-alpha.sending.me/_api/media/r0/thumbnail/hs-alpha.sending.me/0x1a223494ed356c2990803ec5d904389e8feec1a2_3186?width=48\u0026height=48",
"displayname": "luna❤.eth",
"user_id": "@0xe6d0dd18c6c3a9af8c2fab57d6e6a38e29d513cc:hs-alpha.sending.me",
"wallet_address": "0xE6D0Dd18C6C3a9Af8C2FaB57d6e6A38E29d513cC"
}
]
}
API9. Gets the user’s room roles
GET
/_api/client/r0/oauth/user_power_level
Gets user power level about the room.
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
Required: The access token |
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
room_id |
string |
Required: room id |
Responses
Status | Description |
---|---|
200 |
0 User - 50 Moderator - 100 Admin. |
200 response
{
"user_level": 50
}
API10. Get room details
GET
/_api/client/r0/oauth/get_room_info
Get room details.
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
Required: The access token |
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
room_id |
string |
Required: room id |
Responses
Status | Description |
---|---|
200 |
return room info. |
200 response
{
"avatar": "mxc://hs-alpha.sending.me/qccicMZttAenvjOCBehXaoEK",
"name": "nba",
"topic": "a new world"
}
API11. Get joined squad info
GET
/_api/client/r0/oauth/get_joined_squads_info
Get the list of squads for this member.
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
Required: The access_token returned by a call to /oauth/token |
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
Responses
Status | Description |
---|---|
200 |
A member joined squad list |
400 |
The oauth access token is not invalid |
200 response
[
{
"avatar": "mxc://localhost:8080/vtbytVHZBkpfALgFNSvQDUpR",
"background": "",
"name": "show45",
"room_id": "!wuBOSRQZKAxrDSjekY:localhost:8080",
"topic": ""
},
{
"avatar": "mxc://localhost:8080/XxQLkVtPLLwSbhYOjdrukYlf",
"background": "",
"name": "show46",
"room_id": "!xzZiGBMSXuQhIzWkmQ:localhost:8080",
"topic": ""
}
]
400 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_MISSING_PARAM",
"error": "Missing param: client_id"
}
API12. Get user joined room info in special squad
GET
/_api/client/r0/oauth/get_user_joined_room_in_squad
Get the list of rooms for this member in this squad.
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
Required: The access_token returned by a call to /oauth/token |
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
room_id |
string |
Required: the squad id |
Responses
Status | Description |
---|---|
200 |
A joined squad list |
400 |
The client_id or room_id is missed |
403 |
The room_id is invalid or is not squad id |
200 response
[
{
"name": "aaa",
"room_id": "!RXDAsvnNeFzbBUOLtk:localhost:8080"
},
{
"avatar": "mxc://localhost:8080/hYAOJWyorWbCSQhdcGQaramc",
"name": "Random",
"room_id": "!MBgTfFQhYFUkODZKqn:localhost:8080"
},
{
"avatar": "mxc://localhost:8080/ysDBvcZRnvojaIAmaPILlpnb",
"name": "General",
"room_id": "!tCmXaHDlBdqxnQvbNU:localhost:8080"
}
]
400 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_MISSING_PARAM",
"error": "Missing param: client_id or room_id"
}
403 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_MISSING_PARAM",
"error": "INVALID param: room_id is not invalid"
}
API13. Get room base info by room id
GET
/_api/client/r0/oauth/room_base_info/{room_id}
Get room base info by room id
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
Required: The access_token returned by a call to /oauth/token |
Name | Type | Description |
---|---|---|
room_id |
string |
Required: The room id |
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
Responses
Status | Description |
---|---|
200 |
get the room base info successfully |
400 |
The client id is not empty |
403 |
room id is invalid |
200 response
{
"creator": "@0x00bb58c7d86ff59db312e2e676fda8820502f697:localhost:8080",
"has_auth_chain_index": 1,
"is_public": 0,
"preset": "public_chat",
"room_id": "!xzZiGBMSXuQhIzWkmQ:localhost:8080",
"room_type": 1
}
400 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_MISSING_PARAM",
"error": "Missing param: client_id"
}
403 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_INVALID_PARAM",
"error": "INVALID param: room_id is not invalid"
}
API14. Get parent squad id by room id
GET
/_api/client/r0/oauth/get_squad_id_by_room_id/{room_id}
Get squad id by room id the curl example:
curl --location '{homeserver}/_api/client/r0/oauth/get_squad_id_by_room_id/!xxyruAKxWSuZPpsFae:localhost:8080?client_id=68747470733A2F2F7777772E6E6F74696F6E2E736F' \
--header 'Authorization: Bearer WKQJcBOsAooyUAEYMvyKfJcPiaEBEPwh'
curl --location '{homeserver}/_api/client/r0/oauth/get_squad_id_by_room_id/!xxyruAKxWSuZPpsFae:localhost:8080?client_id=68747470733A2F2F7777772E6E6F74696F6E2E736F' \
--header 'Authorization: Bearer WKQJcBOsAooyUAEYMvyKfJcPiaEBEPwh'
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
Required: The access_token returned by a call to /oauth/token |
Name | Type | Description |
---|---|---|
room_id |
string |
Required: The room id |
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
Responses
Status | Description |
---|---|
200 |
get the parent room id successfully |
400 |
The client id is not empty |
403 |
room id is invalid |
200 response
{
"squad_id": "xxxxxxxxx"
}
400 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_MISSING_PARAM",
"error": "Missing param: client_id"
}
403 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_INVALID_PARAM",
"error": "INVALID param: room_id is not invalid or is a squad id"
}
API15. Get room base info in squad
GET
/_api/client/r0/oauth/rooms_in_squad/{room_id}
Get the list of rooms. the curl example
curl --location '{homeserver}/_api/client/r0/oauth/rooms_in_squad/!xzZiGBMSXuQhIzWkmQ:localhost:8080?client_id=68747470733A2F2F7777772E6E6F74696F6E2E736F' \
--header 'Authorization: Bearer WKQJcBOsAooyUAEYMvyKfJcPiaEBEPwh'
curl --location '{homeserver}/_api/client/r0/oauth/rooms_in_squad/!xzZiGBMSXuQhIzWkmQ:localhost:8080?client_id=68747470733A2F2F7777772E6E6F74696F6E2E736F' \
--header 'Authorization: Bearer WKQJcBOsAooyUAEYMvyKfJcPiaEBEPwh'
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
Required: The access_token returned by a call to /oauth/token |
Name | Type | Description |
---|---|---|
room_id |
string |
Required: the squad id |
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
Responses
Status | Description |
---|---|
200 |
A joined squad list |
400 |
The client_id is missed |
403 |
room_id is not invalid or is not a squad id |
405 |
you are not in the squad |
200 response
[
{
"name": "aaa",
"room_id": "!RXDAsvnNeFzbBUOLtk:localhost:8080"
},
{
"name": "General",
"room_id": "!VIEqJhAXnNdcqWDyvY:localhost:8080"
},
{
"name": "aaa",
"room_id": "!sjpStbMZMjvHFUssOJ:localhost:8080"
},
{
"name": "Random",
"room_id": "!uNNlJnbomanxSXyevJ:localhost:8080"
}
]
400 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_MISSING_PARAM",
"error": "Missing param: client_id"
}
403 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_INVALID_PARAM",
"error": "INVALID param: room_id is not invalid or is not a squad id"
}
405 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_INVALID_PARAM",
"error": "INVALID param: you are not in the squad"
}
API16. Get all rooms in special squad
GET
/_api/client/r0/oauth/rooms_in_squad/{room_id}
the room put in owner home default, put room in Squad
curl --location --request GET 'http://localhost:8080/_api/client/r0/oauth/rooms_in_squad/!dwngyMfBIaPExsDeyq:localhost:8080?client_id=68747470733A2F2F7777772E6E6F74696F6E2E736F' \
--header 'Authorization: Bearer WKQJcBOsAooyUAEYMvyKfJcPiaEBEPwh'
curl --location --request GET 'http://localhost:8080/_api/client/r0/oauth/rooms_in_squad/!dwngyMfBIaPExsDeyq:localhost:8080?client_id=68747470733A2F2F7777772E6E6F74696F6E2E736F' \
--header 'Authorization: Bearer WKQJcBOsAooyUAEYMvyKfJcPiaEBEPwh'
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
The access token |
Name | Type | Description |
---|---|---|
room_id |
string |
The special squad |
Name | Type | Description |
---|---|---|
client_id |
string |
The id on behalf of a third party |
Responses
Status | Description |
---|---|
200 |
The room data(room_id, name,avatar). If no rooms are found, then an array with an empty
response body will be returned ([] ). |
200 response
[
{
"name": "show34",
"room_id": "!BThSBrQnnHjWYiKnDg:localhost:8080"
},
{
"name": "show12",
"room_id": "!EAVQFuDHnwbAklZthF:localhost:8080"
},
{
"avatar": "mxc://localhost:8080/hYAOJWyorWbCSQhdcGQaramc",
"name": "Random",
"room_id": "!MBgTfFQhYFUkODZKqn:localhost:8080"
},
{
"avatar": "mxc://localhost:8080/ysDBvcZRnvojaIAmaPILlpnb",
"name": "General",
"room_id": "!tCmXaHDlBdqxnQvbNU:localhost:8080"
}
]
API17. Create AMA activity in SendingMe APP
POST
/_api/client/r0/oauth/ama_activity/{room_id}/create
create ama activity in sendingMe app. the curl example.
curl --location 'http://localhost:8080/_api/client/r0/oauth/ama_activity/!VWWINVsAdeGWqaAjlv:localhost:8080/create?client_id=68747470733A2F2F7777772E6E6F74696F6E2E736F' \
--header 'Authorization: Bearer WKQJcBOsAooyUAEYMvyKfJcPiaEBEPwh' \
--header 'Content-Type: application/json' \
--data '{
"title": "Web3 2049",
"description":"sdsdsdssssssssssssssssssssssss",
"start_time": 124546565675
}'
curl --location 'http://localhost:8080/_api/client/r0/oauth/ama_activity/!VWWINVsAdeGWqaAjlv:localhost:8080/create?client_id=68747470733A2F2F7777772E6E6F74696F6E2E736F' \
--header 'Authorization: Bearer WKQJcBOsAooyUAEYMvyKfJcPiaEBEPwh' \
--header 'Content-Type: application/json' \
--data '{
"title": "Web3 2049",
"description":"sdsdsdssssssssssssssssssssssss",
"start_time": 124546565675
}'
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
The access token |
Name | Type | Description |
---|---|---|
room_id |
string |
The room_id(not squad id) |
Request body
Name | Type | Description |
---|---|---|
description |
string |
Required: the detail of the ama activity. |
start_time |
integer |
Required: the start_time(ms) of the activity |
title |
string |
Required: A room Id. |
Request body example
{
"description": "sdsdsdssssssssssssssssssssssss",
"start_time": 124546565675,
"title": "Web3 2049"
}
Responses
Status | Description |
---|---|
200 |
An ID of the activity. |
200 response
Name | Type | Description |
---|---|---|
id |
string |
Required: A unique identifier for the activity. |
{
"id": "qzDGfGODhlQuvYXZEdTvHURvDTHCBACy"
}
API18. Get all squads that you are the owner
GET
/_api/client/r0/oauth/get_owner_squads
Get all user own squads
curl --location --request GET 'http://localhost:8080/_api/client/r0/oauth/get_owner_squads?client_id=68747470733A2F2F7777772E6E6F74696F6E2E736F' \
--header 'Authorization: Bearer bLQThbUxjCqpDeiwcOnHPUnMkquVEcKq'
curl --location --request GET 'http://localhost:8080/_api/client/r0/oauth/get_owner_squads?client_id=68747470733A2F2F7777772E6E6F74696F6E2E736F' \
--header 'Authorization: Bearer bLQThbUxjCqpDeiwcOnHPUnMkquVEcKq'
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
Required: The access token |
Name | Type | Description |
---|---|---|
client_id |
string |
Required: The id on behalf of a third party |
filter_snapshot |
boolean |
There is no filter by default,
return squads which has been binded with snapshot space when filter_snapshot is true,
return others when filter_snapshot is false. |
Responses
Status | Description |
---|---|
200 |
The squad data. If no squads are found, then an object with an empty
response body will be returned ([] ). |
200 response
[
{
"avatar": "https://localhost:8080/_api/media/r0/download/localhost:8080/fVtxAsizrJxxPawyFvNoicTA",
"name": "yhzhang-test2",
"room_alias": "#yhzhang-test2:localhost:8080",
"squad_id": "!dwngyMfBIaPExsDeyq:localhost:8080"
}
]
API19. Upload files to sendingMe
POST
/_api/media/r0/oauth_upload
upload file to sendingMe
curl --location 'http://{homeserver}/_api/media/r0/oauth_upload?client_id=68747470733A2F2F7777772E6E6F74696F6E2E736F&filename=pageRotateImage_1.jpg' \
--header 'Authorization: Bearer WKQJcBOsAooyUAEYMvyKfJcPiaEBEPwh' \
--header 'Content-Type: image/jpeg' \
--data '@/home/pc/下载/pageRotateImage_1.jpg'
curl --location 'http://{homeserver}/_api/media/r0/oauth_upload?client_id=68747470733A2F2F7777772E6E6F74696F6E2E736F&filename=pageRotateImage_1.jpg' \
--header 'Authorization: Bearer WKQJcBOsAooyUAEYMvyKfJcPiaEBEPwh' \
--header 'Content-Type: image/jpeg' \
--data '@/home/pc/下载/pageRotateImage_1.jpg'
Rate-limited: | Yes |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
The access token that API3(Fetch access token) returns |
Content-Type |
string |
The content type of the file being uploaded |
Name | Type | Description |
---|---|---|
client_id |
string |
id of the registered authorized client |
filename |
string |
The name of the file being uploaded |
Request body
Request body example
"<bytes>"
Responses
Status | Description |
---|---|
200 |
The MXC URI for the uploaded content. |
403 |
The user does not have permission to upload the content. Some reasons for this error include:
|
413 |
The uploaded content is too large for the server. |
429 |
This request was rate-limited. |
200 response
Name | Type | Description |
---|---|---|
content_uri |
string |
Required: The MXC URI to the uploaded content. |
{
"content_uri": "mxc://example.com/AQwafuaFswefuhsfAFAgsw"
}
403 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_FORBIDDEN",
"error": "Cannot upload this content"
}
413 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_TOO_LARGE",
"error": "Cannot upload files larger than 100mb"
}
429 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: The M_LIMIT_EXCEEDED error code |
error |
string |
A human-readable error message. |
retry_after_ms |
integer |
The amount of time in milliseconds the client should wait before trying the request again. |
{
"errcode": "M_LIMIT_EXCEEDED",
"error": "Too many requests",
"retry_after_ms": 2000
}
API20. Create squad
POST
/_api/client/r0/oauth/createRoom
Create a new Squad
curl --location 'http://localhost:8080/_api/client/r0/oauth/createRoom' \
--header 'Authorization: Bearer WKQJcBOsAooyUAEYMvyKfJcPiaEBEPwh' \
--header 'Content-Type: application/json' \
--data '{
"name":"yhzhang-test1111",
"client_id":"68747470733A2F2F7777772E6E6F74696F6E2E736F",
"room_alias_name":"yhzhang-test11234",
"creation_content": {
"type": "m.space"
},
"initial_state": [{
"type": "m.room.avatar",
"content": {
"url": "mxc://localhost:8080/LyZyBcvugNtgJqHIRZMNyqdj"
}
}]
}'
curl --location 'http://localhost:8080/_api/client/r0/oauth/createRoom' \
--header 'Authorization: Bearer WKQJcBOsAooyUAEYMvyKfJcPiaEBEPwh' \
--header 'Content-Type: application/json' \
--data '{
"name":"yhzhang-test1111",
"client_id":"68747470733A2F2F7777772E6E6F74696F6E2E736F",
"room_alias_name":"yhzhang-test11234",
"creation_content": {
"type": "m.space"
},
"initial_state": [{
"type": "m.room.avatar",
"content": {
"url": "mxc://localhost:8080/LyZyBcvugNtgJqHIRZMNyqdj"
}
}]
}'
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
The access token that API3(Fetch access token) returns |
Request body
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
creation_content |
CreationContent |
Required: Type “m.space” represents a squad. If no “creation_content” in parameters, by default the room will be created |
initial_state |
[StateEvent] |
Required: A list of state events to set in the new room. This allows the user to override the default state events set in the new room. The expected format of the state events are an object with type, state_key and content keys set. Takes precedence over events set by |
name |
string |
Required: If this is included, an m.room.name event will be sent
into the room to indicate the name of the room. See Room
Events for more information on m.room.name . |
room_alias_name |
string |
Required: The desired room alias local part. If this is included, a
room alias will be created and mapped to the newly created
room. The alias will belong on the same homeserver which
created the room. For example, if this was set to “foo” and
sent to the homeserver “example.com” the complete room alias
would be The complete room alias will become the canonical alias for
the room and an |
Name | Type | Description |
---|---|---|
content |
object |
Required: The content of the event. |
state_key |
string |
The state_key of the state event. Defaults to an empty string. |
type |
string |
Required: The type of event to send. “m.room.avatar” represents a avatar of the squad you creates |
Request body example
{
"client_id": "68747470733A2F2F7777772E6E6F74696F6E2E736F",
"creation_content": {
"type": "m.space"
},
"initial_state": [
{
"content": {
"url": "mxc://localhost:8080/LyZyBcvugNtgJqHIRZMNyqdj"
},
"type": "m.room.avatar"
}
],
"name": "yhzhang-test1111",
"room_alias_name": "yhzhang-test11234"
}
Responses
Status | Description |
---|---|
200 |
Information about the newly created room. |
400 |
The request is invalid. A meaningful
|
200 response
Name | Type | Description |
---|---|---|
room_id |
string |
Required: The created room’s ID. |
{
"room_alias": "#yhzhang-test111:localhost:8080",
"room_id": "!rbrwRgtDMyheefNQch:localhost:8080"
}
400 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_UNKNOWN",
"error": "An unknown error occurred"
}
API21. Create room
POST
/_api/client/r0/oauth/createRoom
Create a room that belongs to a squad.
curl --location 'http://localhost:8080/_api/client/r0/oauth/createRoom' \
--header 'Authorization: Bearer WKQJcBOsAooyUAEYMvyKfJcPiaEBEPwh' \
--header 'Content-Type: application/json' \
--data '{
"name": "a4",
"client_id":"68747470733A2F2F7777772E6E6F74696F6E2E736F",
"initial_state": [
{
"type": "m.room.join_rules",
"content": {
"join_rule": "public"
}
},
{
"type": "m.space.parent",
"content": {
"via": [
"localhost:8080"
],
"canonical": true
},
"state_key": "!bOTqPHjJBTVFBQBHdQ:localhost:8080"
}
]
}'
curl --location 'http://localhost:8080/_api/client/r0/oauth/createRoom' \
--header 'Authorization: Bearer WKQJcBOsAooyUAEYMvyKfJcPiaEBEPwh' \
--header 'Content-Type: application/json' \
--data '{
"name": "a4",
"client_id":"68747470733A2F2F7777772E6E6F74696F6E2E736F",
"initial_state": [
{
"type": "m.room.join_rules",
"content": {
"join_rule": "public"
}
},
{
"type": "m.space.parent",
"content": {
"via": [
"localhost:8080"
],
"canonical": true
},
"state_key": "!bOTqPHjJBTVFBQBHdQ:localhost:8080"
}
]
}'
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
The access token that API3(Fetch access token) returns |
Request body
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
initial_state |
[StateEvent] |
Required: A list of state events to set in the new room. This allows the user to override the default state events set in the new room. The expected format of the state events are an object with type, state_key and content keys set. Takes precedence over events set by The type of event to send. public – anyone can join the room without any prior action. “m.space.parents” |
name |
string |
Required: The room name |
Name | Type | Description |
---|---|---|
content |
object |
Required: The content of the event. |
state_key |
string |
The state_key of the state event. Defaults to an empty string. |
type |
string |
Required: The type of event to send. |
Request body example
{
"client_id": "68747470733A2F2F7777772E6E6F74696F6E2E736F",
"initial_state": [
{
"content": {
"join_rule": "public"
},
"type": "m.room.join_rules"
},
{
"content": {
"canonical": true,
"via": [
"localhost:8080"
]
},
"state_key": "!bOTqPHjJBTVFBQBHdQ:localhost:8080",
"type": "m.space.parent"
}
],
"name": "a4"
}
Responses
Status | Description |
---|---|
200 |
Information about the newly created room. |
400 |
The request is invalid. A meaningful
|
200 response
Name | Type | Description |
---|---|---|
room_id |
string |
Required: The created room’s ID. |
{
"room_id": "!sefiuhWgwghwWgh:example.com"
}
400 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_UNKNOWN",
"error": "An unknown error occurred"
}
API22. Put room in squad
PUT
/_api/client/r0/oauth/rooms/{squad_id}/state/{event_type}/{room_id}
the room was defaultly put in owner home. This api can put room to Squad that belongs to
curl --location --request PUT '{homeserver}/_api/client/r0/oauth/rooms/!dwngyMfBIaPExsDeyq%3Alocalhost%3A8080/state/m.space.child/!BThSBrQnnHjWYiKnDg%3Alocalhost%3A8080?client_id=68747470733A2F2F7777772E6E6F74696F6E2E736F' \
--header 'Authorization: Bearer WKQJcBOsAooyUAEYMvyKfJcPiaEBEPwh' \
--header 'Content-Type: application/json' \
--data-raw '{"suggested": false,"auto_join":false}'
curl --location --request PUT '{homeserver}/_api/client/r0/oauth/rooms/!dwngyMfBIaPExsDeyq%3Alocalhost%3A8080/state/m.space.child/!BThSBrQnnHjWYiKnDg%3Alocalhost%3A8080?client_id=68747470733A2F2F7777772E6E6F74696F6E2E736F' \
--header 'Authorization: Bearer WKQJcBOsAooyUAEYMvyKfJcPiaEBEPwh' \
--header 'Content-Type: application/json' \
--data-raw '{"suggested": false,"auto_join":false}'
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
The oauth access token |
Name | Type | Description |
---|---|---|
event_type |
string |
Required: the message of the event, this is “m.space.child” |
room_id |
string |
Required: the room id that belongs to squad |
squad_id |
string |
Required: The squad id |
Request body
Name | Type | Description |
---|---|---|
auto_join |
boolean |
Optional (default false) |
suggested |
boolean |
Optional (default false) flag to denote whether the child is “suggested” or of interest to members of the space. This is primarily intended as a rendering hint for clients to display the room differently, such as eagerly rendering them in the room list. |
Request body example
{
"auto_join": false,
"suggested": false
}
Responses
Status | Description |
---|---|
200 |
put room in squad successfully. |
200 response
{
"event_id": "$-4PiIsIpnRwS_epcdFBkx3mcElRqTPIaE-ie6JUDo6E"
}
API23. Get joined groups info
GET
/_api/client/r0/oauth/user_joined_group
Get the list of groups info for this user.
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
Required: The access_token returned by a call to /oauth/token |
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
Responses
Status | Description |
---|---|
200 |
The joined groups list of user |
400 |
The oauth access token is not invalid |
200 response
[
{
"avatar": "mxc://localhost:8080/vtbytVHZBkpfALgFNSvQDUpR",
"name": "show45",
"room_id": "!wuBOSRQZKAxrDSjekY:localhost:8080"
},
{
"avatar": "",
"name": "show46",
"room_id": "!xzZiGBMSXuQhIzWkmQ:localhost:8080"
}
]
400 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_MISSING_PARAM",
"error": "Missing param: client_id"
}
API23. Get user wallets info
GET
/_api/client/r0/oauth/get_user_wallets
Gets a list of user transaction wallet addresses order by net_worth
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
The access token |
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client |
Responses
Status | Description |
---|---|
200 |
The list of user transaction wallet addresses |
200 response
[
{
"net_worth": "79.96",
"verify_source": "login",
"wallet_address": "0xba81588c8bb0f4bf6d4f7282e8d3ea780b5627a1"
},
{
"net_worth": "19.07",
"verify_source": "metamask",
"wallet_address": "0x3fbd97eaa8c435ba03d1134252eac6eecd3f794b"
},
{
"net_worth": "0.91",
"verify_source": "looksrare",
"wallet_address": "0x2be8ee0128c73d5d7033e7ce3d209814e0732972"
}
]
Client OAuth Snapshot API
API1 Snapshot Space
GET
/_api/client/r0/oauth/snapshot/proposal
Query Snapshot proposals with squad id.
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
The access_token returned by a call to /oauth/token |
Name | Type | Description |
---|---|---|
client_id |
string |
id of the registered authorized client. client_id is a required param in query or body |
squad_id |
string |
The squad_id of sqaud ownded by current user. |
Request body
Name | Type | Description |
---|---|---|
client_id |
string |
id of the registered authorized client. client_id is a required param in query or body |
Request body example
{
"cient_id": "6C75636B795F736F6369616C73776170"
}
Responses
Status | Description |
---|---|
200 |
The operation is ok. |
400 |
The authorization is not invalid |
200 response
Array of Proposal
.
Name | Type | Description |
---|---|---|
author |
string |
author |
author_profile |
AuthorProfile |
author profile |
body |
string |
body |
choices |
[] |
choices |
end |
integer |
end |
id |
string |
id |
snapshot |
string |
snapshot |
space |
Space |
space |
start |
integer |
start |
state |
string |
state: pending|closed|active |
title |
string |
title |
vote_details |
[VoteDetail] |
vote details |
votes |
string |
votes count |
Name | Type | Description |
---|---|---|
abort |
string |
|
avatar |
string |
|
id |
string |
|
name |
string |
Name | Type | Description |
---|---|---|
id |
string |
|
name |
string |
Name | Type | Description |
---|---|---|
avatar |
string |
avatar |
choice |
integer |
choice |
created |
integer |
create time |
ipfs |
string |
ipfs |
reason |
string |
reason |
voter |
string |
voter address |
vp |
number |
vp |
vp_by_strategy |
[] |
[
{
"author": "0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4",
"author_profile": {
"about": "0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4",
"avatar": "https://cdn.stamp.fyi/avatar/eth:0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4?s=36",
"id": "0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4",
"name": "0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4"
},
"body": "- --\n**Title:** [TEMP CHECK] Aave V3 deployment on BNB Chain.\n\n**Author:** @marczeller - Aave-Chan Initiative\n\n**Date:** 2023-03-22\n- --\n\n## **Simple Summary**\n\nThis Temperature Check seeks community input on the possibility of deploying Aave V3 on the BNB Chain to expand Aave's presence and tap into BNB Chain's growing DeFi ecosystem and user base.\n\n## **Background**\n\nBNB Chain is a thriving blockchain with a strong DeFi ecosystem and a large user base. With a TVL of approximately $5 billion, BNB Chain is the third-largest chain by TVL. The chain has a diverse array of DeFi offerings, including prominent projects like PancakeSwap, Venus, and several others. Deploying Aave V3 on BNB Chain could provide opportunities for growth and collaboration between the Aave and BNB Chain communities.\n\n## **Motivation**\n\nDeploying Aave V3 on BNB Chain has the potential to benefit both Aave and BNB Chain ecosystems. Aave would gain access to BNB Chain's user base, DeFi ecosystem, and the potential for additional revenue. BNB Chain would benefit from having a flagship DeFi project like Aave on its platform, further diversifying DeFi options available to its users.\n\n## **Specification**\n\nThis TEMP CHECK presents the Aave governance with the opportunity to deploy Aave V3 on the BNB Chain with a selection of suitable assets for collateral, including BNB, WBTC, BETH, WETH, USDC, and USDT. Suggested risk parameters for each asset are provided in the table below. The ACI invites risk service providers teams to provide feedback on them.\n\n| Risk Parameter | BNB | WBTC | BETH | WETH | USDC | USDT |\n| --- | --- | --- | --- | --- | --- | --- |\n| Isolation Mode | NO | NO | NO | NO | NO | NO |\n| Enable Borrow | NO | NO | NO | NO | YES | YES |\n| Enable Collateral | YES | YES | YES | YES | YES | YES |\n| Emode Category | N/A | N/A | N/A | N/A | N/A | N/A |\n| Loan To Value | 65% | 70% | 60% | 80% | 82.5% | 70% |\n| Liquidation Threshold | 70% | 75% | 70% | 82.5% | 85% | 75% |\n| Liquidation Bonus | 10% | 10% | 5% | 5% | 5% | 8.5% |\n| Reserve Factor | 10% | 10% | 15% | 15% | 10% | 10% |\n| Liquidation Protocol Fee | 10% | 10% | 10% | 10% | 10% | 10% |\n| Borrow Cap | N/A | N/A | N/A | 80.000 | 20,000,000 | 20.000.000 |\n| Supply Cap | 5,000,000 | 5,000 | 20,000 | 100,000 | 50,000,000 | 50,000,000 |\n| Debt Ceiling | N/A | N/A | N/A | N/A | N/A | N/A |\n| uOptimal | 75% | 45% | 45% | 80% | 80% | 80% |\n| Base | 0% | 0% | 0% | 0% | 0% | 0% |\n| Slope1 | 6.1% | 7% | 7% | 4.8% | 4% | 4% |\n| Slope2 | 100% | 300% | 300% | 80% | 80% | 80% |\n\n## **Disclaimer**\n\nThe Aave-Chan Initiative (ACI) is not compensated in any form by Binance \u0026 BNB for creating this Temperature Check proposal. This TEMP CHECK has been prepared solely to facilitate community discussion.\nAt the time of writing, the author owns ~75$ worth of assets on the BNB chain.\n\n## **Next Steps**\n\nTemperature Check: Gather community feedback and assess sentiment towards the proposal of deploying Aave V3 on BNB Chain.\n\nARFC: If the Temperature Check Snapshot indicates positive sentiment, proceed to the ARFC stage for further discussion, risk parameter evaluation network analysis and finalization of the proposal.\n\nAIP: If the ARFC stage Snapshot is successful, submit the proposal as an AIP for voting and on-chain governance approval.",
"choices": [
"YAE",
"NAY",
"ABSTAIN"
],
"end": 1680343200,
"id": "0x4579b562a4ea07c52871f724a8baf156514a97384e9427156d04fb6f0ae91515",
"snapshot": "16925332",
"space": {
"id": "aave.eth",
"name": "Aave"
},
"start": 1680084000,
"state": "pending",
"title": "[TEMP CHECK] Aave V3 deployment on BNB Chain",
"vote_details": [],
"votes": 0
},
{
"author": "0xc3c0f1E5D497dc6E6FAc9F8fBB548806a7e72CC0",
"author_profile": {
"about": "0xc3c0f1E5D497dc6E6FAc9F8fBB548806a7e72CC0",
"avatar": "https://cdn.stamp.fyi/avatar/eth:0xc3c0f1E5D497dc6E6FAc9F8fBB548806a7e72CC0?s=36",
"id": "0xc3c0f1E5D497dc6E6FAc9F8fBB548806a7e72CC0",
"name": "0xc3c0f1E5D497dc6E6FAc9F8fBB548806a7e72CC0"
},
"body": "## Simple Summary\n\nA proposal to adjust five (5) total risk parameters, including Loan-to-Value, Liquidation Threshold, and Liquidation Bonus, across two (2) Aave V3 Optimism assets.\n\n## Motivation\n\nChaos Labs’ Parameter Recommendation Platform runs hundreds of thousands of agent-based off-chain and on-chain simulations to examine how different Aave V3 risk parameters configurations would behave under adverse market conditions - and find the optimal values to maximize protocol borrow usage while minimizing losses from liquidations and bad debt. \n\n*Note: As a general guideline, we limit the proposed changes by +-3% for all parameters as a high/low bound for a given proposal. This ensures more controlled changes and allows us to analyze their effect on user behavior before recommending further amendments to the parameters if the optimal configuration is outside this range.*\n\nPlease find more information on the parameter recommendation methodology [here](https://community.chaoslabs.xyz/aave/recommendations/methodology).\n\nYou can also view the simulation results and breakdown for the different assets by clicking on them on this [page](https://community.chaoslabs.xyz/aave/recommendations).\n\nThe output of our simulations reveals an opportunity to increase LTVs and LTs for WBTC and DAI on V3 Optimism, resulting in improved capital efficiency of the system, with no effect on the projected VaR (95th percentile of the protocol losses that will be accrued due to bad debt from under-collateralized accounts over 24 hours) and EVaR (Extreme VaR, the 99th percentile of the protocol losses that will be accrued due to bad debt from under-collateralized accounts over 24 hours)\n\n**Simulating all changes jointly yields a projected borrow increase of ~$155,000, with no increase in VaR and Extreme VaR compared to simulations with the current parameters.**\n\n \n![Untitled (30) (1).png](ipfs://bafkreifsuvfdgldiuwht446nposyfqsxkt5xatmfoh2xlqpfohsu6ozdne)\n\n \n![Untitled (31) (1).png](ipfs://bafkreif7g5o5w7coateogkysbd6sclmcbxbxqggbdkidd24bisuvzoasgi)\n \n \n\n### Liquidity Analysis:\n\nThe TVL in Aave on Optimism (118.71M$) is concentrated primarily on three blue-chip, high-liquidity assets, which together account for ~75% of the supplied assets in $ values: USDC (34%), WETH (28%), and WBTC (14%). Based on our analysis, we recommend increasing the Loan-To-Value (LTV) and Liquidation Threshold (LT) for WBTC and DAI, as we have determined that there is adequate on-chain liquidity to support significant liquidations. Similarly, we recommend reducing the Liquidation Penalty for WBTC, which is set conservatively at 10% to a lower level (8.5%) closer to that of USDC and Ethereum (5%).\n\n### Positions Analysis\n\nWe have not identified any outsized positions that are actively affecting our recommendations. However, we should call out that ~40% of the on-chain supply of WBTC on Optimism is currently held on Aave, which calls for some caution. We have already proposed and implemented an [amendment to the supply cap](https://governance.aave.com/t/arc-chaos-labs-supply-and-borrow-cap-updates-aave-v3-2023-02-24/12048/4) to limit the concentration of liquidity on Aave.\n\nGiven the blue-chip nature of BTC/WBTC, we expect significant arbitrage buying pressure to offset any slippage that may be created by future liquidations of WBTC and, therefore, recommend reducing the Liquidation Penalty even with the current significant liquidity concentration on Aave. We expect a lower LP to drive liquidators to liquidate positions in smaller portions, pacing the process and allowing the market more time to react. \n\n### Recommendations\n\n| Asset | Parameter | Current | Rec | Change |\n| --- | --- | --- | --- | --- |\n| WBTC | Liquidation Threshold | 75% | 78% | +3% |\n| WBTC | Loan-to-Value | 70% | 73% | +3% |\n| WBTC | Liquidation Penalty | 10% | 8.5% | -1.5% |\n| DAI | Liquidation Threshold | 80% | 83% | +3% |\n| DAI | Loan-to-Value | 75% | 78% | +3% |",
"choices": [
"YAE",
"NAE",
"Abstain"
],
"end": 1680289200,
"id": "0x774c478f3adf4b238c73180b5adad589e008c6857b5e514ae5213ecf67c5c81f",
"snapshot": "16920662",
"space": {
"id": "aave.eth",
"name": "Aave"
},
"start": 1680030000,
"state": "pending",
"title": "[ARFC] - Chaos Labs Risk Parameter Updates - Aave V3 Optimism - 2023.03.22",
"vote_details": [],
"votes": 0
},
{
"author": "0xc3c0f1E5D497dc6E6FAc9F8fBB548806a7e72CC0",
"author_profile": {
"about": "0xc3c0f1E5D497dc6E6FAc9F8fBB548806a7e72CC0",
"avatar": "https://cdn.stamp.fyi/avatar/eth:0xc3c0f1E5D497dc6E6FAc9F8fBB548806a7e72CC0?s=36",
"id": "0xc3c0f1E5D497dc6E6FAc9F8fBB548806a7e72CC0",
"name": "0xc3c0f1E5D497dc6E6FAc9F8fBB548806a7e72CC0"
},
"body": "\n## Summary\n\nAt the time of the launch of V3 Ethereum, no assets were configured as borrowable in Isolation Mode. In this proposal, Chaos Labs recommends enabling all stablecoins listed on V3 Ethereum as [borrowable in isolation mode](https://docs.aave.com/developers/whats-new/isolation-mode#borrow-in-isolated-mode).\n\n## Motivation\n\nThe motivation to list the stablecoins as borrowable assets in Isolation Mode is similar to previous deployments and is derived mainly from the low volatility of those assets. Given that Isolation Mode assets are susceptible to high volatility, we find it paramount to maintain the other side of the position stable in order to reduce liquidations and resulting bad debt.\n\n## Stablecoin Volatility\n\nBy observing chainlink prices of the 4 stablecoins on Ethereum V3, we have derived the following volatility measures:\n\n| | daily annualized volatility | 30-day annualized volatility |\n| --- | --- | --- |\n| USDC | 10.56% | 16.92% |\n| USDT | 10.19% | 7.94% |\n| DAI | 11.14% | 16.3% |\n| LUSD | 7.07% | 10.64% |\n\n**USDC**\n \n![Untitled (26) (1).png](ipfs://bafkreifwfenb72e3a3jtqhs43isf3xtldozsbvw2rt5iy2ny5mnsrjhdo4)\n \n**DAI**\n \n \n![Untitled (27) (1).png](ipfs://bafkreibtis34ggsfquwandisg5n7fxrm3wkyiruscgwbk5plba4zln435u)\n \n \n**USDT**\n\n![Untitled (28).jpg](ipfs://bafkreihcvrv2wxwqyzzu2okpr3emc3thoqog3easuscrrh57zs4eflvdd4)\n \n**LUSD**\n \n![Untitled (29) (1).png](ipfs://bafkreia6jnijcjiwornlwywqlah5eytqo2nsdy4sainfivuman62oyeaau)\n \n## Implementation\n\nWe recommend listing USDC, USDT, DAI, and LUSD as assets allowed for borrowing in Isolation Mode on Ethereum V3.\n\nThis proposal aims to implement a single AIP, which will simply call setBorrowableInIsolation() on the assets on the [PoolConfigurator](https://docs.aave.com/developers/core-contracts/poolconfigurator) contract.",
"choices": [
"YAE",
"NAE",
"Abstain"
],
"end": 1680289200,
"id": "0xef5eed1bdda3a7d6ea2b37b09c7de1960530bb54f24ddc6c7b002447251b6bb4",
"snapshot": "16920627",
"space": {
"id": "aave.eth",
"name": "Aave"
},
"start": 1680030000,
"state": "pending",
"title": "[ARFC] - Configure Isolation Mode Borrowable Assets - V3 Ethereum",
"vote_details": [],
"votes": 0
},
{
"author": "0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4",
"author_profile": {
"about": "0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4",
"avatar": "https://cdn.stamp.fyi/avatar/eth:0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4?s=36",
"id": "0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4",
"name": "0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4"
},
"body": "Title: [TEMP CHECK] - Aave V1 Offboarding Plan\n\nAuthor: @marczeller - Aave-Chan Initiative\n\nDate: 2023-03-17\n\n## **Simple Summary**\n\nThis Temperature Check proposes the offboarding of Aave V1 by implementing new rate strategies for all assets listed on the platform, encouraging users to migrate their assets to Aave V2 or Aave V3.\n\n## **Background**\n\nAave V1 has been frozen since December 2022, and users have been given ample time to migrate their assets to Aave V2 or Aave V3. As sufficient time has passed, it is now appropriate to move forward with the offboarding process for Aave V1.\n\n## **Motivation**\n\nAave V1 has served as a pioneering platform in the DeFi ecosystem. However, with the release of Aave V2 and Aave V3, it is essential to shift users and resources towards these more advanced and efficient platforms. By offboarding Aave V1 and encouraging migration to newer versions, we can ensure a more streamlined user experience and concentrate resources on continued development and improvements in the Aave ecosystem.\n\n## **Specification**\n\nThe offboarding plan will be executed by implementing new rate strategies for all assets listed on Aave V1. These rate strategies aim to incentivize users to migrate their assets to Aave V2 or Aave V3 by making borrowing and supplying less attractive on Aave V1. The new rate strategies will be applied to all assets listed on Aave V1.\n\n### **New Rate Strategies**\n\nFor each asset listed on Aave V1, new proposed values for the following parameters will be implemented:\n\n1. uOptimal: 20%\n2. reserveFactor: 99.9%\n3. base rate: 3%\n4. slope 1: 7%\n5. slope 2: 200%\n\nThese changes will make borrowing and supplying assets on Aave V1 less attractive compared to Aave V2 or Aave V3, encouraging users to migrate their assets to the newer platforms.\n\n## **Next Steps**\n\n1. Temperature Check: Gather community feedback and assess sentiment towards the proposal.\n2. ARFC: If the Temperature Check Snapshot indicates positive sentiment, proceed to the ARFC stage for further discussion and finalization of the proposal.\n3. AIP: If the ARFC stage Snapshot is successful, submit the proposal as an AIP for voting and on-chain governance approval.\n\n## **Copyright**\n\nCopyright and related rights waived via CC0.",
"choices": [
"YAE",
"NAY",
"ABSTAIN"
],
"end": 1680256800,
"id": "0xb0bfe6dcf39287e5af18fcd0cc3ed80506314a2f89735379d597f430ae5bd5c7",
"snapshot": "16917474",
"space": {
"id": "aave.eth",
"name": "Aave"
},
"start": 1679997600,
"state": "active",
"title": "[TEMP CHECK] - Aave V1 Offboarding Plan",
"vote_details": [
{
"avatar": "https://cdn.stamp.fyi/avatar/eth:0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4?s=36",
"choice": 1,
"created": 1680004620,
"ipfs": "bafkreiab5m7ub7szoxxwd2gl7uidolkacifri52afzsx6qmxi4ntggdssu",
"reason": "",
"voter": "0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4",
"vp": 241473.2651398454,
"vp_by_strategy": [
15000.198430393972,
226473.06670945144,
0,
0
]
},
{
"avatar": "https://cdn.stamp.fyi/avatar/eth:0xe15EBB6573496FD6860f7194285375FB94C9A7C2?s=36",
"choice": 1,
"created": 1680004996,
"ipfs": "bafkreidrvw32vfx3lhaf4ekwpq72msryipwlz3vhm57ywmtexvcel6o3lm",
"reason": "",
"voter": "0xe15EBB6573496FD6860f7194285375FB94C9A7C2",
"vp": 1.8789742403703196,
"vp_by_strategy": [
0,
1.8760283958947073,
0.002945844475612291,
0
]
},
{
"avatar": "https://cdn.stamp.fyi/avatar/eth:0xcEbFbd059F4b661077885C69c026BdbC8E67200a?s=36",
"choice": 1,
"created": 1680005523,
"ipfs": "bafkreied3plsqqhfqo456m7qt3qzgsws2fd5n5vfgyiiyu2jpddrhvfjka",
"reason": "",
"voter": "0xcEbFbd059F4b661077885C69c026BdbC8E67200a",
"vp": 1.081271343270059,
"vp_by_strategy": [
0,
1.081271343270059,
0,
0
]
},
{
"avatar": "https://cdn.stamp.fyi/avatar/eth:0x6447ce2117529A1FBc32AA06335b27CF3Ad14823?s=36",
"choice": 1,
"created": 1680006665,
"ipfs": "bafkreielnomqxsnmu5xsza3rixca5cntspifvmuyyc4rrkcbtjxsetakzm",
"reason": "",
"voter": "0x6447ce2117529A1FBc32AA06335b27CF3Ad14823",
"vp": 1.062,
"vp_by_strategy": [
0,
1.062,
0,
0
]
},
{
"avatar": "https://cdn.stamp.fyi/avatar/eth:0x764014a86fEf4e76f35dd2f7FABDEe94Ea05B0A1?s=36",
"choice": 1,
"created": 1680001395,
"ipfs": "bafkreicynsols7nlhy5hqgkpxhmgsaxb3bnp6zemchj3u62oyrxvyuxk5q",
"reason": "",
"voter": "0x764014a86fEf4e76f35dd2f7FABDEe94Ea05B0A1",
"vp": 1.019775680308645,
"vp_by_strategy": [
0,
1.019775680308645,
0,
0
]
},
{
"avatar": "https://cdn.stamp.fyi/avatar/eth:0x2249974d3F501F731ba8b2aB64800c8AF80f3489?s=36",
"choice": 1,
"created": 1680000480,
"ipfs": "bafkreihu4l5boxausnoelxaovizccklcjtafehsnw23lhkg25d4b6ch4wa",
"reason": "",
"voter": "0x2249974d3F501F731ba8b2aB64800c8AF80f3489",
"vp": 1.014796,
"vp_by_strategy": [
0,
1.014796,
0,
0
]
}
],
"votes": 7665
}
]
400 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_INVALID_PARAM",
"error": "Invalid param: authorization"
}
GET
/_api/client/r0/oauth/snapshot/space
Query Snapshot space detail with squad id.
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
Required: The access_token returned by a call to /oauth/token |
Name | Type | Description |
---|---|---|
client_id |
string |
id of the registered authorized client. client_id is a required param in query or body |
squad_id |
string |
Required: The squad_id of sqaud ownded by current user. |
Request body
Name | Type | Description |
---|---|---|
client_id |
string |
id of the registered authorized client. client_id is a required param in query or body |
Request body example
{
"cient_id": "6C75636B795F736F6369616C73776170"
}
Responses
Status | Description |
---|---|
200 |
The operation is ok. |
400 |
The authorization is not invalid |
200 response
Name | Type | Description |
---|---|---|
about |
string |
about |
avatar |
string |
avatar |
id |
string |
Required: id. see more: https://docs.snapshot.org/tools/graphql-api |
members |
[] |
members |
name |
string |
Required: name |
network |
string |
network |
symbol |
string |
symbol |
{
"about": "",
"avatar": "ipfs://QmRKgfxSiCU3EmkN52ZaxgKvDyPFUR5DdPvnKxwyLRncKS",
"id": "aave.eth",
"members": [
"0xc8E0345596D7196941E61D3aB607E57Fe61F85E7"
],
"name": "Aave",
"network": "1",
"symbol": "AAVE"
}
400 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_INVALID_PARAM",
"error": "Invalid param: authorization"
}
POST
/_api/client/r0/oauth/snapshot/space
Set Snapshot space url by squad owner.
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
The access_token returned by a call to /oauth/token |
Request body
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client. |
space_url |
string |
Required: Snapshot space url. |
squad_id |
string |
Required: Squad id owned by current user. |
Request body example
{
"client_id": "6C75636B795F736F6369616C73776170",
"space_url": "https://snapshot.org/#/aave.eth",
"squad_id": "!CKuZBiPIQhtEINSDxT:hs-alpha.sending.me"
}
Responses
Status | Description |
---|---|
200 |
The operation is ok. |
400 |
The authorization is not invalid |
200 response
Name | Type | Description |
---|---|---|
about |
string |
about |
avatar |
string |
avatar |
id |
string |
Required: id. see more: https://docs.snapshot.org/tools/graphql-api |
members |
[] |
members |
name |
string |
Required: name |
network |
string |
network |
symbol |
string |
symbol |
{
"about": "",
"avatar": "ipfs://QmRKgfxSiCU3EmkN52ZaxgKvDyPFUR5DdPvnKxwyLRncKS",
"id": "aave.eth",
"members": [
"0xc8E0345596D7196941E61D3aB607E57Fe61F85E7"
],
"name": "Aave",
"network": "1",
"symbol": "AAVE"
}
400 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_INVALID_PARAM",
"error": "Invalid param: authorization"
}
DELETE
/_api/client/r0/oauth/snapshot/space
Unset Snapshot space url by squad owner.
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
The access_token returned by a call to /oauth/token |
Request body
Name | Type | Description |
---|---|---|
client_id |
string |
Required: id of the registered authorized client. |
squad_id |
string |
Required: Squad id of squad owned by current user. |
Request body example
{
"client_id": "6C75636B795F736F6369616C73776170",
"squad_id": "!CKuZBiPIQhtEINSDxT:hs-alpha.sending.me"
}
Responses
Status | Description |
---|---|
200 |
The operation is ok. |
400 |
The authorization is not invalid |
200 response
{}
400 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_INVALID_PARAM",
"error": "Invalid param: authorization"
}
GET
/_api/client/r0/oauth/snapshot/squad
Query Snapshot space realated squad detail with space id.
Rate-limited: | No |
---|---|
Requires authentication: | Yes |
Request
Request parameters
Name | Type | Description |
---|---|---|
Authorization |
string |
Required: The access_token returned by a call to /oauth/token |
Name | Type | Description |
---|---|---|
client_id |
string |
id of the registered authorized client. client_id is a required param in query or body |
space_id |
string |
Required: The space_id. |
Request body
Name | Type | Description |
---|---|---|
client_id |
string |
id of the registered authorized client. client_id is a required param in query or body |
Request body example
{
"cient_id": "6C75636B795F736F6369616C73776170"
}
Responses
Status | Description |
---|---|
200 |
The operation is ok. |
400 |
The authorization is not invalid |
200 response
Name | Type | Description |
---|---|---|
avatar |
string |
avatar |
name |
string |
Required: name |
room_alias |
string |
room_alias |
squad_id |
string |
Required: squad_id |
{
"avatar": "https://hs-alpha.sending.me/_api/media/r0/download/hs-alpha.sending.me/XwwLwhRXPGfoXLtPcQJkatOu",
"name": "Debug snapshot create",
"room_alias": "#debug-snapshot-create:hs-alpha.sending.me",
"squad_id": "!LAPgEMFmZxIpzZGNTo:hs-alpha.sending.me"
}
400 response
Name | Type | Description |
---|---|---|
errcode |
string |
Required: An error code. |
error |
string |
A human-readable error message. |
{
"errcode": "M_INVALID_PARAM",
"error": "Invalid param: authorization"
}